📄 showforum.asp
字号:
<!-- #include file="setup.asp" --><%
forumid=Request("forumid")
if isnumeric(""&forumid&"") = flase then
error("<li>非法操作")
end if
sql="select * from bbsconfig where id="&forumid&""
rs.Open sql,Conn
bbsname=rs("bbsname")
if rs.eof then
message=message&"<li>数据库中不存在ID为 "&forumid&" 的数据"
error(""&message&"")
end if
''''''''''加密论坛验证'''''''
if rs("pass")<>Request.Cookies("pass") and rs("pass")<>"" then
%>
<script>var id=prompt("此论坛为加密论坛,请输入通行密码!","");if(id){document.location='login.asp?menu=pass&forumid=<%=forumid%>&pass='+id+'';}
</script>
<%
message=message&"<li>您的通行密码没有输入"
error(""&message&"")
end if
'''''''''''''''''''''''''''''
if rs("moderated")<>"||" then
master=split(rs("moderated"),"|")
for i = 1 to ubound(master)-1
masterlist=""+masterlist+"<option value=Profile.asp?username="+master(i)+">"+master(i)+"</option>"
next
end if
rs.close
acturl="ShowForum.asp?forumid="&Request("forumid")&""
top
%>
<SCRIPT>if(top==self)document.location='ShowForum.htm?forumid=<%=forumid%>';</SCRIPT>
<title><%=bbsname%></title>
<table width="97%" align="center" border="0">
<tr>
<td vAlign="top" width="30%"><img src="images/logo.gif" border="0"></td>
<td vAlign="center" align="top"> <img src="images/closedfold.gif" border="0"> <a href=Default.asp?menu=listtitle><%=clubname%></a><br>
<img src="images/bar.gif" border="0"><img src="images/openfold.gif" border="0"> <a href="ShowForum.asp?forumid=<%=forumid%>"><%=bbsname%></a></td>
</tr>
</table>
<br>
<script>
var lastreadtree = 0;
function loadThreadFollow(ino,online){
var targetImg =eval("followImg" + ino);
var targetDiv =eval("follow" + ino);
if (targetDiv.style.display!='block'){
var nowtime = new Date();
if (nowtime - lastreadtree < 1 * 1000){alert("请不要同时读取多个帖子,以免造成论坛负荷过重!");return false;}
lastreadtree = nowtime;
targetDiv.style.display="block";
targetImg.src="images/minus.gif";
if (targetImg.loaded=="no"){document.frames["hiddenframe"].location.replace("loading.asp?id="+ino+"&forumid="+online+"");}
}else{
targetDiv.style.display="none";
targetImg.src="images/plus.gif";
}
}
</script>
<iframe HEIGHT="0" WIDTH="0" NAME="hiddenframe"></iframe>
<!-- #include file="inc/line.asp" --><%
forumidonline=conn.execute("Select count(sessionid)from online where forumid="&forumid&"")(0)
regforumidonline=conn.execute("Select count(sessionid)from online where forumid="&forumid&" and username<>''")(0)
if Request("order")="Views" then
order="Views"
elseif Request("order")="replies" then
order="replies"
elseif Request("order")="username" then
order="username"
elseif Request("order")="topic" then
order="topic"
elseif Request("order")="lastname" then
order="lastname"
else
order="lasttime"
end if
if request("TimeLimit")<>"" then
TimeLimit="and DateDiff('d',lasttime,now)<"&request("TimeLimit")&""
else
TimeLimit=""
end if
if Request("search")="author" then
count=conn.execute("Select count(id)from forum where deltopic<>1 and forumid="&forumid&" and username='"&Request("key")&"'")(0)
sql="select * from forum where deltopic<>1 and forumid="&forumid&" and username='"&Request("key")&"' order by "&order&" Desc "
elseif Request("search")="goodtopic" then
count=conn.execute("Select count(id)from forum where deltopic<>1 and forumid="&forumid&" and goodtopic=1")(0)
sql="select * from forum where deltopic<>1 and forumid="&forumid&" and goodtopic=1 order by "&order&" Desc "
else
count=conn.execute("Select count(id)from forum where deltopic<>1 and forumid="&forumid&" "&TimeLimit&"")(0)
sql="select * from forum where deltopic<>1 and forumid="&forumid&" "&TimeLimit&" order by toptopic Desc,"&order&" Desc"
end if
pagesetup=20 '设定每页的显示数量
rs.Open sql,Conn
If Count/pagesetup > (Count\pagesetup) then
TotalPage=(Count\pagesetup)+1
else TotalPage=(Count\pagesetup)
End If
PageCount= 0
on error resume next
RS.MoveFirst
if 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
%>
<table cellSpacing="1" cellPadding="0" width="97%" align="center" border="0" class="a2">
<tr>
<td width="93%" height="25" class="a1"> <img loaded="no" src="images/plus.gif" id="followImg0" style="cursor:hand;" onclick="loadThreadFollow(0,<%=forumid%>)">
目前论坛总在线 <b><%=onlinemany%></b> 人,本分论坛共有 <b><%=forumidonline%></b> 人在线。其中注册用户
<b><%=regforumidonline%></b> 人,访客 <b><%=forumidonline-regforumidonline%></b>
人。</td>
<td align="middle" width="7%" height="25" class="a1">
<a href="javascript:this.location.reload()">
<img src="images/refresh.gif" border="0"></a></td>
</tr>
<tr height="25" style="display:none" id="follow0">
<td id="followTd0" align="left" class="a4" width="94%" colspan="5">
<div onclick="loadThreadFollow(0,<%=forumid%>)">
<table width="100%" cellpadding="10">
<tr>
<td width="100%">Loading...</td>
</tr>
</table>
</div>
</td>
</tr>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table height="30" cellSpacing="0" cellPadding="0" width="97%" align="center" border="0">
<tr>
<td align="left" width="20%"><a href="newtopic.asp?forumid=<%=forumid%>">
<img src="images/sbutton-post2.gif" border="0" alt="发表文章"></a></td>
<td align="right" width="80%"><img src="images/jt.gif"> 论题数:<%=Count%> <img src="images/jt.gif">
<a href="ShowForum.asp?forumid=<%=forumid%>&search=goodtopic">论坛精华</a> <img src="images/team.gif">
<select onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}">
<option>论坛版主</option>
<option>-------</option>
<%=masterlist%></select></td>
</tr>
</table>
<table height="28" cellSpacing="1" cellPadding="1" width="97%" align="center" border="0">
<tr>
<td align="middle" width="3%">
<img height="18" src="images/announce.gif" width="18" align="middle" alt="社区公告"></td>
<td width="75%">
<marquee onmouseover="this.stop()" onmouseout="this.start()" width="400" scrollAmount="3"><a href="#" onclick="javascript:open('affiche.asp','','width=400,height=180,resizable,scrollbars')"><%=affichetitle%></a> [<%=affichetime%>]</marquee></td>
<td width="22%" align="right">
<select onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}">
<option value="ShowForum.asp?forumid=<%=forumid%>">查看所有的主题</option>
<option value="ShowForum.asp?forumid=<%=forumid%>&TimeLimit=1">查看一天内的主题</option>
<option value="ShowForum.asp?forumid=<%=forumid%>&TimeLimit=2">查看两天内的主题</option>
<option value="ShowForum.asp?forumid=<%=forumid%>&TimeLimit=7">查看一星期内的主题</option>
<option value="ShowForum.asp?forumid=<%=forumid%>&TimeLimit=15">查看半个月内的主题</option>
<option value="ShowForum.asp?forumid=<%=forumid%>&TimeLimit=30">查看一个月内的主题</option>
<option value="ShowForum.asp?forumid=<%=forumid%>&TimeLimit=60">查看两个月内的主题</option>
<option value="ShowForum.asp?forumid=<%=forumid%>&TimeLimit=180">查看半年内的主题</option>
</select></td>
</tr>
</table>
<table cellSpacing="1" cellPadding="0" width="97%" align="center" border="0" class="a2">
<tr height="25">
<td width="3%" class="a1"> </td>
<td width="3%" class="a1"> </td>
<td align="middle" height="24" class="a1" width="45%"><font color="#000000">
<a href="ShowForum.asp?forumid=<%=forumid%>&order=topic&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=Request("TimeLimit")%>">
<font color="#000000">主题</font></a></font></td>
<td align="middle" width="9%" height="24" class="a1"><font color="#000000">
<a href="ShowForum.asp?forumid=<%=forumid%>&order=username&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=Request("TimeLimit")%>">
<font color="#000000">作者</font></a></font></td>
<td align="middle" width="6%" height="24" class="a1">
<a href="ShowForum.asp?forumid=<%=forumid%>&order=replies&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=Request("TimeLimit")%>">
<font color="#000000">字[回]</font></a></td>
<td align="middle" width="7%" height="24" class="a1">
<a href="ShowForum.asp?forumid=<%=forumid%>&order=Views&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=Request("TimeLimit")%>">
<font color="#000000">点击</font></a></td>
<td width="27%" height="24" class="a1">
<a href="ShowForum.asp?forumid=<%=forumid%>&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=Request("TimeLimit")%>">
<font color="#000000">最后更新</font></a> <font color="000000">
<a href="ShowForum.asp?forumid=<%=forumid%>&order=lastname&search=<%=Request("search")%>&key=<%=Request("key")%>&TimeLimit=<%=Request("TimeLimit")%>">
<font color="#000000">最后回复</font></a></font></td>
</tr>
<%
i=0
Do While Not RS.EOF and i<pagesetup
i=i+1
if Not Response.IsClientConnected then
responseend
end if
if rs("toptopic")=1 then
reimage="<img src=images/f_top.gif>"
elseif rs("locktopic")=1 then
reimage="<img src=images/f_locked.gif>"
elseif rs("polltopic")<>"" then
reimage="<img src=images/f_poll.gif>"
elseif rs("replies")>15 or rs("views") > 150 then
reimage="<img src=images/f_hot.gif>"
elseif rs("replies")>0 then
reimage="<img src=images/f_new.gif>"
else
reimage="<img src=images/f_norm.gif>"
end if
if rs("goodtopic")=1 then
reimage2="<img src=images/topicgood.gif>"
elseif rs("username")=""&Request.Cookies("username")&"" then
reimage2="<img src=images/my.gif>"
else
reimage2=""
end if
if rs("replies")>0 then
replies="<font color=red>["&rs("replies")&"]</font>"
else
replies=Len(rs("content"))
end if
newtopic=""
if rs("posttime")+1 > Now() then
newtopic="<img src=images/new.gif>"
end if
%>
<tr height="25">
<td align="middle" width="3%" class="a4"><%=reimage%> </td>
<td width="3%" class="a3" align="center"><%=reimage2%> </td>
<td class="a4" width="45%"> <img loaded="no" src="images/plus.gif" id="followImg<%=rs("id")%>" style="cursor:hand;" onclick="loadThreadFollow(<%=rs("id")%>)">
<img border="0" src="images/brow/<%=rs("icon")%>.gif">
<a onclick=min_yuzi() target="message" href="ShowPost.asp?id=<%=rs("id")%>">
<%=rs("topic")%></a>
<SCRIPT>
if (<%=rs("replies")%> > 15) {
var topicpage=""
var tol=<%=rs("replies")%>/15+1;
for (var i=1; i < tol; i++) {
topicpage=topicpage+"<b><a onclick=min_yuzi() target=message href=ShowPost.asp?id=<%=rs("id")%>&topage="+ i +">"+ i +"</a></b> ";
}
document.write(" ( <img src=images/multipage.gif> "+topicpage+") ");
}</SCRIPT><%=newtopic%></td>
<td align="middle" width="9%" class="a3">
<a href="Profile.asp?username=<%=rs("username")%>"><%=rs("username")%> </a></td>
<td align="middle" width="6%" class="a4"><%=replies%> </td>
<td align="middle" width="7%" class="a3"><%=rs("views")%> </td>
<td width="27%" class="a4"> <%=rs("lasttime")%> |
<a href="Profile.asp?username=<%=rs("lastname")%>"><%=rs("lastname")%></a></td>
</tr>
<tr height="25" style="display:none" id="follow<%=rs("id")%>">
<td width="3%" class="a4"> </td>
<td width="3%" class="a3"> </td>
<td id="followTd<%=rs("id")%>" align="left" class="a4" width="94%" colspan="5">
<div onclick="loadThreadFollow(<%=rs("id")%>)">
<table width="100%" cellpadding="10">
<tr>
<td width="100%">Loading...</td>
</tr>
</table>
</td>
</tr>
<%
RS.MoveNext
loop
RS.Close
%>
</table>
<table cellSpacing="1" cellPadding="1" width="97%" align="center" border="0">
<tr height="25">
<td width="100%" height="2">
<table cellSpacing="0" cellPadding="3" width="100%" border="0">
<tr>
<td height="2"><b>本论坛共有 <font color="#990000"><%=TotalPage%></font>
页 [ <%
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 "<a href=?topage=1&forumid="&forumid&"&order="&Request("order")&"&search="&Request("search")&"&key="&Request("key")&"&TimeLimit="&Request("TimeLimit")&">1</a> ... "
end if
for i=ii to iii
If i<>PageCount then
Response.Write " <a href=?topage="& i &"&forumid="&forumid&"&order="&Request("order")&"&search="&Request("search")&"&key="&Request("key")&"&TimeLimit="&Request("TimeLimit")&">" & i & "</a> "
else
Response.Write " <font color=#000000><b>"&i&"</b></font> "
end if
next
if TotalPage > PageCount+5 then
Response.Write " ... <a href=?topage="&TotalPage&"&forumid="&forumid&"&order="&Request("order")&"&search="&Request("search")&"&key="&Request("key")&"&TimeLimit="&Request("TimeLimit")&">"&TotalPage&"</a>"
end if
%> ]</b></td>
<form name="form" action="searchok.asp?forumid=<%=forumid%>&search=key&searchxm2=topic" method="post">
<td height="2" align="right">
快速搜索:<input name="content" style="font-family: Tahoma,Verdana,宋体; font-size: 12px; line-height: 15px" size="20"> <input type="submit" value="搜索" name="submit" style="font-family: Tahoma,Verdana,宋体; font-size: 12px; line-height: 15px"> </td>
</form>
</tr>
</table>
</td>
</tr>
</table>
<br>
<center>
<table cellSpacing="4" cellPadding="0" width="651" border="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td noWrap width="200"><img alt src="images/f_new.gif" border="0"> 打开主题
(有回复的主题)</td>
<td noWrap width="100"><img alt src="images/f_hot.gif" border="0"> 热门主题
</td>
<td noWrap width="100"><img alt src="images/f_locked.gif" border="0">
锁定主题</td>
<td noWrap width="150"><img src="images/topicgood.gif"> 精华主题</td>
</tr>
<tr>
<td noWrap width="200"><img alt src="images/f_norm.gif" border="0"> 打开主题
(没有回复的主题)</td>
<td noWrap width="100"><img alt src="images/f_poll.gif" border="0"> 投票主题</td>
<td noWrap width="100"><img alt src="images/f_top.gif" border="0"> 置顶主题</td>
<td noWrap width="150"><img src="images/my.gif"> 自己发表的主题</td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
<%
htmlend
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -