|
|
| |
<%
' ********** INSTRUCTIONS FOR QUICK CUSTOMIZATION **********
'
' This form is set up for easy customization. It allows you to modify the
' page logo, the page background, the page title and simple query
' parameters by modifying a few files and form variables. The procedures
' to do this are explained below.
Dim FormLogo, FormBG, FormScope, PageSize, SiteLocale
Dim NewQuery, UseSavedQuery, SearchString, QueryForm, FreeText
Dim RankBase, ActiveQuery, NextRecordNumber, SrchStrLen, CompSearch
Dim oQuery, oUtil, oRS
Dim LastRecordOnPage, CurrentPage, NormRank, stars, WebHitsQuery
Dim SaveQuery, NextString, NextSet, NextPageNumber
'
'
' *** Modifying the Form Logo:
' The logo for the form is named is2logo.gif. To change the page logo, simply
' name your logo is2logo.gif and place in the same directory as this form. If
' your logo is not a GIF file, or you don't want to copy it, change the following
' line so that the logo variable contains the URL to your logo.
FormLogo = "../images/unylogo_157x60_300dpi.jpg"
'
' *** Modifying the Form's background pattern.
' You can use either a background pattern or a background color for your
' form. If you want to use a background pattern, store the file with the name
' is2bkgnd.gif in the same directory as this file and remove the remark character
' the single quote character) from the line below. Then put the remark character on
' the second line below.
'
' If you want to use a different background color than white, simply edit the
' bgcolor line below, replacing white with your color choice.
' FormBG = "background = " & chr(34) & "is2bkgnd.gif" & chr(34)
FormBG = "bgcolor = " & chr(34) & "#FFFFFF" & chr(34)
' *** Modifying the Form's Title Text.
' The Form's title text is set on the following line.
'
' *** Modifying the Form's Search Scope.
'
' The form will search from the root of your web server's namespace and below
' (deep from "/" ). To search a subset of your server, for example, maybe just
' a PressReleases directory, modify the scope variable below to list the virtual path to
' search. The search will start at the directory you specify and include all sub-
' directories.
FormScope = "/"
'
' *** Modifying the Number of Returned Query Results.
'
' You can set the number of query results returned on a single page
' using the variable below.
PageSize = 10
'
' *** Setting the Locale.
'
' The following line sets the locale used for queries. In most cases, this
' should match the locale of the server. You can set the locale below.
SiteLocale = "EN-US"
' ********** END QUICK CUSTOMIZATION SECTIONS ***********
' Set Initial Conditions
NewQuery = False
UseSavedQuery = False
SearchString = ""
QueryForm = Request.ServerVariables("PATH_INFO")
' Did the user press a SUBMIT button to execute the form? If so get the form variables.
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
SearchString = Request.Form("SearchString")
FreeText = Request.Form("FreeText")
' NOTE: this will be true only if the button is actually pushed.
If Request.Form("Action") = "Go" Then
NewQuery = True
RankBase = 1000
End If
End If
If Request.ServerVariables("REQUEST_METHOD") = "GET" Then
SearchString = Request.QueryString("qu")
FreeText = Request.QueryString("FreeText")
FormScope = Request.QueryString("sc")
RankBase = Request.QueryString("RankBase")
If Request.QueryString("pg") <> "" Then
NextPageNumber = Request.QueryString("pg")
NewQuery = False
UseSavedQuery = True
Else
NewQuery = SearchString <> ""
End If
End If
%>
>
Search the Unylogix Web site |
| |
<%
If NewQuery Then
Set Session("Query") = Nothing
Set Session("Recordset") = Nothing
NextRecordNumber = 1
' Remove any leading and ending quotes from SearchString
SrchStrLen = Len(SearchString)
If Left(SearchString, 1) = chr(34) Then
SrchStrLen = SrchStrLen-1
SearchString = Right(SearchString, SrchStrLen)
End If
If Right(SearchString, 1) = chr(34) Then
SrchStrLen = SrchStrLen-1
SearchString = Left(SearchString, SrchStrLen)
End If
If FreeText = "on" Then
CompSearch = "$contents " & chr(34) & SearchString & chr(34)
Else
CompSearch = SearchString
End If
Set oQuery = Server.CreateObject("ixsso.Query")
Set oUtil = Server.CreateObject("ixsso.Util")
oQuery.Catalog = "Unylogix-www"
'Exemple de MSDN: oQuery.Query = "CONTAINS Tolstoy AND @size < 100"
'mais... oQuery.Query = "CONTAINS Unylogix" ne retourne aucun resultat!!!
' oQuery.Query = CompSearch' @filename <> index-e.shtml
CompSearch = CompSearch & " and @Vpath != /\s/" ' Add check for pages that are not indexed, vpath = ""
oQuery.Query = CompSearch
oQuery.SortBy = "rank[d]"
oQuery.Columns = "DocTitle, Vpath, Filename, Size, Write, Characterization, Rank"
oQuery.MaxRecords = 300
If FormScope <> "/" Then
Call oUtil.AddScopeToQuery(oQuery, FormScope, "deep")
End If
If SiteLocale<>"" Then
oQuery.LocaleID = oUtil.ISOToLocaleID(SiteLocale)
End If
Set oRS = oQuery.CreateRecordSet("nonsequential")
oRS.PageSize = PageSize
ActiveQuery = True
ElseIf UseSavedQuery Then
If IsObject( Session("Query") ) And IsObject( Session("RecordSet") ) Then
Set oQuery = Session("Query")
Set oRS = Session("RecordSet")
If oRS.RecordCount <> -1 And NextPageNumber <> -1 Then
oRS.AbsolutePage = NextPageNumber
NextRecordNumber = oRS.AbsolutePosition
End If
ActiveQuery = True
Else
Response.Write("ERROR - No saved query")
End If
End If
If ActiveQuery Then
If not oRS.EOF Then
%>
<%
LastRecordOnPage = NextRecordNumber + oRS.PageSize - 1
CurrentPage = oRS.AbsolutePage
If oRS.RecordCount <> -1 And oRS.RecordCount < LastRecordOnPage Then
LastRecordOnPage = oRS.RecordCount
End If
Response.Write("Documents " & NextRecordNumber & " to " & LastRecordOnPage)
If oRS.RecordCount <> -1 Then
Response.Write(" of " & oRS.RecordCount)
End If
Response.Write(" matching the query " & chr(34) & "")
Response.Write(SearchString & "" & chr(34) & ". ")
%>
<% If Not oRS.EOF And NextRecordNumber <= LastRecordOnPage Then%>
<% End If %>
<%
Do While Not oRS.EOF And NextRecordNumber <= LastRecordOnPage
' This is the detail portion for Title, Abstract, URL, Size, and
' Modification Date.
' If there is a title, display it, otherwise display the filename.
%>
<% ' Graphically indicate rank of document with list of stars (*'s).
' If oRS("filename") <> "index-e.shtml" And oRS("filename") <> "index-g.shtml" Then
If NextRecordNumber = 1 Then
RankBase = oRS("rank")
End If
If RankBase > 1000 Then
RankBase = 1000
ElseIf RankBase < 1 Then
RankBase = 1
End If
NormRank = oRS("rank") / RankBase
If NormRank > 0.80 Then
stars = "rankbtn5.gif"
ElseIf NormRank > 0.60 Then
stars = "rankbtn4.gif"
ElseIf NormRank > 0.40 Then
stars = "rankbtn3.gif"
ElseIf NormRank > 0.20 Then
stars = "rankbtn2.gif"
Else
stars = "rankbtn1.gif"
End If
%>
|
<%= NextRecordNumber%>.
|
<%If VarType(oRS("DocTitle")) = 1 Or oRS("DocTitle") = "" Then%>
" class="RecordTitle"><%= Server.HTMLEncode(oRS("filename"))%>
<%Else%>
" class="RecordTitle"><%= Server.HTMLEncode(oRS("DocTitle"))%>
<%End If%>
|
<%
' Construct the URL for hit highlighting
WebHitsQuery = "CiWebHitsFile=" & Server.URLEncode( oRS("vpath") )
WebHitsQuery = WebHitsQuery & "&CiRestriction=" & Server.URLEncode( oQuery.Query )
WebHitsQuery = WebHitsQuery & "&CiBeginHilite=" & Server.URLEncode( "" )
WebHitsQuery = WebHitsQuery & "&CiEndHilite=" & Server.URLEncode( "" )
WebHitsQuery = WebHitsQuery & "&CiUserParam3=" & QueryForm
' WebHitsQuery = WebHitsQuery & "&CiLocale=" & oQuery.LocaleID
%>
Summary
Full
|
<%If VarType(oRS("characterization")) = 8 And oRS("characterization") <> "" Then%>
Abstract: <%=Server.HTMLEncode(oRS("characterization"))%>
<%End If%>
" class="RecordStats" style="color:blue;">http://<%=Request("server_name")%><%=oRS("vpath")%>
<%If oRS("size") = "" Then%>(size and time unknown)<%Else%>size <%=oRS("size")%> bytes - <%=oRS("write")%> GMT<%End If%>
|
<%
' End If 'file exceptions
oRS.MoveNext()
NextRecordNumber = NextRecordNumber + 1
Loop
%>
<%
Else ' NOT oRS.EOF
If NextRecordNumber = 1 Then
Response.Write("No documents matched the query
")
Else
Response.Write("No more documents in the query ")
End If
End If ' NOT oRS.EOF
If Not oQuery.OutOfDate Then
' If the index is current, display the fact %>
The index is up to date.
<%End If
If oQuery.QueryIncomplete Then
' If the query was not executed because it needed to enumerate to
' resolve the query instead of using the index, but AllowEnumeration
' was False, let the user know %>
The query is too expensive to complete.
<%End If
If oQuery.QueryTimedOut Then
' If the query took too long to execute (for example, if too much work
' was required to resolve the query), let the user know %>
The query took too long to complete.
<%End If%>
<%
' This is the "previous" button.
' This retrieves the previous page of documents for the query.
%>
<%SaveQuery = False%>
<%If CurrentPage > 1 And oRS.RecordCount <> -1 Then %>
|
|
<%SaveQuery = True%>
<%End If%>
<%
' This is the "next" button for unsorted queries.
' This retrieves the next page of documents for the query.
If Not oRS.EOF Then%>
|
<%SaveQuery = True%>
<%End If%>
<% ' Display the page number %>
Page <%=CurrentPage%>
<%
If oRS.PageCount <> -1 Then
Response.Write(" of " & oRS.PageCount)
End If
' If either of the previous or back buttons were displayed, save the query
' and the recordset in session variables.
If SaveQuery Then
Set Session("Query") = oQuery
Set Session("RecordSet") = oRS
Else
oRS.close()
Set oRS = Nothing
Set oQuery = Nothing
Set Session("Query") = Nothing
Set Session("RecordSet") = Nothing
End If
%>
<% End If %>
|
|
|
|
|