<% Dim folder, currentPic, PicsPerPage, pagenum Dim prevPic, nextPic 'for pic navigation left & right arrows Dim thisCategoryNum, inpCat Dim photo_blanks, iblankrow PicsPerPage = 12 'should be multiple of 3 '-------------------------get category info------------------------- thisCategoryNum = 0 for iCat = 1 to totalcategories if trim(request.querystring("portfolio")) = categories(iCat) then inpCat = trim(request.querystring("portfolio")) thisCategoryNum = iCat exit for end if next if (thisCategoryNum = 0) then inpCat = categories(1) 'default category is #1 thisCategoryNum = 1 end if folder = "photos/" & inpCat & "/" '-------------------------get currentPic------------------------- if not isnumeric(trim(request.querystring("photo"))) then currentPic = 1 elseif (trim(request.querystring("photo")) < 0) OR (trim(request.querystring("photo")) > 50) then currentPic = 1 elseif (photos(thisCategoryNum,trim(request.querystring("photo"))) = "") then currentPic = 1 else currentPic = trim(request.querystring("photo")) end if '-------------------------get prevPic, nextPic------------------------- if currentPic = 1 then prevPic = currentPic nextPic = currentPic + 1 elseif photos(thisCategoryNum,currentPic+1) = "" then ' if photo is last prevPic = currentPic - 1 nextPic = currentPic else prevPic = currentPic - 1 nextPic = currentPic + 1 end if '--------------------------------------------------------------------------- %>
<% '-------------------------portfolio thumbnails------------------------- pagenum = int((currentPic-1) / PicsPerPage) + 1 photo_blanks = 0 iphoto = ((pagenum-1) * picsperpage) + 1 do while (iphoto <= pagenum * picsperpage) if (photos(thisCategoryNum,iphoto) = "") then photo_blanks = photo_blanks + 1 end if iphoto = iphoto + 1 loop 'add blankrows as necessary to keep left/right arrows fixed for iblankrow = 1 to int(photo_blanks / 3) response.write("" & cr) response.write("" & cr) next iphoto = ((pagenum-1) * picsperpage) + 1 do while (photos(thisCategoryNum,iphoto) <> "") AND (iphoto <= pagenum * picsperpage) if (iphoto mod 3 = 1) then response.write("" & cr) else response.write("" & cr) end if response.write ("" & cr) if (iphoto mod 3 = 0) OR (photos(thisCategoryNum,iphoto+1) = "") then response.write("" & cr) response.write("" & cr) end if iphoto = iphoto + 1 loop '-------------------------back button------------------------- if (pagenum > 1) then response.write("") else response.write("") end if response.write("") '-------------------------more button------------------------- if (photos(thisCategoryNum,iphoto) <> "") then 'if there are more photos left response.write("") else response.write("") end if %>
") response.write ("
<% '------------------------- next and back buttons ------------------------- %>

<% '-------------------------portfolio navigation------------------------- for iCat = 1 to totalcategories if (iCat = thisCategoryNum) then buttonStatus = ".on" else buttonStatus = ".off" end if response.write("" & cr & "" & cr & "") next %>
<% '-------------------------main photo------------------------- %>