仿照CHINAASP论坛中TOP10写的部分显示代码

网络整理 - 07-26
hawkfly 发表于2000-11-8 17:43:只是刚刚写完,未做优化,具体可参照CHINAASP论坛TOP10修改
<% @ LANGUAGE="VBscript" %>
<% OPTION EXPLICIT %>
<!--#include file="DataConn.asp"-->
<!--#include file="FuncSet.asp"-->
<% dim rs,sql,IDa,IDb,s,RegUser,a,b,c

   Set rs=Server.CreateObject("ADODB.recordset")
   sql="Select * from UserInfo ORDER BY iPerience DESC"
   rs.Open sql,ConnStr,1,1
   RegUser=rs.RecordCount

IDa=1
IDb=2
%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="pragma" content="no-cache">
<link type="text/css" href="Site.css">
<title>龙虎排行</title>
</head>

<body>

<table cellpadding="0">
  <tr>
    <td bgcolor="#FFFFFF"><font color="#0000A0">名次</font></td>
    <td><font color="#0000A0">网名</font></td>
    <td><font color="#0000A0">帖子数</font></td>
    <td bgcolor="#FFFFFF"><font color="#0000A0">名次</font></td>
    <td><font color="#0000A0">网名</font></td>
    <td><font color="#0000A0">帖子数</font></td>
  </tr>
<% if RegUser<10 then
a=RegUser/2
else
a=5
end if
for s=1 to a
%>
  <tr>
    <td bgcolor="#FFFFFF" valign="bottom"><font size="2"
    color="#0000A0"><b><%=IDa%></b></font> </td>
    <td UserName")%>','Call','width=350,height=400,left=300,top=100,toolbar=no,status=no')"><font color=#0000CC><%=rs("UserName")%></font></td>
    <td><%=rs("iPerience")%></td>
</td>
<%rs.movenext%>
    <td bgcolor="#FFFFFF" valign="bottom"><font size="2"
    color="#0000A0"><b><%=IDb%></b></font> </td>
    <td UserName")%>','Call','width=350,height=400,left=300,top=100,toolbar=no,status=no')"><font color=#0000CC><%=rs("UserName")%></font></td>
    <td><%=rs("iPerience")%></td>
  </tr>
<%
IDa=IDa+2
IDb=IDb+2
rs.movenext
next
%>
<% if RegUser>20 then
for b=11 to 15 %>                            
    <td UserName")%>','Call','width=350,height=400,left=300,top=100,toolbar=no,status=no')"><font color=#0000CC><%=rs("UserName")%></font></td>
<% rs.movenext%>
<%
next
end if %>
<% if RegUser>20 then
for c=16 to 20 %>                            
    <td UserName")%>','Call','width=350,height=400,left=300,top=100,toolbar=no,status=no')"><font color=#0000CC><%=rs("UserName")%></font></td>
<% rs.movenext%>
<%
next
end if %>

</table>

</body>

</html>