<%
If Query <> "" Then
%>
<%
query = Replace(query,""",""")
Response.Write("Your search for " & query & " returned the following results: ")
Set xml = Server.CreateObject ("Microsoft.XMLHTTP")
xml.Open "GET", "http://www.mirago.co.uk/scripts/xml.asp"& queryStr & "&offset=" & txtOffset, false'
xml.send
resultLength = CInt(xml.responseXML.selectNodes("SEARCHRESULTS/RESULTSET/RESULT").length)
%>
| <%
For iCount= 0 to CInt(resultLength)-1
set Node = xml.responseXML.selectSingleNode("SEARCHRESULTS/RESULTSET/RESULT[@ID=" & CInt(iCount)& "]")
%><%
Response.Write("- ")
Response.Write("")
Response.Write(Node.selectSingleNode("TITLE").text & "
")
%> | <%
%><%
Response.Write("| " & Node.selectSingleNode("ABSTRACT").text & " |
")
%> | <%
%><%
'*** The two lines below strip off the HTTP:// and / at the beginning and end of the URL, if present.
If Left(Node.selectSingleNode("URL").text,7) = "http://" Then Node.selectSingleNode("URL").text = Mid(Node.selectSingleNode("URL").text,8)
If Right(Node.selectSingleNode("URL").text,1) = "/" Then Node.selectSingleNode("URL").text = Left(Node.selectSingleNode("URL").text,Len(Node.selectSingleNode("URL").text)-1)
Response.Write("- " & Node.selectSingleNode("URL").text & "
")
%> | <%
Next
%> |
<%
if resultLength > 0 Then
Set Node = xml.responseXML.selectSingleNode("SEARCHRESULTS/RESULTSET[@DATABASE=""Mirago""]")
moreResults = Eval(Node.getAttribute("MORERESULTS"))
End If
Set xml = nothing
moreResults = true
If moreResults OR txtOffset > 0 Then
Response.Write(" ")
If txtOffset > 0 Then Response.Write("<< Previous results ")
If moreResults AND (CInt(txtOffset) < CInt(200-nres)) AND Query <> "" AND iCount+1 >= nRes Then Response.Write("More results >>")
Response.Write(" ")
End If
Response.Write(" ")
%> | <%
'*** If there is no Query, then the directories below are displayed.
Else
Dim wFile, aCategories(30), aCategory, cCount, catCount, nCat, colCount, sPath
'*** Reads in the Categories from a file.
Cat= Cat + ".txt"
Set fs = CreateObject("Scripting.FileSystemObject")
sPath = server.MapPath(Cat)
If fs.FileExists(sPath) Then
set wfile = fs.OpenTextFile(sPath)
nCat = -1
Do While Not wfile.AtEndOfStream
nCat = nCat + 1
aCategories(nCat) = wfile.ReadLine
Loop
wfile.close
set wfile=nothing
set fs=nothing
'*** Writes the Categories out into a table.
catCount = 0
%>
<%
Do While catCount <= nCat
aCategory = Split(aCategories(catCount),",")
cCount = 1
'*** Writes out the Category heading
%><%
Response.Write("" & aCategory(0) & " ")
'*** Writes out the contents of each category.
Do While cCount <= UBound(aCategory)
Response.Write("")
%><%=aCategory(cCount)%><%
Response.Write(" ")
cCount = cCount + 1
Loop
catCount = catCount + 1
colCount = colCount + 1
Response.Write(" | ")
'*** In the line below, set colCount to equal the number of columns of listings you want.
If colCount = 4 Then
Response.Write(" ")
colCount = 0
End If
Loop
%> <%
End If
End If
%>
|