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

发布时间:2022-04-17 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了如何编写TOP 10之类的排行榜?脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

<% @ LANGUAGE="vbscript" %>

<% OPTION ExpLICIT %>

<!--#include file="DataConn.asp"-->

<!--#include file="FuncSet.asp"-->

<% dim rs,SQL,IDa,IDb,s,RegUser,a,b,c

&nbsp;

   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]

脚本宝典总结

以上是脚本宝典为你收集整理的如何编写TOP 10之类的排行榜?全部内容,希望文章能够帮你解决如何编写TOP 10之类的排行榜?所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: