📄 search_results_topics.asp
字号:
'If there are no search results display an error msg
If intTotalRecords <= 0 Then
'If there are no search results to display then display the appropriate error message
Response.Write vbCrLf & " <tr class=""tableRow""><td colspan=""6"" align=""center""><br />" & strTxtSearhExpiredOrNoPermission & " <a href=""search_form.asp?KW=" & Server.URLEncode(strSearchKeywords) & strQsSID2 & """>" & strTxtCreateNewSearch & "</a><br /><br /></td></tr>"
'Disply any search results in the forum
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 = tblForum.Forum_ID
'1 = tblForum.Forum_name
'2 = tblForum.Password
'3 = tblForum.Forum_code
'4 = tblTopic.Topic_ID
'5 = tblTopic.Poll_ID
'6 = tblTopic.Moved_ID
'7 = tblTopic.Subject
'8 = tblTopic.Icon
'9 = tblTopic.Start_Thread_ID
'10 = tblTopic.Last_Thread_ID
'11 = tblTopic.No_of_replies
'12 = tblTopic.No_of_views
'13 = tblTopic.Locked
'14 = tblTopic.Priority
'15 = tblTopic.Hide
'16 = tblThread.Message_date
'17 = tblThread.Message,
'18 = tblThread.Author_ID,
'19 = tblAuthor.Username,
'20 = LastThread.Message_date,
'21 = LastThread.Author_ID,
'22 = LastAuthor.Username
'23 = tblTopic.Event_date
'24 = tblTopic.Event_date_end
'Read in Topic details from the database
intForumID = CInt(sarryTopics(0,intCurrentRecord))
strForumPassword = sarryTopics(2,intCurrentRecord)
strForumPaswordCode = sarryTopics(3,intCurrentRecord)
'Read in Topic details from the database
lngTopicID = CLng(sarryTopics(4,intCurrentRecord))
lngPollID = CLng(sarryTopics(5,intCurrentRecord))
strSubject = sarryTopics(7,intCurrentRecord)
strTopicIcon = sarryTopics(8,intCurrentRecord)
lngNumberOfReplies = CLng(sarryTopics(11,intCurrentRecord))
lngNumberOfViews = CLng(sarryTopics(12,intCurrentRecord))
blnTopicLocked = CBool(sarryTopics(13,intCurrentRecord))
intPriority = CInt(sarryTopics(14,intCurrentRecord))
blnHideTopic = CBool(sarryTopics(15,intCurrentRecord))
dtmEventDate = sarryTopics(23,intCurrentRecord)
dtmEventDateEnd = sarryTopics(24,intCurrentRecord)
'Read in the first post details
dtmFirstEntryDate = CDate(sarryTopics(16,intCurrentRecord))
strFirstPostMsg = Mid(sarryTopics(17,intCurrentRecord), 1, 275)
lngTopicStartUserID = CLng(sarryTopics(18,intCurrentRecord))
strTopicStartUsername = sarryTopics(19,intCurrentRecord)
'Read in the last post details
lngLastEntryMessageID = CLng(sarryTopics(10,intCurrentRecord))
dtmLastEntryDate = CDate(sarryTopics(20,intCurrentRecord))
lngLastEntryUserID = CLng(sarryTopics(21,intCurrentRecord))
strLastEntryUsername = sarryTopics(22,intCurrentRecord)
'Highlight the search words
strSubject = searchHighlighter(strSubject, sarySearchWord)
'Clean up input to prevent XXS hack
strSubject = formatInput(strSubject)
'If forum is passworded and not logged into forum display that password is required
If strForumPassword <> "" and getCookie("fID", "Forum" & intForumID) <> strForumPaswordCode Then
strFirstPostMsg = strTxtPasswordRequiredViewPost
strSubject = strTxtPasswordRequiredViewPost
strTopicStartUsername = strTxtNotGiven
lngTopicStartUserID = 2
strLastEntryUsername = strTxtNotGiven
lngLastEntryUserID = 2
End If
'If the forum name is different to the one from the last forum display the forum name
If sarryTopics(1,intCurrentRecord) <> strForumName Then
'Give the forum name the new forum name
strForumName = sarryTopics(1,intCurrentRecord)
'Display the new forum name
Response.Write vbCrLf & " <tr class=""tableSubLedger""><td colspan=""7""><a href=""forum_topics.asp?FID=" & intForumID & strQsSID2 & """>" & strForumName & "</a></td></tr>"
End If
'Remove HTML from message for subject link title
strFirstPostMsg = removeHTML(strFirstPostMsg, 150, true)
'Clean up input to prevent XXS hack
strFirstPostMsg = formatInput(strFirstPostMsg)
'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 Then
For intUnReadForumPostsLoop = 0 to UBound(sarryUnReadPosts,2)
'Increament unread post count
If CLng(sarryUnReadPosts(1,intUnReadForumPostsLoop)) = lngTopicID AND sarryUnReadPosts(3,intUnReadForumPostsLoop) = "1" Then intUnReadPostCount = intUnReadPostCount + 1
Next
End If
'Calculate the row colour
If intCurrentRecord MOD 2=0 Then strTableRowColour = "evenTableRow" Else strTableRowColour = "oddTableRow"
'If this is a hidden post then change the row colour to highlight it
If blnHideTopic Then strTableRowColour = "hiddenTableRow"
'Write the HTML of the Topic descriptions as hyperlinks to the Topic details and message
Response.Write(vbCrLf & " <tr class=""" & strTableRowColour & """>")
'Display the status topic icons
Response.Write(vbCrLf & " <td align=""center"">")
%><!-- #include file="includes/topic_status_icons_inc.asp" --><%
Response.Write("</td>")
Response.Write(vbCrLf & " <td><div style=""float:left"">")
'If the user is a forum admin or a moderator then give let them delete the topic
If blnAdmin OR blnModerator Then
Response.Write("<span id=""modTools" & lngTopicID & """ onclick=""showDropDown('modTools" & lngTopicID & "', 'modToolsMenu" & lngTopicID & "', 120, 0);"" class=""dropDownPointer""><img src=""" & strImagePath & "moderator_tools." & strForumImageType & """ alt=""" & strTxtModeratorTools & """ title=""" & strTxtModeratorTools & """ /></span> " & _
"<div id=""modToolsMenu" & lngTopicID & """ class=""dropDownMenu"">" & _
"<a href=""javascript:winOpener('pop_up_topic_admin.asp?TID=" & lngTopicID & strQsSID2 & "','admin',1,1,600,285)""><div>" & strTxtTopicAdmin & "</div></a>")
'Lock or un-lock forum if admin
If blnTopicLocked Then
Response.Write("<a href=""lock_topic.asp?mode=UnLock&TID=" & lngTopicID & strQsSID2 & """><div>" & strTxtUnLockTopic & "</div></a>")
Else
Response.Write("<a href=""lock_topic.asp?mode=Lock&TID=" & lngTopicID & strQsSID2 & """><div>" & strTxtLockTopic & "</div></a>")
End If
'Hide or show topic
If blnHideTopic = false Then
Response.Write("<a href=""lock_topic.asp?mode=Hide&TID=" & lngTopicID & strQsSID2 & """><div>" & strTxtHideTopic & "</div></a>")
Else
Response.Write("<a href=""lock_topic.asp?mode=Show&TID=" & lngTopicID & strQsSID2 & """><div>" & strTxtShowTopic & "</div></a>")
End If
Response.Write("<a href=""delete_topic.asp?TID=" & lngTopicID & "&PN=" & intRecordPositionPageNum & strQsSID2 & """ onclick=""return confirm('" & strTxtDeleteTopicAlert & "')""><div>" & strTxtDeleteTopic & "</div></a>")
Response.Write("</div>")
End If
'If topic icons enabled and we have a topic icon display it
If blnTopicIcon AND strTopicIcon <> "" Then Response.Write("<img src=""" & strTopicIcon & """ alt=""" & strTxtMessageIcon & """ title=""" & strTxtMessageIcon & """ /> ")
'Display the subject of the topic
Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID & "&KW=" & Server.URLEncode(strSearchKeywords))
If intPriority = 3 Then Response.Write("&FID=" & intForumID & "&PR=3")
Response.Write("" & strQsSID2 & """ title=""" & strFirstPostMsg & """>" & strSubject & "</a>")
'Display who started the topic and when
Response.Write("<br /><span class=""smText"">" & strTxtBy & " <a href=""member_profile.asp?PF=" & lngTopicStartUserID & strQsSID2 & """ class=""smLink"" rel=""nofollow"">" & strTopicStartUsername & "</a>, " & DateFormat(dtmFirstEntryDate) & " " & strTxtAt & " " & TimeFormat(dtmFirstEntryDate) & "</span>" & _
"</div>")
'Calculate the number of pages for the topic and display links if there are more than 1 page
intNumberOfTopicPages = ((lngNumberOfReplies + 1)\intThreadsPerPage)
'If there is a remainder from calculating the num of pages add 1 to the number of pages
If ((lngNumberOfReplies + 1) Mod intThreadsPerPage) > 0 Then intNumberOfTopicPages = intNumberOfTopicPages + 1
'If there is more than 1 page for the topic display links to the other pages
If intNumberOfTopicPages > 1 Then
Response.Write("<div style=""float:right;""><img src=""" & strImagePath & "multiple_pages." & strForumImageType & """ alt=""" & strTxtMultiplePages & """ title=""" & strTxtMultiplePages & """ />")
'Loop round to display the links to the other pages
For intTopicPagesLoopCounter = 1 To intNumberOfTopicPages
'If there is more than 3 pages display ... last page and exit the loop
If intTopicPagesLoopCounter > 3 Then
'If this is position 4 then display just the 4th page
If intNumberOfTopicPages = 4 Then
Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID & "&KW=" & Server.URLEncode(strSearchKeywords) & "&PN=8")
'If a priority topic need to make sure we don't change forum
If intPriority = 3 Then Response.Write("&FID=" & intForumID & "&PR=3")
Response.Write("" & strQsSID2 & """ class=""smPageLink"" title=""" & strTxtPage & " 4"">4</a>")
'Else display the last 2 pages
Else
Response.Write(" ")
Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID & "&KW=" & Server.URLEncode(strSearchKeywords) & "PN=" & intNumberOfTopicPages - 1)
'If a priority topic need to make sure we don't change forum
If intPriority = 3 Then Response.Write("&FID=" & intForumID & "&PR=3")
Response.Write("" & strQsSID2 & """ class=""smPageLink"" title=""" & strTxtPage & " " & intNumberOfTopicPages - 1 & """>" & intNumberOfTopicPages - 1 & "</a>")
Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID & "&KW=" & Server.URLEncode(strSearchKeywords) & "&PN=" & intNumberOfTopicPages)
'If a priority topic need to make sure we don't change forum
If intPriority = 3 Then Response.Write("&FID=" & intForumID & "&PR=3")
Response.Write("" & strQsSID2 & """ class=""smPageLink"" title=""" & strTxtPage & " " & intNumberOfTopicPages & """>" & intNumberOfTopicPages & "</a>")
End If
'Exit the loop as we are finshed here
Exit For
End If
'Display the links to the other pages
Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID & "&KW=" & Server.URLEncode(strSearchKeywords) & "&PN=" & intTopicPagesLoopCounter)
'If a priority topic need to make sure we don't change forum
If intPriority = 3 Then Response.Write("&FID=" & intForumID & "&PR=3")
Response.Write("" & strQsSID2 & """ class=""smPageLink"" title=""" & strTxtPage & " " & intTopicPagesLoopCounter & """>" & intTopicPagesLoopCounter & "</a>")
Next
Response.Write("</div>")
End If
%></td>
<td align="center"><% = lngNumberOfReplies %></td>
<td align="center"><% = lngNumberOfViews %></td>
<td class="smText" nowrap><% = strTxtBy %> <a href="member_profile.asp?PF=<% = lngLastEntryUserID & strQsSID2 %>" class="smLink" rel="nofollow"><% = strLastEntryUsername %></a><br/> <% = DateFormat(dtmLastEntryDate) & " " & strTxtAt & " " & TimeFormat(dtmLastEntryDate) %> <%
'If there are unread posts display a differnet icon and link to the last unread post
If intUnReadPostCount > 0 Then
Response.Write("<a href=""get_last_post.asp?TID=" & lngTopicID & "&KW=" & Server.URLEncode(strSearchKeywords))
If intPriority = 3 Then Response.Write("&FID=" & intForumID & "&PR=3")
Response.Write("" & 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 topic link
Else
Response.Write("<a href=""get_last_post.asp?TID=" & lngTopicID & "&KW=" & Server.URLEncode(strSearchKeywords))
If intPriority = 3 Then Response.Write("&FID=" & intForumID & "&PR=3")
Response.Write("" & strQsSID2 & """><img src=""" & strImagePath & "view_last_post." & strForumImageType & """ alt=""" & strTxtViewLastPost & """ title=""" & strTxtViewLastPost & """ /></a> ")
End If
%></td>
</tr><%
'Move to the next record
intCurrentRecord = intCurrentRecord + 1
Loop
End If
%>
</table>
<table class="basicTable" cellspacing="0" cellpadding="4" align="center">
<tr>
<td><br /><!-- #include file="includes/forum_jump_inc.asp" --><%
'Release server objects
Call closeDatabase()
%></td>
<td align="right" valign="top" nowrap><!-- #include file="includes/page_link_inc.asp" --></td>
</tr>
</table>
<br />
</div>
<div align="center">
<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
If blnLCode = True Then
If blnTextLinks = True Then
Response.Write("<span class=""text"" style=""font-size:10px"">Bulletin Board Software by <a href=""http://www.webwizforums.com"" target=""_blank"" style=""font-size:10px"">Web Wiz Forums®</a> version " & strVersion & "</span>")
Else
Response.Write("<a href=""http://www.webwizforums.com"" target=""_blank""><img src=""webwizforums_image.asp"" border=""0"" title=""Bulletin Board Software by Web Wiz Forums® version " & strVersion& """ alt=""Bulletin Board Software by Web Wiz Forums® version " & strVersion& """ /></a>")
End If
Response.Write("<br /><span class=""text"" style=""font-size:10px"">Copyright ©2001-2008 <a href=""http://www.webwizguide.com"" target=""_blank"" style=""font-size:10px"">Web Wiz</a></span>")
End If
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
'Display the process time
If blnShowProcessTime Then Response.Write "<span class=""smText""><br /><br />" & strTxtThisPageWasGeneratedIn & " " & FormatNumber(Timer() - dblStartTime, 3) & " " & strTxtSeconds & "</span>"
%>
</div>
<!-- #include file="includes/footer.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -