欢迎来到科站长!

编程10000问

当前位置: 主页 > 网络编程 > 编程10000问

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

时间:2018-08-02 19:37:23|栏目:编程10000问|点击:

<% @ 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>

 

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

  <tr>

    <td width="16%"><font color="#0000A0">名次</font></td>

    <td width="16%"><font color="#0000A0">网名</font></td>

    <td width="17%"><font color="#0000A0">帖数</font></td>

    <td width="17%"><font color="#0000A0">名次</font></td>

    <td width="17%"><font color="#0000A0">网名</font></td>

    <td width="17%"><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%" valign="bottom"><font size="2"

    color="#0000A0"><b><%=IDa%></b></font> </td>

    <td 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><%=rs("iPerience")%></td>

</td>

<%rs.movenext%>

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

    color="#0000A0"><b><%=IDb%></b></font> </td>

    <td 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><%=rs("iPerience")%></td>

  </tr>

<%

IDa=IDa+2

IDb=IDb+2

rs.movenext

next

%>

<% if RegUser>20 then

for b=11 to 15 %>                           

    <td 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 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>


上一篇:如何把中文转换为UNICODE?

栏    目:编程10000问

下一篇:如何动态添加Form项?

本文标题:如何编写TOP 10之类的排行榜?

本文地址:https://fushidao.cc/wangluobiancheng/577.html

广告投放 | 联系我们 | 版权申明

申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:1205677645 | 邮箱:1205677645@qq.com

Copyright © 2018-2024 科站长 版权所有冀ICP备14023439号