<%@ LANGUAGE = "VBScript" %> <% Option Explicit %> <% Response.Buffer = True %> <% Response.Expires = -1 %> <% Response.CacheControl = "Public" %> <% '**************************************************************************************** '** Copyright Notice '** '** iPortalX.com '** '** Copyright 2001-2003 Drew Gauderman All Rights Reserved. '** '** This program is a paid software; you can modify (at your own risk) any part of it '** under the terms of the License that accompanies this software and use it both '** privately and commercially. '** '** All copyright notices must remain in tacked in the scripts and the '** outputted HTML. '** '** You may NOT use parts of this program in your own private work, and you may NOT '** redistribute, repackage, or sell the whole or any part of this program even '** if it is modified or reverse engineered in whole or in part without express '** permission from the author. '** '** You may not pass the whole or any part of this application off as your own work. '** '** All links to iPortalX.com and powered by logo's (if any) must remain unchanged and in place '** and must remain visible when the pages are viewed unless permission is first granted '** by the copyright holder. '** '** This program is distributed in the hope that it will be useful, '** but WITHOUT ANY WARRANTY; without even the implied warranty of '** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER '** WARRANTIES WHETHER EXPRESSED OR IMPLIED. '** '** Support is for those that have purchased it. Post support questions at: - '** http://www.iportalx.com/forum '** '** Support questions are NOT answered by e-mail ever! '** '** For correspondence or non support questions contact: - '** support@iportalx.com '** '**************************************************************************************** If bannedIP() Then 'If the user is using a banned IP then set the banned IP variable to true and active member variable to false blnBannedIP = True blnActiveMember = False End If 'Function to build SQL query's for seach all or any words Function BuildSQL(strTable, sarySearchWords) Dim intSQLLoopCounter intSQLLoopCounter = 0 BuildSQL = BuildSQL & strTable & " LIKE '%" & sarySearchWords(0) & "%'" For intSQLLoopCounter = 1 To UBound(sarySearchWords) If Request.QueryString("SM") = "1" Then BuildSQL = BuildSQL & " AND " Else BuildSQL = BuildSQL & " OR " End If BuildSQL = BuildSQL & strTable & " LIKE '%" & sarySearchWords(intSQLLoopCounter) & "%'" Next End Function Dim intTotalNumNewsEntries Dim intTotalNumNewsPages Dim intLinkPageNum Dim strEntryShort Dim strEntryOrder Dim strSearchKeywords Dim intSearchBy Dim sarySearchWords Dim intRecordPositionPageNum intTypeID = Clng(Request.QueryString("TYP")) strEntryShort = Clng(Request.QueryString("SRT")) strEntryOrder = Clng(Request.QueryString("ORD")) strSearchKeywords = Trim(Mid(Request.QueryString("KW"), 1, 35)) strSearchKeywords = removeAllTags(strSearchKeywords) strSearchKeywords = Server.HTMLEncode(strSearchKeywords) intSearchBy = Clng(Request.QueryString("STYP")) sarySearchWords = Split(Trim(strSearchKeywords), " ") If Request.QueryString("PN") = "" Then intRecordPositionPageNum = 1 Else intRecordPositionPageNum = CInt(Request.QueryString("PN")) End If Call DirectoryDetials(intTypeID) If blnGuest AND blnMustBeLoggedIn Then adoCon.Close Set adoCon = Nothing Set rsCommon = Nothing Response.Redirect("forum/insufficient_permission.asp?Redirect=" & RedirectOmitPath("Redirect", True)) End If %> <% = strWebSiteName %> - <% = strTxtSearchResults %> <% If strSearchKeywords = "" Then Response.Write(vbCrLf & "") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & "
" & strWebsiteName & " : " & strTxtSearchResults & "
") Response.Write(vbCrLf & "
") Call FormatTableTitleTop("Search Form", "450", 1) Response.Write(vbCrLf & "
") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " Search For:
Enter the keywords you want to search by.") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " Search By:
What fields to search by.") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " Search In:
The directory to do your search.") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & "
") Call FormatBottomTable("100%") Else Response.Write(vbCrLf & "") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & "
" & strWebsiteName & " : " & strTypeName & " : " & strTxtSearchResults & "
") Response.Write(vbCrLf & "
") Call FormatTopTable2("100%") Response.Write(vbCrLf & "
") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " " & strTxtSearch & ": ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & "
") Call FormatBottomTable("100%") Select Case strEntryShort Case 0 strEntryShort = "" & strDbTable & "Entry.Name" Case 1 strEntryShort = "" & strDbTable & "Entry.Rating" Case 2 strEntryShort = "" & strDbTable & "Entry.Total_visits" Case 3 strEntryShort = "" & strDbTable & "Entry.Created_date" Case Else strEntryShort = "" & strDbTable & "Entry.Description" End Select Select Case strEntryOrder Case 0 strEntryOrder = "ASC" Case 1 strEntryOrder = "DESC" Case Else strEntryOrder = "ASC" End Select Dim rsLinks If Clng(intSiteEntriesPerPage) = 0 Then intSiteEntriesPerPage = 5 Set rsLinks = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT " & strDbTable & "Entry.*, " & strDbTable & "Author.Username FROM " & strDbTable & "Entry " & _ "INNER JOIN " & strDbTable & "Author ON " & strDbTable & "Entry.Author_ID = " & strDbTable & "Author.Author_ID " If intSearchBy = 1 Then strSQL = strSQL & "WHERE (" & BuildSQL("" & strDbTable & "Entry.Name", Split(Trim(formatInput(strSearchKeywords)), " ")) & ") " ElseIf intSearchBy = 2 Then strSQL = strSQL & "WHERE (" & BuildSQL("" & strDbTable & "Entry.Short_description", sarySearchWords)& " OR " & BuildSQL("" & strDbTable & "Entry.Description", sarySearchWords) & ")" Else strSQL = strSQL & "WHERE (" & BuildSQL("" & strDbTable & "Entry.Name", Split(Trim(formatInput(strSearchKeywords)), " ")) & " OR " & BuildSQL("" & strDbTable & "Entry.Short_description", sarySearchWords)& " OR " & BuildSQL("" & strDbTable & "Entry.Description", sarySearchWords) & ")" End If strSQL = strSQL & "AND Type_ID = " & intTypeID & " ORDER BY " & strEntryShort & " " & strEntryOrder & ";" rsLinks.CursorType = 3 rsLinks.Open strSQL, adoCon rsLinks.PageSize = intSiteEntriesPerPage If rsLinks.EOF Then %>
<% = strTxtSorryNoMatchesFoundForYourSearch %>

<% Else rsLinks.AbsolutePage = intRecordPositionPageNum intTotalNumNewsEntries = rsLinks.RecordCount intTotalNumNewsPages = rsLinks.PageCount For intRecordLoopCounter = 1 to intSiteEntriesPerPage If rsLinks.EOF Then Exit For Call FormatEntryFields() Dim intHighlightLoopCounter For intHighlightLoopCounter = 0 To UBound(sarySearchWords) strEntryName = Replace(strEntryName, sarySearchWords(intHighlightLoopCounter), "" & sarySearchWords(intHighlightLoopCounter) & "", 1, -1, 1) strEntryDescription = Replace(strEntryDescription, sarySearchWords(intHighlightLoopCounter), "" & sarySearchWords(intHighlightLoopCounter) & "", 1, -1, 1) Next 'Get the display of links from the format_entry.asp file Call FormatEntryDisplay(intEntryID, intEntryAuthorID, strEntryName, strEntryAuthor, strEntryDescription, intEntryNoOfRatings, intEntryRating, strEntryCreatedDate, intEntryTotalVisits, intEntryStatus, intTypeID, blnVisitEntry, intEntryTotalReviews) rsLinks.Movenext Next End If Response.Write(vbCrLf & "") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & "
") If intRecordPositionPageNum > 1 or NOT rsLinks.EOF Then Response.Write vbCrLf & "
" & strTxtPage & "  " If intRecordPositionPageNum > 1 Then Response.Write vbCrLf & "<< " & strTxtPrevious & " " If intRecordPositionPageNum > 1 or NOT rsLinks.EOF Then For intLinkPageNum = 1 to intTotalNumNewsPages If intLinkPageNum = intRecordPositionPageNum Then Response.Write vbCrLf & intLinkPageNum Else Response.Write vbCrLf & " " & intLinkPageNum & " " End If Next End If If NOT rsLinks.EOF then Response.Write vbCrLf & " " & strTxtNext & " >>

" ElseIf intRecordPositionPageNum > 1 AND rsLinks.EOF Then Response.Write("

") End If Response.Write(vbCrLf & "Start new Search") If NOT rsLinks.EOF then Response.Write("

") ElseIf intRecordPositionPageNum > 1 AND rsLinks.EOF Then Response.Write("

") End If Response.Write(vbCrLf & "
") rsLinks.Close Set rsLinks = Nothing End If %> <% Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing %>