%@ Language=VBScript %>
<% Option Explicit %>
<%
Function FormatURL(strPath)
'Cut off everything before aushost and replace all \ with /
Dim iPos
iPos = InStr(1,strPath,"aushost",1)
Dim str
str = Mid(strPath,iPos+7,Len(strPath))
FormatURL = Replace(str,"\","/")
End Function
Function GetFiles(objFolder, aLookFor, strLF, bolLFFound,bolAnd, iCount)
If Left(objFolder.Name,1) = "_" then exit function
Const iListPerPage = 4
if iCount > iListPerPage then Exit Function
'Now, loop through each file
Dim objFile, objTextStream, objFSO, strContents, iUBound, iLoop, bolValid
Dim strTitle, iPos, strDesc
iUBound = UBound(aLookFor)
For Each objFile in objFolder.Files
'Do we need to search this file?
If UCase(Right(objFile.Name,4)) = ".HTM" then
If bolLFFound then
if objFile.Size > 0 then
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTextStream = objFSO.OpenTextFile(objFile.Path,1)
strContents = objTextStream.ReadAll
objTextStream.Close
Set objFSO = Nothing
if bolAnd then bolValid = True else bolValid = False
For iLoop = 0 to iUBound
If InStr(1,strContents,aLookFor(iLoop),1) then
if Not bolAnd then bolValid = True
Else
If bolAnd then bolValid = False
End If
Next
If bolValid then
iPos = InStr(1,strContents,"")-iPos-10)
iPos = InStr(iPos,strContents,"")-iPos-9)
End If
End If
Response.Write "" & _
strTitle & "
" & vbCrLf
Response.Write "" & strDesc
Response.Write "
" & vbCrLf
iCount = iCount + 1
End if
If iCount > iListPerPage then
strLF = FormatURL(objFile.Path)
exit function
End If
End If
Elseif FormatURL(objFile.Path) = strLF then
bolLFFound = True
End If
End if
Next
Dim objSubFolder
For Each objSubFolder in objFolder.SubFolders
GetFiles objSubFolder,aLookFor,strLF,bolLFFound,bolAnd,iCount
Next
End Function
'Search the site!
Dim strKeywords
strKeywords = Request("terms")
'Split the terms on spaces
Dim termsArray
termsArray = split(strKeywords," ")
'Set the boolean search option
Dim bolAnd
If Request("boolean") = "AND" then bolAnd = True else bolAnd = False
Dim section
section = Request("selSearchWhere")
'Get the dirs to search
If section = "ALLAUSHOST" then
section = Server.MapPath("/")
else
section = Server.MapPath("/support/")
end if
'What page are we on?
Dim strLastFile
strLastFile=Request("lf")
Dim objFSO, objFolder
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(section)
Set objFSO = Nothing
%>
AusHost - Main Page
 |
|
|
|
|
|
|
Web
Solutions |
|
|
|
Results of your Search
Redefine your Search
Below are the results of your search in no particular order...
<%
Dim iResults
iResults = 0
'Now, recurse the directories
If Len(strLastFile) = 0 then
GetFiles objFolder,termsArray,strLastFile,True,bolAnd,iResults
Else
GetFiles objFolder,termsArray,strLastFile,False,bolAnd,iResults
End If
Set objFolder = Nothing
If iResults = 5 then
'Show next page link
%>
&selSearchWhere=<%=Request("selSearchWhere")%>&lf=<%=Server.URLEncode(strLastFile)%>" class="nav">
Show more results...
<% Elseif iResults = 0 then
'No results found %>
No results found!
Try another search...
<% End IF %>
|
|
|
|
 |
|
| |