📄 displayforum.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("F")) = true then
'Retrieve forum and category 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_Group_ID, FC.Category_Title, FC.Category_ID FROM Forum_Forums FF, Forum_Categories FC WHERE FF.Forum_ID = "& int(request.querystring("F")) &" AND FC.Category_ID = FF.Forum_Category_ID;"
rsForums.Open sqlForums, adoConn, CMDText
if rsForums.eof or rsForums.bof then
rsForums.close
set rsForums = nothing
strMessage = "The forum that you have selected does not exist. If you have followed a valid link please contact the board administrator. Click <a href=""default.asp"">here</a> if you are not redirected within 5 seconds."
strRedirectURL = "default.asp"
else
'Set categoy and forum name
strForum = rsForums("Forum_Name")
strCategory = rsForums("Category_Title")
strCategoryID = rsForums("Category_ID")
strGroupID = rsForums("Forum_Group_ID")
rsForums.close
set rsForums = nothing
end if
else
strMessage = "The forum that you have selected does not exist. If you have followed a valid link please contact the board administrator. Click <a href=""default.asp"">here</a> if you are not redirected within 5 seconds."
strRedirectURL = "default.asp"
end if
if strGroupID <> "" and session("admin") <> true then
'Group Checking Code
end if
'Display error message if the user is not a part of this group
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
'Display navigation trail
response.write("<table border='0' cellspacing='0' cellpadding='2' align='center' class='plain'><tr><td valign='top' align='left'><a href='default.asp'>"& Site_Name &"</a> >> <a href='displaycategory.asp?C="& strCategoryID &"'>"& strCategory &"</a>>> "& strForum &"<br>"& Site_Description)
response.write("</td></tr></table><table border='0' cellspacing='1' cellpadding='0' align='center' class='plain'><tr><td align='right'><a href='newtopic.asp?F="& request.querystring("F") &"'><img src='Images/Icons/button_post.gif' border='0' align='absmiddle' alt='>> Post New Topic'></a></td></tr></table>")
response.write("<table width='100%' border='0' cellspacing='1' cellpadding='3' align='center' class='main'><tr align='left' valign='middle' class='title'><td colspan='2' nowrap>话题</td><td align='center' nowrap>作 者</td>")
response.write("<td align='center' nowrap>回复</td><td align='center' nowrap>人气</td><td align='center' nowrap>最后回复</td></tr>")
'grab and display forum announcements
set rsAnnouncements = server.createobject("adodb.recordset")
sqlAnnouncements = "SELECT FT.Topic_ID, FT.Topic_User_ID, FT.Topic_Last_User_ID, FT.Topic_Title, FT.Topic_Views, FT.Topic_Replies, FT.Topic_Type, FT.Topic_Status, FU.User_Name AS UserOne, FU2.User_Name AS UserTwo, FT.Topic_Time FROM (Forum_Topics FT INNER JOIN Forum_Users FU ON FT.Topic_User_ID = FU.User_ID) INNER JOIN Forum_Users FU2 ON FT.Topic_Last_User_ID = FU2.User_ID WHERE (FT.Topic_Type = 3 AND FT.Topic_Time BETWEEN '"& search_date(-28) &"' AND '"& db_time() &"') ORDER BY FT.Topic_Time ASC;"
rsAnnouncements.Open sqlAnnouncements, adoConn, CMDText
if rsAnnouncements.eof or rsAnnouncements.bof then
AnnounceCnt = 0
else
AnnounceCnt = rsAnnouncements.recordCount
AnnounceData = rsAnnouncements.GetRows()
end if
rsAnnouncements.close
set rsAnnouncements = nothing
'Initialise counter
tempCnt = 0
'Loop through and display announcements
do until tempCnt = AnnounceCnt
response.write("<tr align='left' valign='middle' class='body'><td width='20' align='center'><img src='Images/Icons/folder_announcement.gif' align='absmiddle'></td><td width='65%'>Announcement: <a href='displaytopic.asp?T="& AnnounceData(0,tempCnt) &"'>"& AnnounceData(3,tempCnt) &"</a>")
response.write("</td><td align='center' width='15%' nowrap>"& AnnounceData(8,tempCnt) &"</td><td align='center' nowrap>"& AnnounceData(5,tempCnt) &"</td><td align='center' nowrap>"& AnnounceData(4,tempCnt) &"</td><td width='20%' align='right' nowrap>")
response.write(web_time(AnnounceData(10,tempCnt), Site_Time_Format, "long") & "<br>by: "& AnnounceData(9,tempCnt) &" [<a href='displaytopic.asp?T="& AnnounceData(0,tempCnt) &"'>view</a>]</td></tr>")
tempCnt = tempCnt + 1
loop
'Set forum page size
iPagesize = Site_View_Topic
'Set current page
if request.querystring("P") = "" then
iPageCurrent = 1
else
iPageCurrent = int(request.querystring("P"))
end if
'Retrieve all topics from the specified forum.
set rsTopics = server.createobject("adodb.recordset")
rsTopics.PageSize = iPageSize
rsTopics.CacheSize = iPageSize
sqlTopics = "SELECT FT.Topic_ID, FT.Topic_User_ID, FT.Topic_Last_User_ID, FT.Topic_Title, FT.Topic_Views, FT.Topic_Replies, FT.Topic_Type, FT.Topic_Status, FU.User_Name AS UserOne, FU2.User_Name AS UserTwo, FT.Topic_Time FROM (Forum_Topics FT INNER JOIN Forum_Users FU ON FT.Topic_User_ID = FU.User_ID) INNER JOIN Forum_Users FU2 ON FT.Topic_Last_User_ID = FU2.User_ID WHERE ((FT.Topic_Forum_ID = "& int(request.querystring("F")) &" AND FT.Topic_Time BETWEEN '"& search_date(-Site_Topics_Date) &"' AND '"& db_time() &"') OR (FT.Topic_Type = 2 AND FT.Topic_Forum_ID = "& int(request.querystring("F")) &")) AND (FT.Topic_Type <> 0 AND FT.Topic_Type <> 3) ORDER BY Topic_Type DESC, Topic_Time "& Site_Topics_Order &";"
rsTopics.Open sqlTopics, adoConn, CMDText
if not rsTopics.eof then
iPageCount = rsTopics.PageCount
if iPageCurrent > iPageCount then iPageCurrent = iPageCount
if iPageCurrent < 1 then iPageCurrent = 1
rsTopics.AbsolutePage = iPageCurrent
TopicsData = rsTopics.GetRows(iPageSize)
TopicsCnt = UBound(TopicsData, 2) + 1
rsTopics.close
set rsTopics = nothing
else
TopicsCnt = 0
rsTopics.close
set rsTopics = nothing
end if
'If the current forum is empty then do nothing
'Re-Initialise temporary counter
tempCnt = 0
'Display topics from the specified forums
do until tempCnt = TopicsCnt
response.write("<tr align='left' valign='middle' class='body'><td width='20' align='center'>")
'Image Select Code
strReadCookie = request.cookies(site_name)("read")
strReadTopic = "r" & TopicsData(0,tempCnt) & "r"
if (int(session("laston")) >= int(TopicsData(10,tempCnt))) or instr(1, strReadCookie, strReadTopic, 1) <> 0 or session("userid") = "" then
image = "old"
else
image = "new"
end if
'Select the appropriate topic image
select case TopicsData(7,tempCnt)
case "0"
'Topic locked
response.write("<img src='Images/Icons/folder_locked.gif' align='absmiddle' alt='>> Locked'>")
case "1"
'Topic open
select case TopicsData(6,tempCnt)
'Standard topic
case "1"
select case image
case "old"
if TopicsData(5,tempCnt) > 15 then
response.write("<img src='Images/Icons/folder_hotnoreplies.gif' align='absmiddle' alt='>> Hot Topic! No New Replies'>")
else
response.write("<img src='Images/Icons/folder_noreplies.gif' align='absmiddle' alt='>> No New Replies'>")
end if
case "new"
if TopicsData(5,tempCnt) > 15 then
response.write("<img src='Images/Icons/folder_hotreplies.gif' align='absmiddle' alt='>> Hot Topic! New Replies'>")
else
response.write("<img src='Images/Icons/folder_replies.gif' align='absmiddle' alt='>> New Replies'>")
end if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -