<%@LANGUAGE="VBSCRIPT"%> <% function short_display(input_string) 'Only display 9 words. 'if less than 9 words, display entire string, else display first 9 and put a '...' 'to indicate the string has been truncated. 'first count spaces countarray = split(input_string, " ") spaces = ubound(countarray) if spaces < 8 then output = input_string else output = "" outputcount = 0 for each word in countarray if outputcount = 9 then output = output & "..." exit for end if if outputcount > 0 then output = output & " " & word else output = word end if outputcount = outputcount +1 next end if response.write(output) end function Dim results__queryType results__queryType = "" if (session("query_type") <> "") then results__queryType = session("query_type") Dim results__BasicSearch results__BasicSearch = "" if (request("basic_search") <> "") then results__BasicSearch = request("basic_search") ' results__BasicSearch = replace(results__BasicSearch, "'", "''") end if Dim results__format1 results__format1 = "" if (request("format1") <> "") then results__format1 = request("format1") Dim results__firstline results__firstline = "" if (request("firstline") <> "") then results__firstline = request("firstline") ' results__firstline = replace(results__firstline, "'", "") end if Dim results__person results__person = "" if (request("person") <> "") then results__person = request("person") results__person = replace(results__person, "'", "") end if Dim results__place results__place = "" if (request("place") <> "") then results__place = request("place") Dim results__period results__period = "" if (request("period") <> "") then results__period = request("period") Dim results__subject results__subject = "" if (request("subject") <> "") then results__subject = request("subject") ' results__subject = replace(results__subject, "'", "") end if Dim results__title results__title = "" if (request("title") <> "") then results__title = request("title") ' results__title = replace(results__title, "'", "") end if Dim results__key results__key = "" if (request("key") <> "") then results__key = request("key") Dim results__tunetype results__tunetype = "" if (request("tunetype") <> "") then results__tunetype = request("tunetype") Dim results__timesig results__timesig = "" if (request("timesig") <> "") then results__timesig = request("timesig") Dim results__mode results__mode = "" if (request("mode") <> "") then results__mode = request("mode") Dim results__collection results__collection = "" if (request("collection") <> "") then results__collection = request("collection") Dim results__theme results__theme = "" if (request("theme") <> "") then results__theme = request("theme") Dim results__keyword results__keyword = "" if (request("keyword") <> "") then results__keyword = request("keyword") 'response.write("Query type: " & session("query_type") & "
") 'response.write("Basic search: " & request("basic_search") & "
") 'response.write("format1: " & request.form("format1") & "
") 'response.write("firstline: " & request.form("firstline") & "
") 'response.write("person: " & request.form("person") & "
") 'response.write("place: " & request.form("place") & "
") 'response.write("period: " & request("period") & "
") 'response.write("subject: " & request.form("subject") & "
") 'response.write("title: " & request("title") & "
") 'response.write("key: " & request.form("key") & "
") 'response.write("tunetype: " & request.form("tunetype") & "
") 'response.write("timesig: " & request.form("timesig") & "
") 'response.write("mode: " & request.form("mode") & "
") set results = Server.CreateObject("ADODB.Recordset") results.ActiveConnection = MM_farne_STRING results.Source = "{call dbo.gc_search('" + Replace(results__queryType, "'", "''") + "','" + Replace(results__BasicSearch, "'", "''") + "','" + Replace(results__format1, "'", "''") + "','" + Replace(results__firstline, "'", "''") + "','" + Replace(results__person, "'", "''") + "','" + Replace(results__place, "'", "''") + "','" + Replace(results__period, "'", "''") + "','" + Replace(results__subject, "'", "''") + "','" + Replace(results__title, "'", "''") + "','" + Replace(results__key, "'", "''") + "','" + Replace(results__tunetype, "'", "''") + "','" + Replace(results__timesig, "'", "''") + "','" + Replace(results__mode, "'", "''") + "','" + Replace(results__collection, "'", "''") + "','" + Replace(results__theme, "'", "''") + "','" + Replace(results__keyword, "'", "''") + "')}" 'response.write(results.source) 'response.End() results.CursorType = 0 results.CursorLocation = 2 results.LockType = 3 'response.write(results.source & "
") results.Open() results_numRows = 0 ' set the record count 'If not results.EOF then results_total = results.RecordCount 'end if ' *** Recordset Stats: if we don't know the record count, manually count them If (results_total = -1) Then ' count the total records by iterating through the recordset results_total=0 While (Not results.EOF) results_total = results_total + 1 results.MoveNext Wend ' reset the cursor to the beginning If (results.CursorType > 0) Then results.MoveFirst Else results.Requery End If While (NOT results.EOF) results_list = results_list & results.fields.item("record_number").value results.movenext() if not results.EOF then results_list = results_list & "," end if wend 'Create a session variable if we've come from the results page. session("from_results_page") = "1" session("array_results") = split(results_list, ",") if results_total > 0 then results.movefirst() end if Dim Repeat1__numRows Repeat1__numRows = 10 Dim Repeat1__index Repeat1__index = 0 results_numRows = results_numRows + Repeat1__numRows ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables ' set the number of rows displayed on this page If (results_numRows < 0) Then results_numRows = results_total Elseif (results_numRows = 0) Then results_numRows = 1 End If ' set the first and last displayed record results_first = 1 results_last = results_first + results_numRows - 1 ' if we have the correct record count, check the other stats If (results_total <> -1) Then If (results_first > results_total) Then results_first = results_total If (results_last > results_total) Then results_last = results_total If (results_numRows > results_total) Then results_numRows = results_total End If %> <% ' set the number of rows displayed on this page If (results_numRows < 0 Or results_numRows > results_total) Then results_numRows = results_total End If ' set the first and last displayed record results_first = 1 results_last = results_first + results_numRows - 1 If (results_first > results_total) Then results_first = results_total If (results_last > results_total) Then results_last = results_total End If %> <% ' *** Move To Record and Go To Record: declare variables Set MM_rs = results MM_rsCount = results_total MM_size = results_numRows MM_uniqueCol = "" MM_paramName = "" MM_offset = 0 MM_atTotal = false MM_paramIsDefined = false If (MM_paramName <> "") Then MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "") End If %> <% ' *** Move To Record: handle 'index' or 'offset' parameter if (Not MM_paramIsDefined And MM_rsCount <> 0) then ' use index parameter if defined, otherwise use offset parameter r = Request.QueryString("index") If r = "" Then r = Request.QueryString("offset") If r <> "" Then MM_offset = Int(r) ' if we have a record count, check if we are past the end of the recordset If (MM_rsCount <> -1) Then If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' move the cursor to the selected record i = 0 While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1)) MM_rs.MoveNext i = i + 1 Wend If (MM_rs.EOF) Then MM_offset = i ' set MM_offset to the last possible record End If %> <% ' *** Move To Record: if we dont know the record count, check the display range If (MM_rsCount = -1) Then ' walk to the end of the display range for this page i = MM_offset While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size)) MM_rs.MoveNext i = i + 1 Wend ' if we walked off the end of the recordset, set MM_rsCount and MM_size If (MM_rs.EOF) Then MM_rsCount = i If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount End If ' if we walked off the end, set the offset based on page size If (MM_rs.EOF And Not MM_paramIsDefined) Then If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then If ((MM_rsCount Mod MM_size) > 0) Then MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' reset the cursor to the beginning If (MM_rs.CursorType > 0) Then MM_rs.MoveFirst Else MM_rs.Requery End If ' move the cursor to the selected record i = 0 While (Not MM_rs.EOF And i < MM_offset) MM_rs.MoveNext i = i + 1 Wend End If %> <% ' *** Move To Record: update recordset stats ' set the first and last displayed record results_first = MM_offset + 1 results_last = MM_offset + MM_size If (MM_rsCount <> -1) Then If (results_first > MM_rsCount) Then results_first = MM_rsCount If (results_last > MM_rsCount) Then results_last = MM_rsCount End If ' set the boolean used by hide region to check if we are on the last record MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount) %> <% ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters ' create the list of parameters which should not be maintained MM_removeList = "&index=" If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "=" MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone="" ' add the URL parameters to the MM_keepURL string For Each Item In Request.QueryString NextItem = "&" & Item & "=" If (InStr(1,MM_removeList,NextItem,1) = 0) Then MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item)) End If Next ' add the Form variables to the MM_keepForm string For Each Item In Request.Form NextItem = "&" & Item & "=" If (InStr(1,MM_removeList,NextItem,1) = 0) Then MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item)) End If Next ' create the Form + URL string and remove the intial '&' from each of the strings MM_keepBoth = MM_keepURL & MM_keepForm if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1) if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1) if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1) ' a utility function used for adding additional parameters to these strings Function MM_joinChar(firstItem) If (firstItem <> "") Then MM_joinChar = "&" Else MM_joinChar = "" End If End Function %> <% ' *** Move To Record: set the strings for the first, last, next, and previous links MM_keepMove = MM_keepBoth MM_moveParam = "index" ' if the page has a repeated region, remove 'offset' from the maintained parameters If (MM_size > 0) Then MM_moveParam = "offset" If (MM_keepMove <> "") Then params = Split(MM_keepMove, "&") MM_keepMove = "" For i = 0 To UBound(params) nextItem = Left(params(i), InStr(params(i),"=") - 1) If (StrComp(nextItem,MM_moveParam,1) <> 0) Then MM_keepMove = MM_keepMove & "&" & params(i) End If Next If (MM_keepMove <> "") Then MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1) End If End If End If ' set the strings for the move to links If (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&" urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "=" MM_moveFirst = urlStr & "0" MM_moveLast = urlStr & "-1" MM_moveNext = urlStr & Cstr(MM_offset + MM_size) prev = MM_offset - MM_size If (prev < 0) Then prev = 0 MM_movePrev = urlStr & Cstr(prev) %> FARNE Archive Search :: Results
FARNE - Folk Archive Resource North East
FARNE Archive Search Browse the Archive Search Tips
 

FARNE Archive Search :: Results

 

Search Results

<% select case session("query_type") case "01" response.write("Simple search - you searched: " & request("basic_search")) case "02" response.write("Format search - you searched: " & request("format1")) case "03" response.write("Person search - you searched: " & request("person")) case "04" response.write("Place search - you searched: " & request("place")) case "05" response.write("Period search - you searched: " & request("period")) case "06" response.write("Advanced search.") case "07" response.write("Browse by collection search.") case "08" response.write("Browse by theme search.") case "09" response.write("Browse by keyword search - you searched: " & request("keyword")) case "10" response.write("First line search - you searched: " & request("firstline")) end select %>

Displaying records <%=(results_first)%> to <%=(results_last)%> of <%=(results_total)%>

<% count =0 While ((Repeat1__numRows <> 0) AND (NOT results.EOF)) count = count+1 if count = 1 then %> <% end if %> <% if count = 2 then count =0 %> <% end if %> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 results.MoveNext() Wend %>
<% myimage = left(results.Fields.Item("media_filenames").Value, 12) 'Set the image to the sound graphic if the record is a sound recording. if results.Fields.Item("simple_name").Value = "sound recording" then myimage = "soundfile_logo.jpg" end if 'Set the image to the video graphic if the record is a video. if results.Fields.Item("simple_name").Value = "video" then myimage = "video100x100.gif" end if if myimage <> "" then response.write("") end if %> <% if results.Fields.Item("prod_person").Value <> "" then array_prodpers = split(results.Fields.Item("prod_person").Value, ";") for each item in array_prodpers 'Assign 'prod_title' from 'item' prod_title = item 'Tidy up prod_title prod_title = replace(prod_title, "/", "") prod_title = replace(prod_title, "", "") start_colon = instr(prod_title, ":") if start_colon > 0 then prod_title = left(prod_title, start_colon-2) end if prod_text = item prod_text = replace(prod_text, "/", "") prod_text = replace(prod_text, "", "") start_colon = instr(prod_text, ":") tmp_text = mid(prod_text, start_colon+1) if left(tmp_text,1) = " " then prod_text = mid(prod_text, start_colon+2) else prod_text = mid(prod_text, start_colon+1) end if %> <% next end if %>
Click to show the results for this record

   

Title:

"> <% short_display(results.Fields.Item("title").Value)%>

<% response.write( "

" & prod_title & ":

") %>

"> <% short_display(prod_text)%>

Format:

"><%=(results.Fields.Item("simple_name").Value)%>

Period:

"><%=(results.Fields.Item("period").Value)%>

 

 

<% If MM_offset <> 0 Then %> First <% End If ' end MM_offset <> 0 %>

<% If MM_offset <> 0 Then %> Previous <% End If ' end MM_offset <> 0 %>

<% If Not MM_atTotal Then %> Next <% End If ' end Not MM_atTotal %>

<% If Not MM_atTotal Then %> Last <% End If ' end Not MM_atTotal %>

 

<% if session("query_type") = "01" then %>

Perform another simple search <% end if %> <% if session("query_type") = "02" then %> Perform another format search <% end if %> <% if session("query_type") = "03" then %> Perform another person search <% end if %> <% if session("query_type") = "04" then %> Perform another place search <% end if %> <% if session("query_type") = "05" then %> Perform another period search <% end if %> <% if session("query_type") = "06" then %> Perform another advanced search <% end if %> <% if session("query_type") = "07" then %> Perform another browse by collection search <% end if %> <% if session("query_type") = "08" then %> Perform another browse by theme search <% end if %> <% if session("query_type") = "09" then %> Perform another browse by keyword search <% end if %> <% if session("query_type") = "10" then %> Perform another first line search <% end if %>

 

t :: 0191 433 8430

f :: 0191 433 8424

e :: libraries@gateshead.gov.uk

Back Return to top
 

© Gateshead Council 2003

FARNE Folk Archive Resource North East
<% results.Close() %>