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

栏目: 编程语言 · 发布时间: 6年前

内容简介:如何编写TOP 10之类的排行榜?

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


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

跨平台桌面应用开发:基于Electron与NW.js

跨平台桌面应用开发:基于Electron与NW.js

【丹】Paul B. Jensen / Goddy Zhao / 2018-3 / 99

《跨平台桌面应用开发:基于Electron与NW.js》是一本同时介绍 Electron和 NW.js的图书,这两者是目前流行的支持使用 HTML、CSS 和 JavaScript 进行桌面应用开发的框架。书中包含大量的编码示例,而且每个示例都是五脏俱全的实用应用,作者对示例中的关键代码都做了非常详细的解释和说明,可让读者通过实际的编码体会使用这两款框架开发桌面应用的切实感受。除此之外,在内容上,......一起来看看 《跨平台桌面应用开发:基于Electron与NW.js》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具