Albummet kigger i sin egen mappe og ser efter om der er nogle undermapper, og lister billederne fra disse mapper..
man kan så lægge flere billeder og albums op ved at ftp'e en mappe med billeder til mappen på serveren.
Der bliver ikke brugt nogen database, til at gemme informationer i.
Her er lige asp koden jeg har hentet....... Hvis det kan hjælpe..
Jeg kan nemlig ikke lige helt finde ud af hvad jeg skal sætte ind for at den kan vise alle billederne automatisk
----------------
<%@ Language=VBScript %>
<% Option Explicit
Response.Buffer = True
%>
<!-- Begin HTML header -->
<html>
<head>
<title>Photos demo</title>
<meta name="Generator" content="Stone's WebWriter 4">
</head>
<body>
<!-- End HTML Header -->
<%
'#################################################################################
'#
'# USAGE:
'#
'# FREE OF CHARGE!
'#
'# OK, I wrote this from scratch, but I'd be proud if anyone thought it useful
'# enough to use. It is designed so that the relatively untutored can maintain
'# their on-line photo album with nothing more than a basic image editing package,
'# e.g. PaintShop Pro (
www.jasc.com) or Microsoft Photo Editor (Part of Office),
'# and an FTP client such as CuteFTP or FTPExplorer. You should be able to avoid
'# ever having to edit the code.
'# All I ask is that: 1. the following lines remain:
%>
<!-- Self administering on-line photo album written in ASP/VBScript by -->
<!-- Stuart Irving - stu.i@btinternet.com -->
<%
'# I would also appreciate a brief email, if you take it live, letting me know
'# the URL.
'#################################################################################
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'
' INSTALLATION:
'
' 1. Create a folder anywhere on the site (eg
www.site.com/photos/)
' 2. Insert the necessary HTML headers and footers
' 3. Put this file in the folder created in step 1.
' 4. For each set of pictures to publish create a subfolder
' (e.g.
www.site.com/photos/sept/ and
www.site.com/photos/oct/)
' 5. If captions are used, rename the image files so that the filename is
' the caption (problem: only certain punctuation marks can be used,
' apostrophes will break it every time
' 6. Load the image files into their respective photos/folders
' 7. Open photos.asp in a browser
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Declaration of variables and constants
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim i ' Counter
Dim tot ' Number of piccies
Dim pic ' Current picture
Dim dir ' Current folder
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 = "yes"
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Store QueryStrings as variables (out of habit)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Get querystring for pic number as sub-type integer
pic = Cint(Request.QueryString("pic"))
'Get name of folder containing current album
dir = Request.QueryString("dir")
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Create FileSystemObjects
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set MyDirectory=Server.CreateObject("Scripting.FileSystemObject")
' MyFolders is contents of folder containing photos.asp
Set MyFolders=MyDirectory.GetFolder(Server.MapPath("./"))
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' If there is no current album set it to the first one found
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For Each folderFound In MyFolders.subfolders
If dir = "" Then
dir = folderFound.Name
End If
Next
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Get contents of current album
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set MyFiles=MyDirectory.GetFolder(Server.MapPath(dir))
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Count the photos
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tot = -1
For Each filefound in MyFiles.files
tot = tot + 1
Next
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Decide if target photo is outside the range and reset variable pic accordingly
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If pic > tot Then
pic = 0
ElseIf pic < 0 Then
pic = tot
End If
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' If there is no current photo set current photo to the first one found
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If Request.QueryString("pic") = "" Then
pic = 0
End If
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Output some basic page layout - change this to suit the desired appearance
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Response.Write("<table border=0 cellpadding=5 width=500>" & vbCrLf)
Response.Write("<tr><td bgcolor=lightgrey align=center valign=middle height=500>" & vbCrLf)
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Flick through current album until we get to the target photo (pic)
' Output the image path and filename with Server.URLPathEncode so that people who
' insist on clinging to that pathetic software they call Netscape, can see it.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
i = 0
For Each filefound In MyFiles.files
If pic = i Then
' Write out the image tag
Response.Write ("<img alt='" & filefound.Name & "' src='" & Server.URLPathEncode(dir) & "/" & Server.URLPathEncode(fileFound.Name) & "'><br>" & vbCrLf)
' Use File title as caption
Response.Write("<p> ")
' Decide if captions are required (globally or individually)
If captions = "yes" And Left(filefound.Name,1) <> "_" Then
' Write out filename as caption, but lop off the letters after the period
Response.Write(Left(filefound.Name,(Len(filefound.name)-3)))
End If
Response.Write(" </p>" & vbCrLf)
End If
i = i + 1
Next
' Now i is the total number of objects in the folder
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' More layout
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Response.Write("</td></tr>" & vbCrLf)
Response.Write("<tr><td align=center valign=middle>")
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Write out previous and next photo links as text links but images could easily be used
' Be careful with form buttons...! (Netscape again)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Response.Write("<a href='photos.asp?")
Response.Write("dir=" & Server.URLEncode(dir) & "&pic=" & pic-1 & "'><= prev</a> <a href='photos.asp?")
Response.Write("dir=" & Server.URLEncode(dir) & "&pic=" & pic+1 & "'>next =></a><br>" & vbCrLf & vbCrLf)
Response.Write("</td></tr>" & vbCrLf & "<tr><td align=center>")
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Write out menu of available albums as links to the photos in that folder
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Response.Write(" Choose Album: ")
For Each folderFound In MyFolders.SubFolders
' Ignore any FrontPage Server Extension folders
If Left(folderFound.Name,1) <> "_" Then
Response.Write("<a href=photos.asp?dir=" & Server.URLEncode(folderFound.Name) & ">" & folderFound.Name &"</a> ")
End If
Next
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Finish the layout
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Response.Write(vbCrLf & "</td></tr>" & vbCrLf & "</table>")
'
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Get rid of the objects
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set MyDirectory = Nothing
Set MyFiles = Nothing
Set MyFolders = Nothing
%>
<!-- Begin HTML footer -->
</body>
</html>
<!-- End HTML Footer -->
<table border="0" cellspacing="0" cellpadding="3" style="font-family:'tahoma', 'arial', 'times New Roman';font-size:11;">
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>Billederne kan bestilles Online her på siden.</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td> </td>
<td></td>
</tr>
<tr>
<td>Priser:</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr style="background-color:#EAEAEA;">
<td>udprintet på fotopapir</td>
<td>kr. 8.-</td>
</tr>
<tr>
<td>Digitalt på email eller CR-Rom</td>
<td>kr. 5.-</td>
</tr>
<tr style="background-color:#EAEAEA;">
<td>Ved CD-Rom yderligere pr. CD</td>
<td>kr. 10.-</td>
</tr>
<tr>
<td> </td>
<td></td>
</tr>
<tr>
<td>Billeder printes på fotopapir i størrelsen 10x15</td>
<td></td>
</tr>
<tr>
<td>Digitale billeder ca. 1 Mb pr. stk.</td>
<td></td>
</tr>
<tr>
<td> </td>
<td></td>
</tr><tr>
<td> </td>
<td></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="3" style="font-family:'tahoma', 'arial', 'times New Roman';font-size:11;">
</tr><tr>
<td colspan="2"><hr></td>
<td></td>
</tr>
</tr><tr>
<td valign="top" align="center" colspan="2" style="font-weight:bold;">Online Bestilling</td>
<td></td>
</tr>
</tr><tr>
<td colspan="2"><hr></td>
<td></td>
</tr>
<tr>
<td valign="top" align="right">Dit Navn:</td>
<td><input type="text" value="" size="100" name="Navn" style="font-family:'tahoma', 'arial', 'times New Roman';font-size:11;width:300px;"></td>
</tr>
<tr>
<td valign="top" align="right">Din E-mail:</td>
<td><input type="text" value="" size="100" name="Navn" style="font-family:'tahoma', 'arial', 'times New Roman';font-size:11;width:300px;"></td>
</tr>
<tr>
<td> </td>
<td></td>
</tr>
<tr>
<td colspan="2">Billeder på print og CD-Rom leveres på dit vandglad.dk hold</td>
<td></td>
</tr>
<tr>
<td valign="top" align="right">Hold navn<br>og tidspunkt:</td>
<td><input type="text" value="" size="100" name="Hold" style="font-family:'tahoma', 'arial', 'times New Roman';font-size:11;width:300px;"><br></td>
</tr>
<tr>
<td valign="top" align="right">Billeder:</td>
<td><textarea wrap="physical" rows="10" name="Billeder" style="font-family:'tahoma', 'arial', 'times New Roman';font-size:11;width:300px;">Skriv navnet på billeder her, Hvis du bestiller flere billeder så sæt komma imellem</textarea><br></td>
</tr>
<tr>
<td valign="top" align="right">Type</td>
<td><select name="type" style="font-family:'tahoma', 'arial', 'times New Roman';font-size:11;width:300px;">
<option>-- Vælg medie ---</option>
<option>Print på fotopapir</option>
<option>Digital på E-mail</option>
<option>Digital på CD-Rom</option>
</select></td>
</tr>
<tr>
<td> </td>
<td></td>
</tr>
<tr>
<td colspan="2">Nedenstående udfyldes kun ved bestilling af billeder på print.<br>Det angiver hvor mange kopier af hvert bestilt billede der skal udskrives</td>
<td></td>
</tr>
<tr>
<td valign="top" align="right">Antal</td>
<td><input type="text" name="Antal" style="font-family:'tahoma', 'arial', 'times New Roman';font-size:11;width:300px;"></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td> </td>
<td></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="submit" value="Send Bestilling" style="font-family:'tahoma', 'arial', 'times New Roman';font-size:11;width:100px;"></td>
<td></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="reset" value="Nulstil Formular" style="font-family:'tahoma', 'arial', 'times New Roman';font-size:11;width:100px;"></td>
<td></td>
</tr>
</table>