<%@ LANGUAGE=vbscript%> <%option explicit%> Search Results <% const fldTitle = 0 const fldThumbnailFileName = 1 const fldFileName = 2 const fldOrientation = 3 const fldPhotographerLName = 4 const fldPhotographerFName = 5 const fldPhotoID = 6 const fldPhotographerID = 7 const fldSKU = 8 const DEFAULTRESULTSPERPAGE = 9 const PAGEBLOCKSIZE = 10 dim oNPO dim oRS dim intCounter dim intResultCounter dim intDisplayWidth dim intDisplayHeight dim intDisplayPage dim intResultsPerPage dim txtSearchCriteria dim strOrientation dim strCategory dim strPLastName dim strPFirstName dim strContinent dim strSKU dim intKEY on error resume next ' Default Rows Per Page intResultsPerPage = Request.QueryString("rpp") if not cint(intResultsPerPage)> 0 then intResultsPerPage = DEFAULTRESULTSPERPAGE ' Default Display Page intDisplayPage = Request.QueryString("dp") if intDisplayPage = 0 then intDisplayPage = 1 ' Default the KEYword-Only flag intKEY = Request.QueryString("KEY") if intKey = vbnullstring then intKey = 0 txtSearchCriteria = Request.QueryString("txtSearchCriteria") strOrientation = Request.QueryString("ORN") strCategory = Request.QueryString("CAT") strPLastName = Request.QueryString("PLN") strPFirstName = Request.QueryString("PFN") strContinent = Request.QueryString("CON") strSKU = Request.QueryString("SKU") ' Debugging code 'Response.Write "txtSearchCriteria = " & txtSearchCriteria & "
" 'Response.Write "strOrientation = " & strOrientation & "
" 'Response.Write "strCategory = " & strCategory & "
" 'Response.Write "strPLastName = " & strPLastName & "
" 'Response.Write "strPFirstName = " & strPFirstName & "
" 'Response.Write "strContinent = " & strContinent & "
" 'Response.Write "strSKU = " & strSKU & "
" 'Response.Write "intKEY = " & intKEY & "
" 'Response.Write "intRPP = " & intResultsPerPage & "
" intCounter = 0 if err then response.write "Error: " & err.number & " " + err.description + " " set onpo = Server.CreateObject( "NPOProcedures.clsnpo" ) if err then response.write "Error Instanciating NPO Object." else if not onpo is nothing then set oRS = oNPO.GetThumbnails(cstr(txtSearchCriteria), cstr(strContinent), cstr(strPFirstName), cstr(strPLastName), cstr(strCategory), cstr(strOrientation), cstr(strSKU), cint(intKEY)) if err then response.write err.number & " " + err.description + " " err.clear else oRS.movefirst if err then %>
No images matching your search criteria were found.
<% else %>
<%if cint(intDisplayPage) > 1 then%>
<%else%>
<% end if %>

<%if cint(intDisplayPage) < ((oRS.Recordcount - 1)\intResultsPerPage +1 ) then%> <%else%> <%end if%>
<% oRS.Move ((intDisplayPage - 1) * intResultsPerPage) intResultCounter = 0 Do While ((Not oRS.EOF) and cint(intResultCounter) < cint(intResultsPerPage)) if intCounter = 3 then Response.Write "" intCounter = 0 end if if oRS.Fields(fldOrientation).Value = "V" then intDisplayWidth = 66 intDisplayHeight = 99 else intDisplayWidth = 99 intDisplayHeight = 66 end if %> <% oRS.movenext if err then Response.Write err.number & " " + err.description response.write "Error on Move Next. " exit do end if Loop %>
<% if oRS.Fields(fldOrientation).Value = "V" then %> <% else %> <% end if %>
"> ">
<% if oRS.Fields(fldOrientation).Value = "V" then %> <%= oRS.Fields(fldTitle).value %> <% else %> <%= oRS.Fields(fldTitle).value %> <% end if intCounter = intCounter + 1 intResultCounter = intResultCounter + 1 %>
ID# <%=oRS.fields(fldSKU).Value%>
Photographer:
<%= oRS.Fields(fldPhotographerLName).value %>, <%= oRS.Fields(fldPhotographerFName).value %>
page <%=intDisplayPage%> of <%=(oRS.Recordcount - 1)\intResultsPerPage +1 %>   <%if cint(intDisplayPage) < ((oRS.Recordcount - 1)\intResultsPerPage +1 ) then %> next page <% end if %>
jump to page   <% dim intLooper dim intStartAt for intStartAt = 1 to oRS.Recordcount step PAGEBLOCKSIZE if cint(intDisplayPage) >= cint(intStartAt) and _ cint(intDisplayPage) < cint(intStartAt) + cint(PAGEBLOCKSIZE) then exit for next ' Print the << (go back a block of pages) marker if cint(intDisplayPage) > int(PAGEBLOCKSIZE) then %> << <% end if ' Next 10 Pages for intLooper = cint(intStartAt) to ((oRS.Recordcount - 1)\intResultsPerPage +1 ) if cint(intLooper) >= cint(intStartAt)+ cint(PAGEBLOCKSIZE) then exit for %> <%= intLooper%> <% next ' Jump to Next bloc of Pages ">>" if cint(intLooper) < ((oRS.Recordcount - 1)\intResultsPerPage +1 ) then %> >> <% end if %>  
<% end if end if end if set onpo = nothing end if %>