<% 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 %>
" alt="<%=oCat.collection.getAttribute("title")%>">
<% local_display_pageLinks oCat, oPage %>
<% '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 %> "> <% 'END: HTML/VBScript end select set oFS = nothing end function '##################################################################### '# Display bio link '##################################################################### function local_display_bioLink(oCat, oPage) if( len(oCat.getProperty("bio")) > 0 ) then 'BEGIN: HTML/VBScript %>
', 650, 550);">
<% 'END: HTML/VBScript end if end function '##################################################################### '# Display web site link '##################################################################### function local_display_siteLink(oCat, oPage) dim item, link, image if( len(oCat.getProperty("siteLink")) > 0 ) then for each item in split(oCat.getProperty("siteLink"), ",") if( inStr(item, "|") ) then link = trim(split(item, "|")(0)) image = trim(split(item, "|")(1)) else link = trim(item) image = "url.gif" end if 'BEGIN: HTML/VBScript %>
" border="0">
<% 'END: HTML/VBScript next end if end function '##################################################################### '# Display stock link '##################################################################### function local_display_stockLink(oCat, oPage) if( len(oCat.getProperty("stockLink")) > 0 ) then 'BEGIN: HTML/VBScript %>
">
<% 'END: HTML/VBScript end if end function '##################################################################### '# Display fridge link '##################################################################### function local_display_fridge(oCat, oPage) if( len(oCat.getProperty("fridge")) > 0 ) then 'BEGIN: HTML/VBScript %>
', 365, 473);">
<% 'END: HTML/VBScript end if end function '##################################################################### '# Display studio link '##################################################################### function local_display_studio(oCat, oPage) if( len(oCat.getProperty("studio")) > 0 ) then 'BEGIN: HTML/VBScript %>
', 440, 340);">
<% 'END: HTML/VBScript end if end function '##################################################################### '# Display content '##################################################################### function local_display_content(oPage, byRef oCat) '# added 4-22-04 by tcb '# try to make the height not vary per artist. '# also change catalog to new.catalog to add length to the collection dim topPad topPad = 19 if oCat.collection.length > 2 then topPad = 10 end if 'BEGIN: HTML/VBScript %>
<% local_display_collections oCat, oPage %>
" alt="<%=oCat.getProperty("title")%>">
<% 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 %>
<% 'END: HTML/VBScript end function %>