<%@ LANGUAGE = VBScript %> <% ' Option Explicit %> Search The Project on Religion and Urban Culture | Curriculum Materials


The Polis Center Logo

Search The Project on Religion and Urban Culture Curriculum Materials
 


Faith and Community in Broad Ripple
Religion and Public Life (Summer 2002)
Religion as a Window on Culture
Contact Us
Search
Curriculum Materials
Project Home
<% ' Customization variables DebugFlag = False ' set TRUE for debugging UseSessions = FALSE ' set FALSE to disable use of session variables RecordsPerPage =10 ' number of results on a page MaxResults = -1 ' total number of results returned ' Hard-code some parameters that could be taken from the form ' SortBy = "rank[d]" ' sort order Scope = "/RUC-old/Curricula" ' query scope ' Set initial conditions NewQuery = FALSE UseSavedQuery = FALSE SearchString = "" QueryForm = Request.ServerVariables("PATH_INFO") if Request.ServerVariables("REQUEST_METHOD") = "POST" then SearchString = Request.Form("SearchString") DocAuthorRestriction = Request.Form("DocAuthorRestriction") FSRest = Request.Form("FSRest") FSRestVal = Request.Form("FSRestVal") FSRestOther = Request.Form("FSRestOther") FMMod = Request.Form("FMMod") FMModDate = Request.Form("FMModDate") SortBy = Request.Form("SortBy") ' Scope = Request.Form("Scope") RankBase = Request.Form("RankBase") ' NOTE: this will be true only if the button is actually pushed. if Request.Form("Action") = "Execute" then NewQuery = TRUE NextPageNumber = -1 elseif Request.Form("pg") <> "" then NextPageNumber = Request.Form("pg") UseSavedQuery = UseSessions NewQuery = not UseSessions end if end if %>

Enter your query:
Modified:

<% DocAuthorRestriction = "" FSRest = "<" FSRestVal = "any" FSRestOther= "" %> <%if DebugFlag then%>
    SearchString         = <%=SearchString%>
    DocAuthorRestriction = <%=DocAuthorRestriction%>
    FSRest               = <%=FSRest%>
    FSRestVal            = <%=FSRestVal%>
    FSRestOther          = <%=FSRestOther%>
    FMMod                = <%=FMMod%>
    FMModDate            = <%=FMModDate%>
    SortBy               = <%=SortBy%>
    Scope                = <%=Scope%>
    NewQuery             = <%=CStr(NewQuery)%>
    UseSavedQuery        = <%=CStr(UseSavedQuery)%>
    
<%end if%> <% if searchstring = "" then Response.Write "Please Enter Search Criteria!" %>

 
Polis Center Navigation
<% Response.End end if%> <% if NewQuery then if UseSessions then set Session("Query") = nothing set Session("Recordset") = nothing end if NextRecordNumber = 1 set Q = Server.CreateObject("ixsso.Query") Composer = "" TheQuery = "" if SearchString <> "" then if Left( SearchSting, 1 ) <> "@" AND Left( SearchString, 1 ) <> "#" AND Left( SearchString, 1 ) <> "$" then TheQuery = "(@Contents " + SearchString + " and ( #filename *.|(htm|,html|,asp|) ))" else TheQuery = "(" + SearchString + ")" end if Composer = " & " end if if FSRestVal <> "any" then if FSRestVal <> "other" then TheQuery = "(@Size " + FSRest + FSRestVal + ") " + Composer + TheQuery else TheQuery = "(@Size " + FSRest + FSRestOther + ") " + Composer + TheQuery end if Composer = " & " end if if DocAuthorRestriction <> "" then TheQuery = "(@DocAuthor " + DocAuthorRestriction + ") " + Composer + TheQuery Composer = " & " end if if FMMod <> "" AND FMMod <> "any" then if FMMod <> "since" then TheQuery = "(@Write > " + FMMod + ") " + Composer + TheQuery else TheQuery = "(@Write > " + FMModDate + ") " + Composer + TheQuery end if end if if DebugFlag then Response.Write "TheQuery = " & TheQuery & "
" end if Q.Catalog = "web" Q.Query = TheQuery Q.SortBy = SortBy Q.Columns = "DocTitle, vpath, path, filename, size, write, characterization, rank" if MaxResults <> -1 then Q.MaxRecords = MaxResults end if if Scope <> "\" then set Util = Server.CreateObject("ixsso.Util") Util.AddScopeToQuery Q, Scope, "DEEP" set Util = nothing end if set RS = Q.CreateRecordSet("nonsequential") RS.PageSize = RecordsPerPage ActiveQuery = TRUE elseif UseSavedQuery then if IsObject( Session("Query") ) And IsObject( Session("RecordSet") ) then set Q = Session("Query") set RS = Session("RecordSet") ActiveQuery = TRUE else Response.Write "ERROR - No saved query" end if end if if ActiveQuery then if RS.RecordCount <> -1 and NextPageNumber <> -1 then RS.AbsolutePage = NextPageNumber NextRecordNumber = RS.AbsolutePosition end if %> <% if not RS.EOF then %>
<% LastRecordOnPage = NextRecordNumber + RS.PageSize - 1 CurrentPage = RS.AbsolutePage if RS.RecordCount <> -1 AND RS.RecordCount < LastRecordOnPage then LastRecordOnPage = RS.RecordCount end if Dim Pathnew 'added 'MsgBox ("the path is" & Rs("vpath")) Pathnew = RS("vpath")' added counter = 0 Do While Not RS.EOF If InStr(1,PathNew,"html") > 0 or InStr(1,PathNew,"htm") > 0 or InStr(PathNew,"asp") > 0 then PathNew = RS("vpath") counter = counter + 1 end if PathNew = RS("vpath") RS.MoveNext loop IF ActiveQuery THEN RS.Move NextRecordNumber - 1,1 ELSE RS.MoveFirst END IF if counter = "0" then Response.Write "No Documents Match Your Query" Response.End end if Response.Write "Documents " & NextRecordNumber & " to " & LastRecordOnPage if RS.RecordCount <> -1 then Response.Write " of " & RS.RecordCount 'Response.Write " of " & counter end if if SearchString <> "" then Response.Write " matching the query " & chr(34) & "" Response.Write SearchString & "" & chr(34) & ".

" end if %> <% if Not RS.EOF and NextRecordNumber <= LastRecordOnPage then%> <%end if%> <% Do While Not RS.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 NextRecordNumber = 1 then RankBase=RS("rank") end if if RankBase>1000 then RankBase=1000 elseif RankBase<1 then RankBase=1 end if NormRank = RS("rank")/RankBase if NormRank > 0.80 then stars = "/search/rankbtn5.gif" elseif NormRank > 0.60 then stars = "/search/rankbtn4.gif" elseif NormRank > 0.40 then stars = "/search/rankbtn3.gif" elseif NormRank >.20 then stars = "/search/rankbtn2.gif" else stars = "/search/rankbtn1.gif" end if %> <%Dim Path 'added Path = RS("vpath")' added %> <%'If InStr(UCase(Path),"HTML") or InStr(UCase(Path),"HTM") then%>

<% NextRecordNumber = NextRecordNumber+1 %> <%'end if%> <% RS.MoveNext ' NextRecordNumber = NextRecordNumber+1 Loop %>
<%if VarType(RS("DocTitle")) <> 1 or RS("DocTitle") <> "" then VirtualPath = Replace(RS("vpath")," ","%20",1,-1,1) IF Len(Server.HTMLEncode(RS("DocTitle"))) = 0 THEN %> <%=VirtualPath%>">http://<%=Request("server_name")%><%=RS("vpath")%> <%ELSE %> <%=VirtualPath%>"><%= Server.HTMLEncode(RS("DocTitle"))%> <%END IF%> <%end if%>

<% ' Construct the URL for hit highlighting WebHitsQuery = "CiWebHitsFile=" & Server.URLEncode( RS("vpath") ) WebHitsQuery = WebHitsQuery & "&CiRestriction=" & Server.URLEncode( Q.Query ) WebHitsQuery = WebHitsQuery & "&CiBeginHilite=" & Server.URLEncode( "" ) WebHitsQuery = WebHitsQuery & "&CiEndHilite=" & Server.URLEncode( "" ) WebHitsQuery = WebHitsQuery & "&CiUserParam3=" & QueryForm WebHitsQuery = WebHitsQuery & "&CiLocale=" & Q.LocaleID %>
<%if VarType(RS("characterization")) = 8 and RS("characterization") <> "" then%> Abstract: <%= Server.HTMLEncode(RS("characterization"))%>
<%end if%> <% VirtualPath = Replace(RS("vpath")," ","%20",1,-1,1) %>  


<% else ' NOT RS.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 RS.EOF if NOT Q.OutOfDate then ' If the index is current, display the fact %>

The index is up to date.
<%end if if Q.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 Q.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 RS.RecordCount <> -1 then %> <%SaveQuery = UseSessions%> <%end if%> <%if Not RS.EOF then ' This is the "next" button. ' This button retrieves the next page of documents for the query. %> <%SaveQuery = UseSessions%> <%end if%>
<% NextString = "Next " if RS.RecordCount <> -1 then NextSet = (RS.RecordCount - NextRecordNumber) + 1 if NextSet > RS.PageSize then NextSet = RS.PageSize end if NextString = NextString & NextSet & " documents" else NextString = NextString & " page of documents" end if %>
<% ' Display the page number ' 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") = Q set Session("RecordSet") = RS else RS.close Set RS = Nothing Set Q = Nothing if UseSessions then set Session("Query") = Nothing set Session("RecordSet") = Nothing end if end if end if %>

  Polis Center Navigation