📄 search_results_posts.asp
字号:
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="functions/functions_date_time_format.asp" -->
<!--#include file="functions/functions_format_post.asp" -->
<%
'****************************************************************************************
'** Copyright Notice
'**
'** Web Wiz Forums(TM)
'** http://www.webwizforums.com
'**
'** Copyright (C)2001-2008 Web Wiz(TM). All Rights Reserved.
'**
'** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'.
'**
'** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE
'** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE
'** AND DERIVATIVE WORKS IMMEDIATELY.
'**
'** If you have not received a copy of the license with this work then a copy of the latest
'** license contract can be found at:-
'**
'** http://www.webwizguide.com/license
'**
'** For more information about this software and for licensing information please contact
'** 'Web Wiz' at the address and website below:-
'**
'** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England
'** http://www.webwizguide.com
'**
'** Removal or modification of this copyright notice will violate the license contract.
'**
'****************************************************************************************
'*************************** SOFTWARE AND CODE MODIFICATIONS ****************************
'**
'** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE
'** AGREEMENT AND IS STRICTLY PROHIBITED
'**
'** If you wish to modify any part of this software a license must be purchased
'**
'****************************************************************************************
'Set the response buffer to true as we maybe redirecting
Response.Buffer = True
'Make sure this page is not cached
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"
'Dimension variables
Dim strForumName 'Holds the forum name
Dim lngNumberOfReplies 'Holds the number of replies for a topic
Dim lngTopicID 'Holds the topic ID
Dim strSubject 'Holds the topic subject
Dim strTopicIcon 'Holds the topic icon
Dim strPostAuthor 'Holds the username of the user who started the topic
Dim lngPostAuthorID 'Holds the users Id number for the user who started the topic
Dim lngNumberOfViews 'Holds the number of views a topic has had
Dim lngPostID 'Holds the message ID of the last entry
Dim strLastEntryUsername 'Holds the username of the last person to post a message in a topic
Dim lngLastEntryUserID 'Holds the user's ID number of the last person to post a meassge in a topic
Dim dtmLastEntryDate 'Holds the date the last person made a post in the topic
Dim intRecordPositionPageNum 'Holds the recorset page number to show the topics for
Dim intRecordLoopCounter 'Holds the loop counter numeber
Dim intTopicPageLoopCounter 'Holds the number of pages there are in the forum
Dim intLinkPageNum 'Holss the page number to link to
Dim intShowTopicsFrom 'Holds when to show the topics from
Dim strShowTopicsFrom 'Holds the display text from when the topics are shown from
Dim blnForumLocked 'Set to true if the forum is locked
Dim blnTopicLocked 'set to true if the topic is locked
Dim intPriority 'Holds the priority level of the topic
Dim intNumberOfTopicPages 'Holds the number of topic pages
Dim intTopicPagesLoopCounter 'Holds the number of loops
Dim blnHideTopic 'Holds if the topic is hidden
Dim strMessage 'Holds the first posted message in the topic
Dim intForumReadRights 'Holds the read rights of the forum
Dim strForumPassword 'Holds the password for the forum
Dim strForumPaswordCode 'Holds the code for the password for the forum
Dim lngPollID 'Holds the topic poll id number
Dim dtmPostDate 'Holds the date of the first message
Dim strPostTableRowClass 'Holds the row colour for the table
Dim sarryTopics 'Holds the topics to display
Dim intTotalRecords 'Holds the number of records in the topics array
Dim intTotalRecordsPages 'Holds the total number of pages
Dim intStartPosition 'Holds the start poition for records to be shown
Dim intEndPosition 'Holds the end poition for records to be shown
Dim intCurrentRecord 'Holds the current record position
Dim strSearchKeywords 'Holds the search keywods for highlighting
Dim strSearchID 'Holds the search ID
Dim sarySearchWord 'Holds the search words
Dim sarySearchIndex 'Holds the details of the search array
Dim strSearchMemID 'Holds the ID of the memebr who ran the search
Dim dtmSearchDateCreated 'Holds the date the search was created
Dim dblSearchProcessTime 'Holds the time taken to process the search
Dim intPageLinkLoopCounter 'Holds the loop counter for mutiple page links
Dim dtmEventDate 'Holds the date if this is a calendar event
Dim dtmEventDateEnd 'Holds the date if this is a calendar event
Dim strPostTableSideClass 'Holds the post message side column css class
Dim intUnReadPostCount 'Holds the count for the number of unread posts in the forum
Dim intUnReadForumPostsLoop 'Loop to count the number of unread posts in a forum
Dim intMovedForumID
'If this is the first time the page is displayed then the Forum Topic record position is set to page 1
If isNumeric(Request.QueryString("PN")) = false Then
intRecordPositionPageNum = 1
ElseIf Request.QueryString("PN") < 1 Then
intRecordPositionPageNum = 1
'Else the page has been displayed before so the Forum Topic record postion is set to the Record Position number
Else
intRecordPositionPageNum = CInt(Request.QueryString("PN"))
End If
'If we have not yet checked for unread posts since last visit run it now
If Session("dtmUnReadPostCheck") = "" Then
Call UnreadPosts()
'Read in array if at application level
ElseIf isArray(Application("sarryUnReadPosts" & strSessionID)) Then
sarryUnReadPosts = Application("sarryUnReadPosts" & strSessionID)
'Read in the unread posts array
ElseIf isArray(Session("sarryUnReadPosts")) Then
sarryUnReadPosts = Session("sarryUnReadPosts")
End If
'Read in the querystrings
strSearchID = Request.QueryString("SearchID")
strSearchKeywords = Request.QueryString("KW")
'Split up the keywords to be searched
sarySearchWord = Split(Trim(strSearchKeywords), " ")
'Read in the search index array to see if user has permission to view this search and update the time to live date
'Place the application level search results array into a temporary dynaimic array
sarySearchIndex = Application(strAppPrefix & "sarySearchIndex")
'Array dimension lookup table
' 0 = Search ID
' 1 = IP
' 2 = Date/time last run
' 3 = Member ID
' 4 = Date/time search created
' 5 = time taken to run search
'Iterate through the array to find the index data for this search
If isArray(sarySearchIndex) Then
For intCurrentRecord = 0 To UBound(sarySearchIndex, 2)
'Find the array data for this search
If sarySearchIndex(0, intCurrentRecord) = strSearchID Then
'Read the the data we are using from the index
strSearchMemID = CLng(sarySearchIndex(3, intCurrentRecord))
dtmSearchDateCreated = CDate(sarySearchIndex(4, intCurrentRecord))
dblSearchProcessTime = CDbl(sarySearchIndex(5, intCurrentRecord))
'Exit loop as we have the data we need
Exit For
End If
Next
End If
''If the user is the person who created the search they have permission to view it
'Read in the search array and update the time to live
If strSearchMemID = lngLoggedInUserID Then
'Read in the search array
sarryTopics = Application(strSearchID)
'Update the time to live
sarySearchIndex(2, intCurrentRecord) = internationalDateTime(Now())
'Update search index application array
'Lock the application so that no other user can try and update the application level variable at the same time
Application.Lock
'Update the application level variables
Application(strAppPrefix & "sarySearchIndex") = sarySearchIndex
'Unlock the application
Application.UnLock
End If
'Reset current record variable
intCurrentRecord = 0
'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.No_of_replies
'10 = tblTopic.No_of_views
'11 = tblTopic.Locked
'12 = tblTopic.Priority
'13 = tblTopic.Hide
'14 = tblThread.Thread_ID
'15 = tblThread.Message_date
'16 = tblThread.Message
'17 = tblThread.Author_ID
'18 = tblAuthor.Username
'19 = tblTopic.Event_date
'20 = tblTopic.Event_date_end
'Read in some details of the topics
If isArray(sarryTopics) Then
'Count the number of records
intTotalRecords = Ubound(sarryTopics,2) + 1
'Count the number of pages for the topics using '\' so that any fraction is omitted
intTotalRecordsPages = intTotalRecords \ intThreadsPerPage
'If there is a remainder or the result is 0 then add 1 to the total num of pages
If intTotalRecords Mod intThreadsPerPage > 0 OR intTotalRecordsPages = 0 Then intTotalRecordsPages = intTotalRecordsPages + 1
'Start position
intStartPosition = ((intRecordPositionPageNum - 1) * intThreadsPerPage)
'End Position
intEndPosition = intStartPosition + intThreadsPerPage
'Get the start position
intCurrentRecord = intStartPosition
End If
'Page to link to for mutiple page (with querystrings if required)
strLinkPage = "search_results_posts.asp?SearchID=" & Server.URLEncode(strSearchID) & "&KW=" & Server.URLEncode(strSearchKeywords) & "&"
'If active users is enabled update the active users application array
If blnActiveUsers Then
'Call active users function
saryActiveUsers = activeUsers(strTxtSearchingForums, strTxtSearchingFor & ": ‘" & Server.HTMLEncode(strSearchKeywords) & "’", "search_form.asp?KW=" & Server.URLEncode(strSearchKeywords), 0)
End If
'Set bread crumb trail
strBreadCrumbTrail = strBreadCrumbTrail & strNavSpacer & "<a href=""search_results_posts.asp?SearchID=" & Server.URLEncode(strSearchID) & "&KW=" & Server.URLEncode(strSearchKeywords) & strQsSID2 & """>" & strTxtSearchResults & "</a>"
%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->
<meta name="generator" content="Web Wiz Forums" />
<title><% = strMainForumName & ": " & strTxtSearchResults & ": " & Server.HTMLEncode(strSearchKeywords) %></title>
<%
'***** 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 ******
%>
<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><% = strTxtSearchResults %></h1>
<br /><%
'Display some text on search
If intTotalRecords > 0 Then
Response.Write(strTxtSearchResults & " ")
'If this is a keyword search display keywrds
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -