如何編寫TOP 10之類的熱門排行榜?

來源:互聯網
上載者:User

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.