The Red Lion Restaurant Welcome to the Red Lion
The Red Lion Restaurant
Home2
Dinner menu
Weddings
Large 50-225 Guests
Intimate, Destination & Elopment's
Ceremonies Only
Photo gallery
Group Information
Holidays
 
Contact us
     
<% '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Declaration of variables and constants '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Dim ind, photo Dim MyDirectory ' Path to folder containing photos.asp 'Dim MyFolders ' List of subfolders (albums) Dim MyFiles ' List of files in an album Dim folderFound ' individual subfolder Dim fileFound ' individual photo ' Turn off captions globally by changing the value of captions to "no" ' Turn off captions individually by naming the file with an initial undescore (_) Const captions = "no" ' '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Store QueryStrings as variables (out of habit) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'Get querystring for photo number as sub-type integer photo = Cint(Request.QueryString("photo")) 'Get name of folder containing current album 'weddinggallery = Request.QueryString("weddinggallery") ' ' Create FileSystemObjects Set MyDirectory=Server.CreateObject("Scripting.FileSystemObject") ' MyFolders is contents of folder containing photos.asp 'Set MyFolders=MyDirectory.GetFolder(Server.MapPath("./")) ' get file list from chosen gallery and see how many there are Set MyFiles=MyDirectory.GetFolder(Server.MapPath("./weddinggallery")) ind = MyFiles.files.count ' make sure photo index is in range, wrap if necessary If Request.QueryString("photo") = "" Then photo = 1 ElseIf photo > ind Then photo = 1 ElseIf photo < 1 Then photo = ind End If Response.Write("" & vbCrLf) Response.Write("" & vbCrLf & "
" & vbCrLf) Response.Write("

Wedding Photo Gallery

") ' Search this gallery until until find target photo ind = 1 For Each filefound In MyFiles.files If photo = ind Then ' display previous/next links Response.Write("<-- previous photo  |  ") Response.Write((ind) & " of " & MyFiles.files.count & "  |  ") Response.Write("next photo -->

" & vbCrLf) ' show image and skip the rest of the loop Response.Write ("" & filefound.Name & "
" & vbCrLf) Exit For End If ind = ind + 1 Next Response.Write("
") ' direct links for ind = 1 to MyFiles.files.count if ind <> photo then Response.Write(" " & ind & " ") else Response.Write(" " & ind & " ") end if if (ind mod 15) = 0 then response.write("
" & vbCrLf) next Response.Write(vbCrLf & "
" & vbCrLf) ' clean up Set MyDirectory = Nothing Set MyFiles = Nothing Set MyFolders = Nothing %>