📄 forum_topics.asp
字号:
'Active Topics Links
strStatusBarTools = strStatusBarTools & " <img src=""" & strImagePath & "active_topics." & strForumImageType & """ alt=""" & strTxtActiveTopics & """ title=""" & strTxtActiveTopics & """ style=""vertical-align: text-bottom"" /> <a href=""active_topics.asp" & strQsSID1 & """>" & strTxtActiveTopics & "</a>"
'If RSS XML enabled then display an RSS button to link to XML file
If blnRSS Then strStatusBarTools = strStatusBarTools & " <a href=""RSS_topic_feed.asp?FID=" & intForumID & strQsSID2 & """ target=""_blank""><img src=""" & strImagePath & "rss." & strForumImageType & """ alt=""" & strTxtRSS & ": " & strForumName & """ title=""" & strTxtRSS & ": " & strForumName & """ /></a>"
%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->
<title><% = strMainForumName %>: <% = strForumName %></title>
<meta name="generator" content="Web Wiz Forums" />
<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write("<!--//" & _
vbCrLf & "/* *******************************************************" & _
vbCrLf & "Software: Web Wiz Forums(TM) ver. " & strVersion & "" & _
vbCrLf & "Info: http://www.webwizforums.com" & _
vbCrLf & "Copyright: (C)2001-2008 Web Wiz(TM). All rights reserved" & _
vbCrLf & "******************************************************* */" & _
vbCrLf & "//-->")
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
'If RSS feed is enabled then have an alt link to it for browers that support RSS Feeds
If blnRSS Then Response.Write(vbCrLf & "<link rel=""alternate"" type=""application/rss+xml"" title=""RSS 2.0"" href=""RSS_topic_feed.asp?FID=" & intForumID & strQsSID2 & """ />")
%>
<script language="JavaScript" type="text/javascript">
function ShowTopics(Show){
strShow = escape(Show.options[Show.selectedIndex].value);
if (Show != '') self.location.href = 'forum_topics.asp?FID=<% = intForumID %>&TS=' + strShow + '<% = strQsSID2 %>';
return true;
}
</script>
<link href="<% = strCSSfile %>default_style.css" rel="stylesheet" type="text/css" />
<!-- #include file="includes/header.asp" -->
<!-- #include file="includes/status_bar_header_inc.asp" -->
<table class="basicTable" cellspacing="0" cellpadding="3" align="center">
<tr>
<td align="left"><h1><%
'If the forum is locked show a locked pad lock icon
If blnForumLocked = True Then Response.Write ("<img src=""" & strImagePath & "forum_lock." & strForumImageType & """ alt=""" & strTxtForumLocked & """ title=""" & strTxtForumLocked & """ style=""vertical-align: text-bottom"" />")
'Display the forum name
Response.Write(strForumName)
%></h1></td>
</tr>
</table><%
'******************************************
'*** Display Sub Forums ***
'******************************************
'If there are sub forums to dsiplay, then display them
If isArray(sarrySubForums) Then
'SQL Query Array Look Up table
'0 = Forum_ID
'1 = Forum_name
'2 = Forum_description
'3 = No_of_topics
'4 = No_of_posts
'5 = Username
'6 = Last_post_author_ID
'7 = Last_post_date
'8 = Password
'9 = Locked
'10 = Hide
'11 = Read
'12 = Last_topic_ID
'13 = Topic.Subject
'First we need to loop through the array to see if the user can view any of the sub forums if not don't display them
'If we find a sub forum that the user can view we exit this loop to display the sub forum
Do While intSubCurrentRecord <= Ubound(sarrySubForums,2)
'Read in details
blnHideForum = CBool(sarrySubForums(10,intSubCurrentRecord))
blnRead = CBool(sarrySubForums(11,intSubCurrentRecord))
'If this forum is to be shown then leave the loop and display the sub forums
If blnHideForum = False OR blnRead Then Exit Do
'Move to next record
intSubCurrentRecord = intSubCurrentRecord + 1
Loop
'If there are still records left in the array then these are the forums that the user can view so display them
If intSubCurrentRecord <= Ubound(sarrySubForums,2) Then
%>
<br />
<table class="tableBorder" align="center" cellspacing="1" cellpadding="3">
<tr class="tableLedger">
<td width="5%"> </td>
<td width="50%"><% = strTxtSub & " " & strTxtForums %></td>
<td width="10%" align="center"><% = strTxtTopics %></td>
<td width="10%" align="center"><% = strTxtPosts %></td>
<td width="30%"><% = strTxtLastPost %></td>
</tr><%
'Loop through the array and display the forums
Do While intSubCurrentRecord <= Ubound(sarrySubForums,2)
'Initialise variables
lngLastEntryTopicID = 0
'Read in the details for this forum
intSubForumID = CInt(sarrySubForums(0,intSubCurrentRecord))
strForumName = sarrySubForums(1,intSubCurrentRecord)
strForumDiscription = sarrySubForums(2,intSubCurrentRecord)
lngNumberOfTopics = CLng(sarrySubForums(3,intSubCurrentRecord))
lngNumberOfPosts = CLng(sarrySubForums(4,intSubCurrentRecord))
strLastEntryUser = sarrySubForums(5,intSubCurrentRecord)
If isNumeric(sarrySubForums(6,intSubCurrentRecord)) Then lngLastEntryUserID = CLng(sarrySubForums(6,intSubCurrentRecord)) Else lngLastEntryUserID = 0
If isDate(sarrySubForums(7,intSubCurrentRecord)) Then dtmLastEntryDate = CDate(sarrySubForums(7,intSubCurrentRecord)) Else dtmLastEntryDate = CDate("2001-01-01 00:00:00")
If isNull(sarrySubForums(8, intSubCurrentRecord)) Then strForumPassword = "" Else strForumPassword = sarrySubForums(8, intSubCurrentRecord)
blnForumLocked = CBool(sarrySubForums(9,intSubCurrentRecord))
blnHideForum = CBool(sarrySubForums(10,intSubCurrentRecord))
blnRead = CBool(sarrySubForums(11,intSubCurrentRecord))
If isNumeric(sarrySubForums(12,intSubCurrentRecord)) Then lngTopicID = CLng(sarrySubForums(12,intSubCurrentRecord)) Else lngTopicID = 0
strSubject = sarrySubForums(13,intSubCurrentRecord)
'If this forum is to be hidden but the user is allowed access to it set the hidden boolen back to false
If blnHideForum AND blnRead Then blnHideForum = False
'Unread Posts *********
intUnReadPostCount = 0
'If there is a newer post than the last time the unread posts array was initilised run it again
If dtmLastEntryDate > CDate(Session("dtmUnReadPostCheck")) Then Call UnreadPosts()
'Count the number of unread posts in this forum
If isArray(sarryUnReadPosts) AND dtmLastEntryDate > dtmLastVisitDate AND blnRead Then
For intUnReadForumPostsLoop = 0 to UBound(sarryUnReadPosts,2)
'Increament unread post count
If CInt(sarryUnReadPosts(2,intUnReadForumPostsLoop)) = intSubForumID AND sarryUnReadPosts(3,intUnReadForumPostsLoop) = "1" Then intUnReadPostCount = intUnReadPostCount + 1
Next
End If
'If the forum is to be hidden then don't show it
If blnHideForum = False Then
'Get the row number
intForumColourNumber = intForumColourNumber + 1
'Write the HTML of the forum descriptions and hyperlinks to the forums
'Calculate row colour
Response.Write(vbCrLf & " <tr ")
If (intForumColourNumber MOD 2 = 0 ) Then Response.Write("class=""evenTableRow"">") Else Response.Write("class=""oddTableRow"">")
'Display the status forum icons
Response.Write(vbCrLf & " <td align=""center"">")
%><!-- #include file="includes/forum_status_icons_inc.asp" --><%
Response.Write("</td>" & _
vbCrLf & " <td>")
'Display forum
Response.Write("<a href=""forum_topics.asp?FID=" & intSubForumID & strQsSID2 & """>" & strForumName & "</a>")
'Display the number of people viewing in that forum
If blnForumViewing AND blnActiveUsers Then
If viewingForum(intSubForumID) > 0 Then Response.Write(" <span class=""smText"">(" & viewingForum(intSubForumID) & " " & strTxtViewing & ")</span>")
End If
'Display forum details
Response.Write("<br />" & strForumDiscription & "</td>" & _
vbCrLf & " <td align=""center"">" & lngNumberOfTopics & "</td>" & _
vbCrLf & " <td align=""center"">" & lngNumberOfPosts & "</td>" & _
vbCrLf & " <td class=""smText"" nowrap=""nowrap"">")
If lngNumberOfPosts <> 0 Then 'Don't disply last post details if there are none
'Don't dispaly details if the user has no read access on the forum
If blnRead AND strForumPassword = "" Then
Response.Write(strTxtBy & " <a href=""member_profile.asp?PF=" & lngLastEntryUserID & strQsSID2 & """ class=""smLink"" rel=""nofollow"">" & strLastEntryUser & "</a> ")
'If there are unread posts in the forum display differnt icon
If intUnReadPostCount > 0 Then
Response.Write("<a href=""get_last_post.asp?TID=" & lngTopicID & strQsSID2 & """><img src=""" & strImagePath & "view_unread_post." & strForumImageType & """ alt=""" & strTxtViewUnreadPost & " [" & intUnReadPostCount & " " & strTxtNewPosts & "]"" title=""" & strTxtViewUnreadPost & " [" & intUnReadPostCount & " " & strTxtNewPosts & "]"" /></a>")
'Else there are no unread posts so display a normal last post link
Else
Response.Write("<a href=""get_last_post.asp?TID=" & lngTopicID & strQsSID2 & """><img src=""" & strImagePath & "view_last_post." & strForumImageType & """ alt=""" & strTxtViewLastPost & """ title=""" & strTxtViewLastPost & """ /></a>")
End If
Response.Write("<br />" & strTxtIn & " <a href=""forum_posts.asp?TID=" & lngTopicID & strQsSID2 & """ title=""" & strSubject & """ class=""smLink"">" & TrimString(strSubject, 25) & "</a><br />")
End If
Response.Write(DateFormat(dtmLastEntryDate) & " " & strTxtAt & " " & TimeFormat(dtmLastEntryDate))
End If
Response.Write("</td>" & _
vbCrLf & " </tr>")
End If
'Move to the next database record
intSubCurrentRecord = intSubCurrentRecord + 1
'If there are more records in the array to display then run some test to see what record to display next and where
If intSubCurrentRecord <= Ubound(sarrySubForums,2) Then
'Becuase the member may have an individual permission entry in the permissions table for this forum,
'it maybe listed twice in the array, so we need to make sure we don't display the same forum twice
If intSubForumID = CInt(sarrySubForums(0,intSubCurrentRecord)) Then intSubCurrentRecord = intSubCurrentRecord + 1
'If there are no records left exit loop
If intSubCurrentRecord > Ubound(sarrySubForums,2) Then Exit Do
End If
'Loop back round for next forum
Loop
%>
</table>
<br /><%
End If
End If
'******************************************
'*** Display Topics ***
'******************************************
%>
<table class="basicTable" cellspacing="1" cellpadding="3" align="center">
<tr>
<td width="<% If blnPollCreate Then Response.Write("205") Else Response.Write("100") %>">
<a href="new_topic_form.asp?FID=<% = intForumID & strQsSID2 %>" title="<% = strTxtCreateNewTopic %>" class="largeButton" rel="nofollow"> <% = strTxtNewTopic %> <img src="<% = strImagePath %>new_topic.<% = strForumImageType %>" alt="<% = strTxtCreateNewTopic %>" /></a><%
'If the user can create a poll disply a create poll link
If blnPollCreate Then Response.Write ("<a href=""new_poll_form.asp?FID=" & intForumID & strQsSID2 & """ title=""" & strTxtCreateNewPoll & """ class=""largeButton"" rel=""nofollow""> " & strTxtNewPoll & " <img src=""" & strImagePath & "new_poll." & strForumImageType & """ alt=""" & strTxtCreateNewPoll & """></a>")
%>
</td>
<td><% = strTxtShowTopics %>
<select name="show" id="show" onchange="ShowTopics(this)">
<option value="0"<% If intShowTopicsFrom = 0 Then Response.Write " selected=""selected""" %>><% = strTxtAnyDate %></option>
<option value="1"<% If intShowTopicsFrom = 1 Then Response.Write " selected=""selected""" %>><% = DateFormat(dtmLastVisitDate) & " " & strTxtAt & " " & TimeFormat(dtmLastVisitDate) %></option>
<option value="2"<% If intShowTopicsFrom = 2 Then Response.Write " selected=""selected""" %>><% = strTxtYesterday %></option>
<option value="3"<% If intShowTopicsFrom = 3 Then Response.Write " selected=""selected""" %>><% = strTxtLastTwoDays %></option>
<option value="4"<% If intShowTopicsFrom = 4 Then Response.Write " selected=""selected""" %>><% = strTxtLastWeek %></option>
<option value="5"<% If intShowTopicsFrom = 5 Then Response.Write " selected=""selected""" %>><% = strTxtLastMonth %></option>
<option value="6"<% If intShowTopicsFrom = 6 Then Response.Write " selected=""selected""" %>><% = strTxtLastTwoMonths %></option>
<option value="7"<% If intShowTopicsFrom = 7 Then Response.Write " selected=""selected""" %>><% = strTxtLastSixMonths %></option>
<option value="8"<% If intShowTopicsFrom = 8 Then Response.Write " selected=""selected""" %>><% = strTxtLastYear %></option>
</select>
</td>
<td align="right"><%
'If there is more than one page display links to the others
If intTotalRecordsPages > 1 Then
%><!-- #include file="includes/page_link_inc.asp" --><%
End If
%>
</td>
</tr>
</table>
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<tr class="tableLedger">
<td width="5%"> </td>
<td width="50%"><a href="forum_topics.asp?FID=<% = intForumID %>&SO=T<% = strQsSID2 %>" title="<% = strTxtReverseSortOrder %>"><% = strTxtTopics %></a><% If Request.QueryString("SO") = "T" Then Response.Write(" <a href=""forum_topics.asp?FID=" & intForumID & "&SO=T&OB=" & strSortDirection & strQsSID2 & """><img src=""" & strImagePath & strSortDirection & "." & strForumImageType & """ title=""" & strTxtReverseSortOrder & """ alt=""" & strTxtReverseSortOrder & """ /></a>") %> / <a href="forum_topics.asp?FID=<% = intForumID %>&SO=A<% = strQsSID2 %>" title="<% = strTxtReverseSortOrder %>"><% = strTxtThreadStarter %></a><% If Request.QueryString("SO") = "A" Then Response.Write(" <a href=""forum_topics.asp?FID=" & intForumID & "&SO=A&OB=" & strSortDirection & strQsSID2 & """><img src=""" & strImagePath & strSortDirection & "." & strForumImageType & """ alt=""" & strTxtReverseSortOrder & """ title=""" & strTxtReverseSortOrder & """ /></a>") %></td>
<td width="10%" align="center" nowrap="nowrap"><a href="forum_topics.asp?FID=<% = intForumID %>&SO=R<% = strQsSID2 %>" title="<% = strTxtReverseSortOrder %>"><% = strTxtReplies %></a><% If Request.QueryString("SO") = "R" Then Response.Write(" <a href=""forum_topics.asp?FID=" & intForumID & "&SO=R&OB=" & strSortDirection & strQsSID2 & """><img src=""" & strImagePath & strSortDirection & "." & strForumImageType & """ title=""" & strTxtReverseSortOrder & """ alt=""" & strTxtReverseSortOrder & """ /></a>") %></td>
<td width="10%" align="center" nowrap="nowrap"><a href="forum_topics.asp?FID=<% = intForumID %>&SO=V<% = strQsSID2 %>" title="<% = strTxtReverseSortOrder %>"><% = strTxtViews %></a><% If Request.QueryString("SO") = "V" Then Response.Write(" <a href=""forum_topics.asp?FID=" & intForumID & "&SO=V&OB=" & strSortDirection & strQsSID2 & """><img src=""" & strImagePath & strSortDirection & "." & strForumImageType & """ title=""" & strTxtReverseSortOrder & """ alt=""" & strTxtReverseSortOrder & """ /></a>") %></td>
<td width="30%"><a href="forum_topics.asp?FID=<% = intForumID %><% = strQsSID2 %>" title="<% = strTxtReverseSortOrder %>"><% = strTxtLastPost %></a><% If Request.QueryString("SO") = "" Then Response.Write(" <a href=""forum_topics.asp?FID=" & intForumID & "&OB=" & strSortDirection & strQsSID2 & """><img src=""" & strImagePath & strSortDirection & "." & strForumImageType & """ title=""" & strTxtReverseSortOrder & """ alt=""" & strTxtReverseSortOrder & """ /></a>") %></td>
</tr><%
'If there are no topics to display, show a message saying so
If intTotalRecords <= 0 Then
'If there are no Topic's to display then display the appropriate error message
Response.Write vbCrLf & " <tr class=""tableRow""><td colspan=""6"" align=""center""><br />" & strTxtNoTopicsToDisplay & " " & strShowTopicsFrom & "<br /><br /></td></tr>"
'Else there the are topic's so write the HTML to display the topic names and a discription
Else
'Do....While Loop to loop through the recorset to display the forum topics
Do While intCurrentRecord < intEndPosition
'If there are no topic records left to display then exit loop
If intCurrentRecord >= intTotalRecords Then Exit Do
'SQL Query Array Look Up table
'0 = tblTopic.Topic_ID
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -