📄 search_form.asp
字号:
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="functions/functions_date_time_format.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
'Dimension variables
Dim strReturnPage 'Holds the page to return to
Dim strForumName 'Holds the forum name
Dim intReadPermission 'holds the forums read permisisons
Dim strSearchKeywords 'Holds the keywords to search for
Dim strSearchMode 'Holds the search mode
Dim strSearchUser 'Holds the user to search for
Dim intCurrentRecord 'Holds the recordset array position
Dim sarrySubscribedForums 'Holds the subscribed forums
Dim sarrySubscribedTopics 'Holds the subscribed topics
Dim sarryForumSelect 'Holds the array with all the forums
Dim intSubForumID 'Holds if the forum is a sub forum
Dim intTempRecord 'Temporay record store
Dim blnHideForum 'Holds if the jump forum is hidden or not
Dim strCatName 'Holds the category name
Dim intCatID 'Holds the cat ID
Dim intForumID2 'Holds the read in forum id
Dim lngTopicID 'Holds post id for searching posts
intCurrentRecord = 0
'Read in values passed to this form
intForumID2 = CInt(Request("FID"))
strSearchKeywords = Trim(Mid(Request("KW"), 1, 35))
strSearchUser = Trim(Mid(Request.QueryString("USR"), 1, 25))
strSearchMode = Trim(Mid(Request.QueryString("SM"), 1, 3))
lngTopicID = CLng(Request("TID"))
'DB hit to get forums with cats and permissions, for the forum select drop down
If lngTopicID = 0 Then
'Initlise the sql statement
strSQL = "" & _
"SELECT " & strDbTable & "Category.Cat_ID, " & strDbTable & "Category.Cat_name, " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Sub_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Forum.Hide, " & strDbTable & "Permissions.View_Forum " & _
"FROM " & strDbTable & "Category" & strDBNoLock & ", " & strDbTable & "Forum" & strDBNoLock & ", " & strDbTable & "Permissions" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Category.Cat_ID = " & strDbTable & "Forum.Cat_ID " & _
"AND " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Permissions.Forum_ID " & _
"AND (" & strDbTable & "Permissions.Author_ID = " & lngLoggedInUserID & " OR " & strDbTable & "Permissions.Group_ID = " & intGroupID & ") " & _
"ORDER BY " & strDbTable & "Category.Cat_order, " & strDbTable & "Forum.Forum_Order, " & strDbTable & "Permissions.Author_ID DESC;"
'Query the database
rsCommon.Open strSQL, adoCon
'Place the subscribed topics into an array
If NOT rsCommon.EOF Then
'Read in the row from the db using getrows for better performance
sarryForumSelect = rsCommon.GetRows()
End If
'Clean up
rsCommon.Close
End If
Call closeDatabase()
'If active users is enabled update the active users application array
If blnActiveUsers Then
'Call active users function
saryActiveUsers = activeUsers("", strTxtSearchingForums, "search_form.asp", 0)
End If
'Set bread crumb trail
If lngTopicID <> 0 Then
strBreadCrumbTrail = strBreadCrumbTrail & strNavSpacer & strTxtTopic & " " & strTxtSearch
Else
strBreadCrumbTrail = strBreadCrumbTrail & strNavSpacer & strTxtSearchTheForum
End If
%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->
<meta name="generator" content="Web Wiz Forums" />
<title><% If lngTopicID <> 0 Then Response.Write(strTxtTopic & " " & strTxtSearch) Else Response.Write(strTxtSearchTheForum) %></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 & "//-->" & vbCrLf & vbCrLf)
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>
<script language="JavaScript">
//Function to check form is filled in correctly before submitting
function CheckForm () {
var formArea = document.getElementById('frmSearch');
//Check for a somthing to search for
if ((formArea.KW.value=="") && (formArea.USR.value=="")){
msg = "<% = strTxtErrorDisplayLine %>\n\n";
msg += "<% = strTxtErrorDisplayLine1 %>\n";
msg += "<% = strTxtErrorDisplayLine2 %>\n";
msg += "<% = strTxtErrorDisplayLine %>\n\n";
msg += "<% = strTxtErrorDisplayLine3 %>\n";
alert(msg + "\n\t<% = strTxtSearchFormError %>\n\n");
formArea.KW.focus();
return false;
}
//Disable submit button
document.getElementById('Submit').disabled=true;
//Show progress bar
var progressWin = document.getElementById('progressBar');
var progressArea = document.getElementById('progressFormArea');
progressWin.style.left = progressArea.offsetLeft + (progressArea.offsetWidth-210)/2 + 'px';
progressWin.style.top = progressArea.offsetTop + (progressArea.offsetHeight-140)/2 + 'px';
progressWin.style.display='inline'
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" -->
<iframe width="200" height="110" id="progressBar" src="includes/progress_bar.asp" style="display:none; position:absolute; left:0px; top:0px;" frameborder="0" scrolling="no"></iframe>
<table class="basicTable" cellspacing="0" cellpadding="3" align="center">
<tr>
<td align="left"><h1><% If lngTopicID <> 0 Then Response.Write(strTxtTopic & " " & strTxtSearch) Else Response.Write(strTxtSearchTheForum) %></h1></td>
</tr>
</table>
<br />
<div id="progressFormArea">
<form method="post" name="frmSearch" id="frmSearch" action="search_process.asp<% = strQsSID1 %>" onSubmit="return CheckForm();" onReset="return confirm('<% = strResetFormConfirm %>');">
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<tr class="tableLedger">
<td colspan="2" align="left"><% = strTxtSearchKeywords %></td>
</tr>
<tr class="tableRow">
<td align="left" width="50%"><% = strTxtSearchbyKeyWord %>
<br />
<input name="KW" id="KW" type="text" value="<% = Server.HTMLEncode(strSearchKeywords) %>" size="25" maxlength="35" tabindex="1" />
<select name="searchType" id="searchType" tabindex="2">
<option value="allWords" "selected"><% = strTxtMatch & " " & strTxtAllWords %></option>
<option value="anyWords"><% = strTxtMatch & " " & strTxtAnyWords %></option>
<option value="phrase"><% = strTxtMatch & " " & strTxtPhrase %></option>
</select><%
'Include the follwoing if doing a topic search
If lngTopicID <> 0 Then
%>
<input name="TID" type="hidden" id="TID" value="<% = lngTopicID %>" />
<input name="qTopic" type="hidden" id="qTopic" value="1" /><%
End If
%>
</td>
<td height="2" width="50%" valign="top"><% = strTxtSearchbyUserName %><br />
<input name="USR" id="USR" type="text" value="<% = Server.HTMLEncode(strSearchUser) %>" maxlength="20" tabindex="3" />
<a href="javascript:winOpener('pop_up_member_search.asp?RP=SEARCH','memSearch',0,1,440,255)"><img src="<% = strImagePath %>member_search.png" alt="<% = strTxtMemberSearch %>" title="<% = strTxtMemberSearch %>" border="0" align="absbottom"></a> <input name="UsrMatch" type="checkbox" value="true" tabindex="4"> <% = strTxtExactMatch %></td>
</tr><%
'If seraching a topic don't include the other options
If lngTopicID = 0 Then
%>
<tr class="tableLedger">
<td colspan="2" align="left"><% = strTxtSearchOptions %></td>
</tr>
<tr class="tableRow">
<td align="left" width="50%"><% = strTxtSearchForum %>
<br /><span class="smText"><% = strTxtCtrlApple %></span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -