📄 displaytopic.asp
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include file="Includes/site-dataconn.asp" -->
<!--#include file="Includes/func-common.asp" -->
<!--#include file="Includes/site-config.asp" -->
<!--#include file="Includes/inc-common.asp" -->
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<html>
<head>
<title>// <%=Site_Name%> //</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK REL=stylesheet TYPE="text/css" HREF="Includes/site-style.css">
</head>
<body>
<!--#include file="Includes/inc-header.asp" -->
<%
if isnumeric(request.querystring("T")) = true then
'Retrieve forum, category and topic name from database, if it doesn't exist invalid forum was selected
set rsForums = server.createobject("adodb.recordset")
sqlForums = "SELECT FF.Forum_Name, FF.Forum_ID, FF.Forum_Group_ID, FC.Category_Title, FC.Category_ID, FT.Topic_Title FROM Forum_Forums FF, Forum_Categories FC, Forum_Topics FT WHERE FT.Topic_ID = "& int(request.querystring("T")) &" AND FF.Forum_ID = FT.Topic_Forum_ID AND FC.Category_ID = FF.Forum_Category_ID AND FT.Topic_Type <> 0;"
rsForums.Open sqlForums, adoConn, CMDText
if rsForums.eof or rsForums.bof then
rsForums.close
set rsForums = nothing
'Set error message
strMessage = "The topic that you have selected does not exist. If you have followed a valid link please contact the board administrator."
strRedirectURL = "default.asp"
else
'Set page variables
strForum = rsForums("Forum_Name")
strForumID = rsForums("Forum_ID")
strGroupID = rsForums("Forum_Group_ID")
strCategory = rsForums("Category_Title")
strCategoryID = rsForums("Category_ID")
strTopic = rsForums("Topic_Title")
rsForums.close
set rsForums = nothing
end if
else
'Set error message
strMessage = "The topic that you have selected does not exist. If you have followed a valid link please contact the board administrator."
strRedirectURL = "default.asp"
end if
if strGroupID <> "" and session("admin") <> true then
'Add Group Checking Code
end if
'Display error message if one exists
if strMessage <> "" then
%>
<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center" class="main">
<tr valign="middle" class="title">
<td align="center"><%=Site_Name%> // Error</td>
</tr>
<tr valign="top" class="body">
<td align="center"><%=strMessage%></td>
</tr>
</table>
<META HTTP-EQUIV="Refresh" CONTENT="5; URL=<%=strRedirectURL%>">
<%
else
response.write("<table border='0' cellspacing='0' cellpadding='2' align='center' class='plain'><tr><td valign='top'><a href='default.asp'>"& Site_Name &"</a> >> <a href='displaycategory.asp?C="& strCategoryID &"'>"& strCategory &"</a> >> <a href='displayforum.asp?F="& strForumID &"'>"& strForum &"</a> >> "& strTopic &"<br>")
response.write(Site_Description &"</td></tr></table>")
if session("userid") <> "" then
'Update users "read" cookie
strReadCookie = request.cookies(site_name)("read")
strReadTopic = int(request.querystring("T")) & "r"
if instr(1, strReadCookie, strReadTopic, 1) = 0 then
strReadCookie = strReadCookie & strReadTopic
response.cookies(site_name)("read") = strReadCookie
end if
end if
'Update topic views
set rsViews = server.createobject("adodb.recordset")
sqlViews = "SELECT Topic_ID, Topic_Views FROM Forum_Topics WHERE Topic_ID = "& clng(request.querystring("T")) &";"
rsViews.cursortype = 2
rsViews.locktype = 3
rsViews.open sqlViews, adoConn, CMDText
rsViews("Topic_Views") = rsViews("Topic_Views") + 1
rsViews.update
rsViews.close
'Set topic page size
iPagesize = Site_View_Posts
'Set current page
if request.querystring("P") = "" then
iPageCurrent = 1
else
iPageCurrent = int(request.querystring("P"))
end if
'Retrieve all posts from the specified topic.
set rsPosts = server.createobject("adodb.recordset")
rsPosts.PageSize = iPageSize
rsPosts.CacheSize = iPageSize
sqlPosts = "SELECT FP.Post_User_ID, FP.Post_ID, FP.Post_Time, FP.Post_IP, FP.Post_Title, FP.Post_text, FP.Post_Signature, FU.User_ID, FU.User_Name, FU.User_Join_Date, FU.User_Laston_Date, FU.User_Signature, FU.User_Title, FU.User_Avatar, FU.User_Posts, FU.User_Location, FU.User_ICQ, FU.User_MSN, FU.User_AIM, FU.User_Website, FU.User_Email_View, FU.User_Online_View, FT.Topic_Status, FT.Topic_Type FROM (Forum_Posts FP INNER JOIN Forum_Users FU ON FP.Post_User_ID = FU.User_ID) INNER JOIN Forum_Topics FT ON FP.Post_Topic_ID = FT.Topic_ID WHERE (FP.Post_Topic_ID = "& int(request.querystring("T")) &") ORDER BY FP.Post_ID ASC;"
rsPosts.Open sqlPosts, adoConn, CMDText
'If the Recordset is not emtpy then load it up into an array then close and destroy the recordset.
if not rsPosts.eof then
iPageCount = rsPosts.PageCount
if iPageCurrent > iPageCount then iPageCurrent = iPageCount
if iPageCurrent < 1 then iPageCurrent = 1
if request.querystring("goto") = "lastpost" then iPageCurrent = iPageCount
rsPosts.AbsolutePage = iPageCurrent
PostsData = rsPosts.GetRows(iPageSize)
PostsCnt = UBound(PostsData, 2) + 1
rsPosts.close
set rsPosts = nothing
Topic_Status = PostsData(22,0)
else
PostsCnt = 0
rsPosts.close
set rsPosts = nothing
end if
'Generate temporary counter
tempCnt = 0
'Build topics header
response.write("<table border='0' cellspacing='1' cellpadding='0' align='center' class='plain'><tr><td align='right'><a href='newtopic.asp?F="& strForumID &"'><img src='Images/Icons/button_post.gif' border='0' align='absmiddle' alt='>> Post New Topic'></a> ")
if Topic_Status = 1 then
response.write("<a href='newreply.asp?T="& int(request.querystring("T")) &"'><img src='Images/Icons/button_reply.gif' border='0' align='absmiddle' alt='>> Reply To This Post'></a></td></tr></table>")
else
response.write("<img src='Images/Icons/button_closed.gif' align='absmiddle' alt='>> Topic Closed'></td></tr></table>")
end if
response.write("<table width='100%' border='0' cellspacing='1' cellpadding='3' align='center' class='main'><tr valign='middle' class='title'><td width='175'>作 者</td><td>话题</font></td></tr></table>")
'Start building main forum view
do until tempCnt = PostsCnt
response.write("<table width='100%' border='0' cellspacing='1' cellpadding='3' align='center' class='main'><tr class='body'><td width='175' valign='top'>")
'User details
response.write("<b>" & PostsData(8,tempCnt) & "</b><br>")
if Site_Allow_Title <> 0 and PostsData(12,tempCnt) <> "" then
response.write(PostsData(12,tempCnt) & "<br>")
end if
if Site_Allow_Avatar <> 0 and PostsData(13,tempCnt) <> "" then
response.write("<img src='"& PostsData(13,tempCnt) & "' border='0'><br>")
end if
response.write("<br>入会时间: "& web_time(PostsData(9,tempCnt), Site_Time_Format, "short") &"<br>")
if PostsData(15,tempCnt) <> "" then
response.write("Location: "& PostsData(15,tempCnt) &"<br>")
end if
if Site_Allow_PostCount = 1 then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -