% option explicit: response.buffer=FALSE %> <% main() '##################################################################### '# Main '##################################################################### function main() dim void, oShell, oPage, oCat, oPortfolio 'Instantiate... set oPage = new PageProperties: oPage.setProperties(request.queryString): oPage.setProperties(request.form) set oShell = new Shell: oShell.load("../_configs/shell.xml") set oCat = new Catalog: oCat.load("./catalog.xml") 'Set navigation context... oShell.setContext "portfolio" 'Select portfolio... oCat.loadPortfolio oPage.getProperty("portfolio") 'Set defaults... if( len(oPage.getProperty("collection")) = 0 ) then oPage.setProperty "collection", "0" end if if( len(oPage.getProperty("item")) = 0 ) then oPage.setProperty "item", "0" end if 'Set shell properties... oShell.setProperty "head.title", "FrankSturgesReps : " & oCat.getProperty("title") 'Open the shell... oShell.open() 'Display content... void = local_display_content(oPage, oCat) 'Close the shell... oShell.close() 'Cleanup... set oCat = nothing set oShell = nothing set oPage = nothing end function '##################################################################### '# Display page links '##################################################################### function local_display_pageLinks(oCat, oPage) dim sURL oCat.collection.item.setIndex 0 'Iterate through items collection... do while NOT oCat.collection.item.eof 'Build URL... sURL = "?portfolio=" & oPage.getEncoded("portfolio") _ & "&collection=" & oCat.collection.getIndex _ & "&item=" & oCat.collection.item.getIndex select case oPage.getProperty("collection") = cStr(oCat.collection.getIndex) AND oPage.getProperty("item") = cStr(oCat.collection.item.getIndex) case TRUE: 'Item is selected... 'BEGIN: HTML/VBScript %> <%=oCat.collection.item.getIndex + 1%> <% 'END: HTML/VBScript case FALSE: 'Item is not selected... 'BEGIN: HTML/VBScript %> <%=oCat.collection.item.getIndex + 1%> <% 'END: HTML/VBScript end select oCat.collection.item.moveNext() loop end function '##################################################################### '# Display collections '##################################################################### function local_display_collections(oCat, oPage) dim iPrev, iNext, sURL_next, sURL_prev oCat.collection.setIndex 0 do while NOT oCat.collection.eof 'Calculate next index... iNext = oPage.getProperty("item") + 1: if( iNext > oCat.collection.item.getLength - 1 ) then iNext = 0 end if 'Calculate previous index... iPrev = oPage.getProperty("item") - 1: if( iPrev < 0 ) then iPrev = oCat.collection.item.getLength - 1 end if 'Set next and previous index values to zero if not selected collection... if( cStr(oCat.collection.getIndex) <> oPage.getProperty("collection") ) then iNext = 0: iPrev =0 end if 'Build next url... sURL_next = "?portfolio=" & oPage.getEncoded("portfolio") _ & "&collection=" & oCat.collection.getIndex _ & "&item=" & iNext 'Build previous url... sURL_prev = "?portfolio=" & oPage.getEncoded("portfolio") _ & "&collection=" & oCat.collection.getIndex _ & "&item=" & iPrev 'BEGIN: HTML/VBScript %>
<% 'END: HTML/VBScript oCat.collection.moveNext loop end function '##################################################################### '# Display selection '##################################################################### function local_display_selection(oCat, oPage) dim aFile, oFS set oFS = new FileSystem 'Set the collection index... oCat.collection.setIndex oPage.getProperty("collection") 'Set the item index... oCat.collection.item.setIndex oPage.getProperty("item") 'Get the filename components... aFile = split(oCat.collection.item.getAttribute("file"), ".") 'Output based on file extension... select case uCase(aFile(uBound(aFile))) case "HTML" 'Output html file content... response.write oFS.catFile(server.mapPath(oCat.collection.getAttribute("basePath") & oCat.collection.item.getAttribute("file"))) case else 'Default to image output... 'BEGIN: HTML/VBScript %>![]() |
<% local_display_collections oCat, oPage %>
|
|
<% local_display_bioLink oCat, oPage %>
<% local_display_studio oCat, oPage %>
<% local_display_fridge oCat, oPage %>
<% local_display_siteLink oCat, oPage %>
<% local_display_stockLink oCat, oPage %>
|
<%
if Request.QueryString("portfolio") = "gtriplett" AND _
Request.QueryString("collection") = "0" AND _
Request.QueryString("item") = "0" THEN
%>
<% ELSE %>
<% local_display_selection oCat, oPage %>
<% END IF %>
|