chris_angell
09-30-2002, 11:22 AM
hello I found this code, but when I put it into place it is not working, well it search's fine, but there is and option where you can ban certain files and folders from not being searched...
strBarredFiles = "adminstation.htm,no_allowed.asp"
strBarredFolders = "temp,temp1"
but when I publish the code, and search ??? they are still added to the search list, is there an easy reason why this is going wrong, I am stuck ???
here is the code :)
<% Option Explicit %>
<%
'Set the response buffer to true
Response.Buffer = False
'Dimension global variables
Dim fsoObject 'File system object
Dim fldObject 'Folder object
Dim sarySearchWord 'Array to hold the words to be searched for
Dim strSearchWords 'Holds the search words
Dim blnIsRoot 'Boolean set to true if it is the root dirctory
Dim strFileURL 'Holds the path to the file on the site
Dim strServerPath 'Holds the server path to this script
Dim intNumFilesShown 'Holds the number of files shown so far
Dim intTotalFilesSearched 'Holds the number of files searched
Dim intTotalFilesFound 'Holds the total matching files found
Dim intFileNum 'Holds the file number
Dim intPageLinkLoopCounter 'Loop counter to display links to the other result pages
Dim sarySearchResults(1000) 'Array holding the search results
Dim intDisplayResultsLoopCounter 'loop counter to diplay the results of the search
Dim intResultsArrayPosition 'Stores the array position of the array storing the results
Dim blnSearchResultsFound 'Set to true if search results are found
Dim strFilesTypesToSearch 'Holds the types of files to be searched
Dim strBarredFolders 'Holds the folders that you don't want searched
Dim strBarredFiles 'Holds the names of the files not to be searched
Dim blnEnglishLanguage 'Set to True if the user is using English
' -------------------------- Change the following line to the number of results you wish to have on each page ------------------------------------
Const intRecordsPerPage = 20 'change this to the number of results to show on each page
' --------------------- Place the names of the files types you want searching in the following line sepeararted by commas --------------------------
strFilesTypesToSearch = "htm,html,asp,shtml"
' --------------------- Place the names of the folders you don't want searched in the following line spearated by commas --------------------------
strBarredFolders = "temp,temp1" 'cgi_bin and _bin have been put in here as examples, but you can put any folders in here
' ---------- Place the names of the files you don't want searched in the following line spearated by commas include the file extension -------------
strBarredFiles = "adminstation.htm,no_allowed.asp" 'adminstration.htm and not_allowed.asp have been put in as an examples
' -------------------- Set this boolean to False if you are not using an English language web site --------------------------------------------------
blnEnglishLanguage = True 'True = HTML Encode best for English sites \ False = no HTML Encoding best for non English sites
'-----------------------------------------------------------------------------------------------------------------------------------------------------
'Initalise variables
intTotalFilesSearched = 0
%>
part 2 too come
strBarredFiles = "adminstation.htm,no_allowed.asp"
strBarredFolders = "temp,temp1"
but when I publish the code, and search ??? they are still added to the search list, is there an easy reason why this is going wrong, I am stuck ???
here is the code :)
<% Option Explicit %>
<%
'Set the response buffer to true
Response.Buffer = False
'Dimension global variables
Dim fsoObject 'File system object
Dim fldObject 'Folder object
Dim sarySearchWord 'Array to hold the words to be searched for
Dim strSearchWords 'Holds the search words
Dim blnIsRoot 'Boolean set to true if it is the root dirctory
Dim strFileURL 'Holds the path to the file on the site
Dim strServerPath 'Holds the server path to this script
Dim intNumFilesShown 'Holds the number of files shown so far
Dim intTotalFilesSearched 'Holds the number of files searched
Dim intTotalFilesFound 'Holds the total matching files found
Dim intFileNum 'Holds the file number
Dim intPageLinkLoopCounter 'Loop counter to display links to the other result pages
Dim sarySearchResults(1000) 'Array holding the search results
Dim intDisplayResultsLoopCounter 'loop counter to diplay the results of the search
Dim intResultsArrayPosition 'Stores the array position of the array storing the results
Dim blnSearchResultsFound 'Set to true if search results are found
Dim strFilesTypesToSearch 'Holds the types of files to be searched
Dim strBarredFolders 'Holds the folders that you don't want searched
Dim strBarredFiles 'Holds the names of the files not to be searched
Dim blnEnglishLanguage 'Set to True if the user is using English
' -------------------------- Change the following line to the number of results you wish to have on each page ------------------------------------
Const intRecordsPerPage = 20 'change this to the number of results to show on each page
' --------------------- Place the names of the files types you want searching in the following line sepeararted by commas --------------------------
strFilesTypesToSearch = "htm,html,asp,shtml"
' --------------------- Place the names of the folders you don't want searched in the following line spearated by commas --------------------------
strBarredFolders = "temp,temp1" 'cgi_bin and _bin have been put in here as examples, but you can put any folders in here
' ---------- Place the names of the files you don't want searched in the following line spearated by commas include the file extension -------------
strBarredFiles = "adminstation.htm,no_allowed.asp" 'adminstration.htm and not_allowed.asp have been put in as an examples
' -------------------- Set this boolean to False if you are not using an English language web site --------------------------------------------------
blnEnglishLanguage = True 'True = HTML Encode best for English sites \ False = no HTML Encoding best for non English sites
'-----------------------------------------------------------------------------------------------------------------------------------------------------
'Initalise variables
intTotalFilesSearched = 0
%>
part 2 too come