Pictorial


Click on one section

<%'Returns a url to first or random pic in gallery depending on settings Function getPicUrl(gal) Dim fileNr Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(Server.MapPath(galleryfolder & gal)) Set fc = f.Files randomGalleryPic=1 if (fc.count>0) then 'Generate random nr to chose pic... if (picforgal="random") then Randomize fileNr = Int(Rnd * fc.count)+1 '... or set filenr to first file depending on settings else fileNr = 1 end if 'Find correct file and create url Dim i i = 1 For Each fil in fc if (i = fileNr) then getPicUrl = galleryfolder & gal & "/" & fil.name end if i = i + 1 Next 'If no pics in gallery else getPicUrl = galleryfolder & "empty.jpg" end if End Function %> <% 'Return the number of gallerys in the gallery file Function getGalleryCount() Dim rowCount, text, FSO, TSO rowCount = 0 Set FSO = CreateObject("Scripting.FileSystemObject") Set TSO = FSO.OpenTextFile(Server.MapPath(galleryfolder & glfile)) Do Until TSO.AtEndOfLine text = TSO.ReadLine rowCount = rowCount + 1 Loop TSO.Close getGalleryCount = rowCount End Function %> <% Dim F, T, text if (picforgal<>"none") then 'Vilken Page skall visas Dim picnr if (Request.QueryString("picnr")<>"") then picnr = int(Request.QueryString("picnr")) else picnr = 1 end if 'Creater navigerare Dim galleryCount galleryCount = getGalleryCount() if ( picnr > piconpage) then Response.Write "<< First    " Response.Write "< Previous" else Response.Write "First   " Response.Write "Previous" end if if (galleryCount>0) then Response.Write "   (Page: " & int(picnr / piconpage + 1) & " / " & int((galleryCount-1) / piconpage + 1) & ")   " else Response.Write "   (Page: 1 / 1)   " end if if ( int(picnr / piconpage + 1) < int((galleryCount-1) / piconpage + 1)) then Response.Write "Next >   " Response.Write "Last >>" else Response.Write "Next" Response.Write "   Last" end if Response.Write "

" %> <%'Read gallery file and view pictures Set F = CreateObject("Scripting.FileSystemObject") text = "" if (F.FileExists(Server.MapPath(galleryfolder & glfile))) then Set T = F.OpenTextFile(Server.MapPath(galleryfolder & glfile)) Dim i, colcount i=1 colcount=1 Response.Write "" Do Until T.AtEndOfLine text = T.ReadLine if ((i >= picnr) and (i < (picnr + piconpage))) then Response.Write "" colcount = colcount + 1 if (colcount > colsonpage) then Response.Write "" colcount = 1 end if end if i = i + 1 Loop Response.Write "
" Response.write "
" Response.Write "" Response.Write "" Response.Write "" Response.Write "
" Response.Write "" & text & "

" Response.Write "
" T.Close end if 'If plain list without pictures else 'Read gallery file and print links Set F = CreateObject("Scripting.FileSystemObject") text = "" if (F.FileExists(Server.MapPath(galleryfolder & glfile))) then Response.Write "" Set T = F.OpenTextFile(Server.MapPath(galleryfolder & glfile)) Do Until T.AtEndOfLine text = T.ReadLine Response.Write "- " & text & "
" Loop Response.Write "" T.Close end if end if %>