📄 topic.asp
字号:
<% Option Explicit %>
<!-- #include file="includes/header.asp" -->
<%
Response.Buffer = True
Dim dtmstartdate
Dim rsBBS
Dim rsST
Dim intForumID
Dim strForumName
Dim lngNumberOfReplies
Dim lngTopicID
Dim strSubject
Dim strTopicStartUsername
Dim lngTopicStartUserID
Dim lngNumberOfViews
Dim lngLastEntryMessageID
Dim strLastEntryUsername
Dim lngLastEntryUserID
Dim dtmLastEntryDate
Dim intRecordPositionPageNum
Dim intTotalNumOfPages
Dim intRecordLoopCounter
Dim intTopicPageLoopCounter
Dim intLinkPageNum
Dim intShowTopicsFrom
Dim strShowTopicsFrom
Dim blnForumLocked
Dim blnTopicLocked
Dim intPriority
Dim intNumberOfTopicPages
Dim intTopicPagesLoopCounter
Dim lngPollID
Dim blnNewPost
Dim intShowTopicsWithin
Dim intMovedForumID
intForumID = CInt(Request.QueryString("fid"))
If intForumID = 0 Then
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect "index.asp"
End If
If Request.QueryString("pn") = "" OR Request.QueryString("pn") = 0 Then
intRecordPositionPageNum = 1
Else
intRecordPositionPageNum = CInt(Request.QueryString("pn"))
End If
Set rsBBS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT timesbbs.* FROM timesbbs WHERE bbsid = " & intForumID & ";"
rsBBS.Open strSQL, adoCon
If NOT rsBBS.EOF Then
strForumName = rsBBS("bbsname")
blnForumLocked = CBool(rsBBS("Locked"))
intShowTopicsWithin = CInt(rsBBS("distopic"))
Call forumPermisisons(intForumID, intGroupID, CInt(rsBBS("Read")), CInt(rsBBS("Post")), CInt(rsBBS("replypost")), CInt(rsBBS("editpost")), CInt(rsBBS("delpost")), 0, CInt(rsBBS("addpoll")), CInt(rsBBS("Vote")), 0, 0)
If blnRead = False Then
rsBBS.Close
Set rsBBS = Nothing
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect "nopermission.asp"
End If
If rsBBS("Password") <> "" and Request.Cookies("PrForum")("Forum" & intForumID) <> rsBBS("codes") Then
rsBBS.Close
Set rsBBS = Nothing
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect "password.asp?fid=" & intForumID
End If
End If
If Request.Cookies("show") <> "" Then
intShowTopicsFrom = CInt(Request.Cookies("show"))
Else
intShowTopicsFrom = intShowTopicsWithin
End If
Select Case intShowTopicsFrom
Case 0
strShowTopicsFrom = "所有"
case 7
strShowTopicsFrom = "一周"
case 14
strShowTopicsFrom = "两周"
Case 31
strShowTopicsFrom = "一个月"
Case 62
strShowTopicsFrom = "两个月"
Case 182
strShowTopicsFrom = "六个月"
Case 365
strShowTopicsFrom = "一年"
End Select
%>
<title><% = strMainForumName %>: <% = strForumName %></title>
<script language="JavaScript">
function ShowTopics(Show){
strShow = escape(Show.options[Show.selectedIndex].value);
document.cookie = "show=" + strShow
if (Show != "") self.location.href = "topic.asp?fid=<% = intForumID %>&pn=1";
return true;
}
</script>
<table width="96%" border="0" cellspacing="0" cellpadding="1" align="center">
<tr>
<td class="heading"><%
If blnForumLocked = True Then
%>
<span class="Text">(<img src="images/forumlocked.gif" align="baseline" alt="论坛已锁"> 论坛已锁)</span>
<%
End If %></td>
</tr>
</table>
<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#F8F7EF">
<tr>
<td class="bold" height="30"><img src="images/open.gif" border="0" align="absmiddle"> <a href="index.asp" target="_self" class="boldLink"><% = strMainForumName %></a>
<%= strNavSpacer %>
<%
If rsBBS.EOF Then
%>
<span class="bold">目前还没有论坛</span>
<% Else %>
<a href="topic.asp?fid=<%= intForumID %>" target="_self" class="boldLink"><%= strForumName %></a>
<% End If
rsBBS.Close %>
</td> </tr> </table>
<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><a href="messpost.asp?mode=new&fid=<% = intForumID %>" target="_self"><img src="images/postnew.gif" border="0" align="absmiddle" alt="发表新主题"></a>
<%
If blnPollCreate = True Then
%>
<a href="poll.asp?fid=<%= intForumID %>" target="_self"><img src="images/newpoll.gif" border="0" align="absmiddle" alt="发起投票"></a>
<%
End If
%></td>
<form>
<td width="50%" align="right" ><span class="text">显示主题</span>
<select name="show" onChange=ShowTopics(this)>
<option value="0" <% If intShowTopicsFrom = 0 Then Response.Write "selected" %>>所有</option>
<option value="7" <% If intShowTopicsFrom = 7 Then Response.Write "selected" %>>上一周</option>
<option value="14" <% If intShowTopicsFrom = 14 Then Response.Write "selected" %>>上两周</option>
<option value="31" <% If intShowTopicsFrom = 31 Then Response.Write "selected" %>>上个月</option>
<option value="62" <% If intShowTopicsFrom = 62 Then Response.Write "selected" %>>上两月</option>
<option value="182" <% If intShowTopicsFrom = 182 Then Response.Write "selected" %>>半年前</option>
<option value="365" <% If intShowTopicsFrom = 365 Then Response.Write "selected" %>>一年前</option>
</select>
</td>
</form>
</tr>
</table>
<table width="96%" border="0" align="center" cellspacing="1" cellpadding="0" bgcolor="<% = strTableBgColour %>">
<tr class="tHeading" height="25" align="center">
<td width="40" nowrap background="<% = strTableTitleBgImage %>">状态</td>
<td align="left" background="<% = strTableTitleBgImage %>">主题</td>
<td width="13%" background="<% = strTableTitleBgImage %>">作者</td>
<td width="60" background="<% = strTableTitleBgImage %>">回复</td>
<td width="60" background="<% = strTableTitleBgImage %>">浏览</td>
<td width="15%" colspan="2" background="<% = strTableTitleBgImage %>">最后发表</td>
</tr><%
strSQL = "SELECT timestopic.topicid, timestopic.moved, timestopic.viewnum, timestopic.Subject, timestopic.pollid, timestopic.Locked, timestopic.Priority, timestopic.startdtm "
strSQL = strSQL & "FROM timestopic "
If intShowTopicsFrom = 0 Then
strSQL = strSQL & "WHERE (timestopic.bbsid = " & intForumID & ") OR (timestopic.Priority = 3) OR (timestopic.moved = " & intForumID & ") "
Else
strSQL = strSQL & "WHERE (((timestopic.bbsid = " & intForumID & ") OR (timestopic.moved = " & intForumID & ")) AND ((timestopic.lastdtm > Now() - " & intShowTopicsFrom & ") OR (timestopic.Priority > 0))) OR (timestopic.Priority = 3) "
End If
strSQL = strSQL & "ORDER BY timestopic.Priority DESC, timestopic.lastdtm DESC;"
rsBBS.CursorType = 1
rsBBS.Open strSQL, adoCon
rsBBS.PageSize = intTopicPerPage
If rsBBS.EOF Then %>
<td bgcolor="#ffffff" colspan="7" class="text" height="25">论坛没有主题</td>
<% Else
rsBBS.AbsolutePage = intRecordPositionPageNum
If rsBBS.EOF AND intRecordPositionPageNum > 1 Then rsBBS.AbsolutePage = 1
intTotalNumOfPages = rsBBS.PageCount
Set rsST = Server.CreateObject("ADODB.Recordset")
For intRecordLoopCounter = 1 to intTopicPerPage
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -