www.gusucode.com > QQ空间互踩联盟源码程序asp编程 > rank.asp
<!--#include file="conn.asp"--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML lang="gb2312" xmlns="http://www.w3.org/1999/xhtml"><HEAD> <META http-equiv=Content-Type content="text/html; charset=gb2312"><title>排行榜 - <%=WebName%> <%=ChannelName%></title> <meta http-equiv="content-type" content="text/html;charset=gb2312"/> <link rel="icon" href="images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" /> <meta content=<%=ChannelName%> name=description> <meta content=排行榜,<%=ChannelName%> name=Keywords> <link rel="stylesheet" href="qzonev_com.css" type="text/css"/> </HEAD> <BODY style="MARGIN: 0px; TEXT-ALIGN: center"> <% dim find,webtype,pl dim rs,sql dim condition,linkstr find=hx.checkstr(trim(request("find")),50) webtype=request("webtype") sql="select * from Qzonev_Com_Link" condition = " where 1=1 " pl=request("pl") if pl="" then pl="inp" end if linkstr = "pl=" & pl if webtype="" or not isnumeric(webtype) then webtype=0 elseif webtype>0 then condition = condition & " and webtype="&webtype end if linkstr = linkstr & "&webtype="&webtype if find<>"" then condition = condition & " and (sitename like '%"&find&"%' or siteurl like '%"&find&"%')" linkstr = linkstr & "&find="&find end if '分页信息 dim PageNo PageNo=Request.QueryString("PageNo") if PageNo="" or not isnumeric(PageNo) then PageNo=1 else PageNo=int(PageNo) end if '普通sql语句 sql=sql & condition &" ORDER BY "&pl&" DESC" %> <!--#include file="top.asp"--> <TABLE borderColor=#000000 cellSpacing=2 cellPadding=1 width=950 align=center bgColor=#000000 border=1> <tr> <td borderColor=#333333 bgColor=#000000 background="images/top_2.jpg"><div align="center"><b><%=WebName%>排行榜[只显示前<font color=#99FF00>50</font>名]</b></div></td> </tr> </table> <%if webtype=0 then%> <TABLE borderColor=#000000 cellSpacing=2 cellPadding=1 width=950 align=center bgColor=#000000 border=1> <TR align="center" borderColor=#333333 bgColor=#1D1D1D> <TD width="25%">今日得票用户排行榜</TD> <TD width="25%">今日被踩用户排行榜</TD> <TD width="25%">本月得票用户排行榜</TD> <TD width="25%">本月被踩用户排行榜</TD> </TR> <TR align="center" borderColor=#333333 bgColor=#111111 vAlign=top> <TD><%call showtop(1,1)%></TD> <TD><%call showtop(2,1)%></TD> <TD><%call showtop(1,2)%></TD> <TD><%call showtop(2,2)%></TD> </TR></TABLE> <%end if%> <!--#include file="under.asp"--> <% Function ShowTop(x,y) Dim OutStr,conditionstr Dim rs,sql,i if y=2 then if x=1 then conditionstr=" where inc>0 order by inc desc" else conditionstr=" where outc>0 order by outc desc" end if sql="select top 50 sitename,inc,outc,username from Qzonev_Com_Link "&conditionstr else if x=1 then conditionstr=" where inj>0 order by inj desc" else conditionstr=" where outj>0 order by outj desc" end if sql="select top 50 sitename,inj,outj,username from Qzonev_Com_Link "&conditionstr end if OutStr = "<table cellpadding=1 cellspacing=0 border=0 class=nav>" set rs=hx.Execute(sql) if rs.eof then OutStr= OutStr & "<tr><td align=center>暂时还没有数据</td></tr>" else do while not rs.eof and i<50 OutStr= OutStr & "<tr><td width=180 height=23>" OutStr= OutStr & " <img src=images/star.gif>" OutStr= OutStr & " <a target=_blank href=out.asp?username="&rs(3)&">"&rs(0)&"</a>" OutStr= OutStr & "</td><td width=54 align=right><font color=#FFFF99>" if x=1 then OutStr= OutStr & ""&rs(1) & ":票" else OutStr= OutStr & ""&rs(2) & ":次" end if OutStr= OutStr & "</font></font></td><tr>" i=i+1 rs.movenext loop end if OutStr= OutStr & "</table>" Response.Write OutStr End Function %> </body> </html>