当前位置: 代码网 > it编程>编程语言>其他编程 > 如何编写TOP 10之类的排行榜?

如何编写TOP 10之类的排行榜?

2024年05月15日 其他编程 我要评论
<% @ language="vbscript" %><% option explicit %><!--#include file="dataconn.asp"-->

<% @ 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 rel="stylesheet" type="text/css" href="site.css">

<title>山水盈盈之论坛大英雄</title>

</head>

 

<body class="detail">

 

<table border="0" width="70%" cellpadding="0" align="center">

  <tr>

    <td width="16%" align="center"><font color="#0000a0">名次</font></td>

    <td width="16%" class="listline" align="center"><font color="#0000a0">网名</font></td>

    <td width="17%" class="listline" align="center"><font color="#0000a0">帖数</font></td>

    <td width="17%" align="center"><font color="#0000a0">名次</font></td>

    <td width="17%" class="listline" align="center"><font color="#0000a0">网名</font></td>

    <td width="17%" class="listline" align="center"><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 width="16%" align="center" valign="bottom"><font size="2"

    color="#0000a0"><b><%=ida%></b></font> </td>

    <td class="listline" align="center" style="cursor:hand" onmouseup="window.open('userinfo.asp?username=<%=rs("username")%>','call','width=350,height=400,left=300,top=100,toolbar=no,status=no')"><font color=#0000cc><%=rs("username")%></font></td>

    <td class="listline" align="center"><%=rs("iperience")%></td>

</td>

<%rs.movenext%>

    <td width="17%" align="center" valign="bottom"><font size="2"

    color="#0000a0"><b><%=idb%></b></font> </td>

    <td class="listline" align="center" style="cursor:hand" onmouseup="window.open('userinfo.asp?username=<%=rs("username")%>','call','width=350,height=400,left=300,top=100,toolbar=no,status=no')"><font color=#0000cc><%=rs("username")%></font></td>

    <td class="listline" align="center"><%=rs("iperience")%></td>

  </tr>

<%

ida=ida+2

idb=idb+2

rs.movenext

next

%>

<% if reguser>20 then

for b=11 to 15 %>                           

    <td class="listline" align="center" style="cursor:hand" onmouseup="window.open('userinfo.asp?username=<%=rs("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 class="listline" align="center" style="cursor:hand" onmouseup="window.open('userinfo.asp?username=<%=rs("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>

 

[1]

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com