toplist.asp
来自「安全性好,适用于制作论坛和进行资源下载的个人和大型网站使用!」· ASP 代码 · 共 285 行
ASP
285 行
<!--#include file="inc/pstart.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="inc/bbsinfo.asp"-->
<!--#include file="inc/incpage.asp"-->
<%
start="论坛控制面板"
call checkulogin()
call bbs_top()
dim action,new_id
dim Hx66_collect
action=request.querystring("action")
new_id=CLng(request.querystring("t"))
response.write"<script language='javascript'>function Check(){var Name=document.form.topage.value;document.location='?action="&action&"&topage='+Name+'';}</script>"
set rs=server.CreateObject("adodb.recordset")
sqlstr="select * from hx66_uinfo where hx66_uname='"&ckuname&"'"
rs.open sqlstr,conn,1,1
if not rs.eof then
Hx66_collect=rs("hx66_collect")
else
response.write"<script language=javascript>alert(' 你还没在本论坛发表贴子,请先发贴或回贴后查看!');JavaScript:history.back();</script>"
Response.End
end if
rs.close
set rs=nothing
%>
<table class="table-hx66s" cellSpacing="5" cellPadding="0" width="760" align="center" border="0" bgcolor=#FFFFFF>
<tr>
<td>
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height=26 background="images/B_bg.gif" colspan="9"><FONT color=#b70000> <B>·</B></FONT><a href=default.asp><%=bbsname%></a> → 论坛控制面板</td>
</tr>
<tr>
<td height=10 colspan="9"> </td>
</tr>
<tr align="center">
<td><a href=../Messager.asp?action=inbox target=_blank>我的短信</a></td>
<td height=26><a href=viewperson.asp?author=<%=ckuname%> target=_blank>我的信息</a></td>
<td><a href=myset.asp target=_blank>签名头像</a></td>
<td><a href=toplist.asp?action=collect>我的收藏</a></td>
<td><a href=toplist.asp?action=mytod>我的主题</a></td>
<td><a href=toplist.asp?action=withmetod>我的回复</a></td>
<td><a href=toplist.asp?action=bbstod>论坛热门</a></td>
<td><a href=toplist.asp?action=goodtod>论坛精华</a></td>
<td><a href=toplist.asp?action=newtod>论坛新贴</a></td>
</tr>
</table>
<BR>
<%
if action="" Or Len(action)>11 then action="newtod"
select case action
case "newtod" '最新主题
actionname="最新主题"
sql="select * from hx66_bbs where hx66_delete=0 order by hx66_fatime desc"
call bbs_list()
case "mytod" '我的主题
actionname="我发表的主题"
sql="select * from hx66_bbs where hx66_delete=0 and hx66_name='"&ckuname&"' order by hx66_top desc, hx66_time desc"
call bbs_list()
case "withmetod" '我的回复
actionname="我参与的回复"
sql="select * from hx66_bbs where id in(select hx66_iid from hx66_saybbs where hx66_user='"&ckuname&"') and hx66_delete=0 order by hx66_time desc"
call bbs_list()
case "goodtod" '精华主题
actionname="精华主题"
sql="select * from hx66_bbs where hx66_level=1 and hx66_delete=0 order by hx66_fatime desc"
call bbs_list()
case "bbstod" '热门主题
actionname="热门主题"
sql="select * from hx66_bbs where hx66_delete=0 and hx66_hf>10 order by hx66_hf desc,hx66_fatime desc"
call bbs_list()
case "collect" '我的收藏
call collect()
case "addcollect" '添加收藏
call add_collect()
case "delcollect" '删除收藏
call delcollect()
end select
sub bbs_list()
%>
<table width="740" border="1" align="center" cellspacing="0" cellpadding="5" bgcolor="#FFFFFF" bordercolor="#f0f0f0" style="border-collapse: collapse">
<tr align=center><td height=21 colspan=8><font color=red><B><%=actionname%></B></font></td></tr>
<TR align=middle>
<TD width="30" height=27>状态</td>
<TD width=*>主 题 (点击状态图标开新窗口浏览)</TD>
<TD width="80">作 者</TD>
<TD width="45">人气</td>
<td width="30">回复</TD>
<TD width="125">最后更新</td>
<TD width="80">最后回复</td>
</TR>
<%
set rs = server.createobject("adodb.recordset")
rs.Open sql,conn,1,1
if rs.eof then
response.write"<TR><TD colspan=6 align=center>没有主题</TD></TR>"
End If
pagesetup=30
TotalPage=0
Count=rs.recordcount
if not rs.eof then
If Count/pagesetup > (Count\pagesetup) then
TotalPage=(Count\pagesetup)+1
else TotalPage=(Count\pagesetup)
End If
pagecount= 0
rs.moveFirst
if Request.QueryString("ToPage")<>"" and isnumeric(Request.QueryString("ToPage")) then PageCount = cint(Request.QueryString("ToPage"))
if PageCount <=0 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
rs.move (PageCount-1) * pagesetup
i=1
do while not rs.eof
response.write"<TR><TD align=middle height=27><a href=bbs_detail.asp?bid="&rs("hx66_bid")&"&aid="&rs("id")&" target=_blank>"
if rs("hx66_top")=3 then
response.write"<img src=images/top1.gif alt=总固主题 border=0>"
elseif rs("hx66_top")=1 then
response.write"<img src=images/top.gif alt=固顶主题 border=0>"
elseif rs("hx66_level")=1 then
response.write"<img src=images/isbest.gif alt=精华主题 border=0>"
elseif rs("hx66_close")=1 then
response.write"<img src=images/close.gif alt=锁定主题 border=0>"
elseif rs("hx66_vote")=1 then
response.write"<img src=images/poll.gif alt=投票主题 border=0>"
elseif rs("hx66_hf")>=10 then
response.write"<img src=images/hot.gif alt=热门主题 border=0>"
else
response.write"<img src=images/4.gif alt=开放主题 border=0>"
end if
response.write"</a></td><TD align=left> <a href=bbs_detail.asp?bid="&rs("hx66_bid")&"&aid="&rs("id")&">"&rs("hx66_title")&"</a></td><TD align=center>"&rs("hx66_name")&"</a></td><TD align=center>"&rs("hx66_count")&"</td><TD align=center>"&rs("hx66_hf")&"</td><TD align=center>"&rs("hx66_time")&"</td><TD align=center>"&rs("hf_name")&"</td></tr>"
i=i+1
if i>pagesetup then exit do
rs.movenext
loop
end if
rs.Close
set rs=nothing
href1=" <a href=?topage=1&action="&action&">"
response.write"</table>"&tbottom&"<table border=0 cellpadding=0 cellspacing=3 bgcolor=#FFFFFF width=740 align=center><form name=form method='POST' action=javascript:Check()><td valign=middle><div align=left><b>主题分页:</b> "
ii=PageCount-5
iii=PageCount+5
if ii < 1 then
ii=1
end if
if iii > TotalPage then
iii=TotalPage
end if
if PageCount > 6 then
Response.Write "<SPAN>"&href1&"<font color=#555555><b>1</b></font></a></SPAN> ... "
end if
for i=ii to iii
If i<>PageCount then
href2="<a href=?topage="& i &"&action="&action&">"
href3="<a href=?topage="&TotalPage&"&action="&action&">"
Response.Write "<SPAN>"&href2&"<font color=#555555><b>" & i & "</b></font></a></SPAN> "
else
Response.Write "<SPAN><font color=#FF6600><b>"&i&"</b></font></a></SPAN> "
end if
next
if TotalPage > PageCount+5 then
Response.Write " ... <SPAN>"&href3&"<font color=#555555><b>"&TotalPage&"</b></font></a></SPAN>"
end if
response.write" <b>转到:</b> <input style=FONT-SIZE:9pt maxLength='6' size='1' name='topage' value='"&PageCount&"'> <input style=FONT-SIZE:9pt value='GO' type='submit'></div></td><td valign=middle><div align=right>本版共</font><b>"&TotalPage&"</b> 页, 合计<b>"&count&"</b> 个主题,每页<b>"&pagesetup&"</b> </font> 个主题</div></td></TR></form></center></div>"
end sub
sub collect()
%>
<table width="740" border="1" align="center" cellspacing="0" cellpadding="5" bgcolor="#FFFFFF" bordercolor="#f0f0f0" style="border-collapse: collapse">
<tr align=center><td height=21 colspan=8><font color=red><B>我的主题贴收藏</B></font></td></tr>
<TR align=middle>
<TD width="25" height=27>状态</td>
<TD width=*>主 题 (点击状态图标开新窗口浏览)</TD>
<TD width="80">作 者</TD>
<TD width="45">人气</td>
<td width="30">回复</TD>
<TD width="120">最后更新</td>
<TD width="70">最后回复</td>
<TD width="25">删除</td>
</TR>
<%
temp=split(Hx66_collect,"|")
for j = 1 to ubound(temp)
sql="select * from hx66_bbs where id="&temp(j)&""
set rs = server.createobject("adodb.recordset")
rs.open sql,conn,1,1
If rs.EOF And rs.BOF Then
Response.Write "<tr align=center><td height=21 colspan=8>您目前还没有收藏主题贴!</td></tr>" & vbCrLf
else
response.write"<TR><TD align=middle height=27><a href=bbs_detail.asp?bid="&rs("hx66_bid")&"&aid="&rs("id")&" target=_blank>"
if rs("hx66_top")=3 then
response.write"<img src=images/top1.gif alt=总固主题 border=0>"
elseif rs("hx66_top")=1 then
response.write"<img src=images/top.gif alt=固顶主题 border=0>"
elseif rs("hx66_level")=1 then
response.write"<img src=images/isbest.gif alt=精华主题 border=0>"
elseif rs("hx66_close")=1 then
response.write"<img src=images/close.gif alt=锁定主题 border=0>"
elseif rs("hx66_vote")=1 then
response.write"<img src=images/poll.gif alt=投票主题 border=0>"
elseif rs("hx66_hf")>=10 then
response.write"<img src=images/hot.gif alt=热门主题 border=0>"
else
response.write"<img src=images/4.gif alt=开放主题 border=0>"
end if
response.write"</a></td>"
response.write"<TD align=left> <a href=bbs_detail.asp?bid="&rs("hx66_bid")&"&aid="&rs("id")&">"&rs("hx66_title")&"</a></td>"
response.write"<TD align=center>"&rs("hx66_name")&"</a></td>"
response.write"<TD align=center>"&rs("hx66_count")&"</td>"
response.write"<TD align=center>"&rs("hx66_hf")&"</td>"
response.write"<TD align=center>"&rs("hx66_time")&"</td>"
response.write"<TD align=center>"&rs("hf_name")&"</td>"
response.write"<TD align=center><a href='toplist.asp?action=delcollect&collect_id="&j&"' Title='删除此主题收藏'><font color=#FF0000>×</font></td></tr>"
end if
next
end sub
sub add_collect()
dim temp,bbsname
if new_id<1 then
Response.Write "<script language=javascript>alert('非法操作,请指定操作对象!');JavaScript:window.close();</script>"
Response.End
end if
set rs=server.createobject("adodb.recordset")
sql="select * from hx66_bbs where id="&new_id
rs.open sql,conn,1,1
If rs.eof and rs.bof Then
response.Write"<script language=javascript>alert('要添加的主题贴不存在!!');JavaScript:window.close();</script>"
response.end
else
bbsname=rs("hx66_title")
end if
rs.close
IF Hx66_collect<>"" Then
Hx66_collect=Hx66_collect
else
Hx66_collect="|123456790"
End IF
temp=split(Hx66_collect,"|")
for j = 1 to ubound(temp)
if instr(new_id,temp(j))>0 then
'if new_id=temp(j) then
Response.Write"<script language=javascript>alert('此主题贴已在你的收藏列表内!!');JavaScript:window.close();</script>"
response.end
end if
next
if ubound(temp)>=50 then
Response.Write"<script language=javascript>alert('您的收藏已达到系统50个限定数,请清理后添加!!');JavaScript:window.close();</script>"
Response.end
end if
dim temp1
temp1="|"
temp1=Hx66_collect&""&temp1&""&new_id
conn.execute"Update hx66_uinfo set hx66_collect='"&temp1&"' where hx66_uname='"&ckuname&"'"
response.Write"<script language=javascript>alert(' 已成功将『"&bbsname&"』加入到您的主题贴收藏列表内!');JavaScript:window.close();</script>"
response.end
rs.Close
set rs=nothing
end sub
sub delcollect()
dim i
dim temp
dim temp_collect
dim collect_id
collect_id=request("collect_id")
temp=split(Hx66_collect,"|")
for i = 1 to ubound(temp)
if CLng(i)=CLng(collect_id) then
temp_collect=temp_collect
else
temp_collect=temp_collect&"|"&temp(i)
end if
next
conn.execute"Update hx66_uinfo set hx66_collect='"&temp_collect&"' where hx66_uname='"&ckuname&"'"
set temp=nothing
set temp_collect=nothing
response.Write"<script language=javascript>alert(' 已成功删除编号为("&(collect_id)&")的我的收藏主题贴!');this.location.href='toplist.asp?action=collect';</script>"
rs.close
set rs=nothing
response.end
end sub
response.write"</TABLE></td></tr></TABLE>"
call bbs_foot()
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?