madHatter1
Technical User
Hello
Several weeks ago a kind member here offered the public some ASP script on how to contruct a photo gallery. I have been unable to contact him since, so I expect he has found pastures new.
Anyway, I am hoping to develop this script. Basically, it is a photo gallery with the following:
Image 2 of 4
PHOTO
Previous | Next
the Image 2 of 4 is not a link, but it does move with the sequence of photos.
On the other hand, Previous | Next is a link, enabling the visitor to move back or forward to the next image.
What I wish to o is to move the Previous | Next ABOVE the image and, most importantly, to have the text associated with the image, for instance, BELOW it and which would also be a hyperlink for the visitor to click on.
Photo 2 would have a different link, for example, underneath it....and so on, so that as the visitor clicks on Previos | Next the photo displays its related text (as a Web address).
What I am asking here is this: am I right in thinking that this could be done as:
If photo1= photo 1
then photo 1 =
or
if photo2 = photo2
then photo2 =
etc
end if
I would be grateful for any advice here.
Here is the original script:
<%Option Explicit%>
<%Response.Buffer = "True"%>
<HTML>
<HEAD>
<BODY>
<%
Dim objFSO
Dim objFolder
Dim objFile
Dim Path
Dim Series
Dim ImageCount
Dim ImageNumber
Dim NextImage
Dim PreviousImage
Dim FileExtention
Dim ErrorPage
ImageCount = 0
Set Path = Request.QueryString("Path"
Set Series = Request.QueryString("Series"
If Path = "" OR Series = "" Then
Response.Redirect(ErrorPage)
End If
If ImageCount = 0 Then
Set objFSO = CreateObject("Scripting.FileSystemObject"
Set objFolder = objFSO.GetFolder(Server.MapPath(Path & "/" & Series))
For Each objFile In objFolder.Files
FileExtention = LCase(Right((objFile.Name), 4))
If FileExtention = ".jpg" Then
ImageCount = Cint(ImageCount) + 1
End If
Next
Set objFSO = Nothing
Set objFolder = Nothing
Set objFile = Nothing
End If
ImageNumber = Cint(Request.QueryString("ImageNumber"
)
If ImageNumber < 1 Then
ImageNumber = 1
ElseIf ImageNumber > ImageCount Then
ImageNumber = ImageCount
End If
'This function generates the "previous" & "next" buttons
Function Buttons(ImageCount, ImageNumber)
If ImageNumber = 1 Then
NextImage = "<A HREF=""gallery1.asp?Path=" & Path & "&Series=" & Series & "&ImageNumber=" & (ImageNumber + 1) & """>next</A>"
PreviousImage = "previous"
ElseIf ImageNumber > 1 AND ImageNumber < ImageCount Then
NextImage = "<A HREF=""gallery1.asp?Path=" & Path & "&Series=" & Series & "&ImageNumber=" & (ImageNumber + 1) & """>next</A>"
PreviousImage = "<A HREF=""gallery1.asp?Path=" & Path & "&Series=" & Series & "&ImageNumber=" & (ImageNumber - 1) & """>previous</A>"
Else
NextImage = "next"
PreviousImage = "<A HREF=""gallery1.asp?Path=" & Path & "&Series=" & Series & "&ImageNumber=" & (ImageNumber - 1) & """>previous</A>"
End If
Buttons = PreviousImage & " | " & NextImage
End Function
%>
<TABLE WIDTH="300">
<TR>
<TD WIDTH="300" ALIGN="Right">
<%
'Displays the current image number, and total number of images
Response.Write("<H1>Image " & ImageNumber & " of " & ImageCount & "</H1><BR>"
%>
</TD>
</TR>
<TR>
<TD WIDTH="300" ALIGN="Right">
<%
'Displays the current image.
Response.Write("<IMG SRC=""" & Path & "/" & Series & "/" & Series & "_" & ImageNumber & ".jpg" & """>"
%>
</TD>
</TR>
<TR>
<TD WIDTH="300" ALIGN="Right">
<%=Buttons(ImageCount, ImageNumber)%>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Many thanks again - I know this is a tall order!
Hatter
Several weeks ago a kind member here offered the public some ASP script on how to contruct a photo gallery. I have been unable to contact him since, so I expect he has found pastures new.
Anyway, I am hoping to develop this script. Basically, it is a photo gallery with the following:
Image 2 of 4
PHOTO
Previous | Next
the Image 2 of 4 is not a link, but it does move with the sequence of photos.
On the other hand, Previous | Next is a link, enabling the visitor to move back or forward to the next image.
What I wish to o is to move the Previous | Next ABOVE the image and, most importantly, to have the text associated with the image, for instance, BELOW it and which would also be a hyperlink for the visitor to click on.
Photo 2 would have a different link, for example, underneath it....and so on, so that as the visitor clicks on Previos | Next the photo displays its related text (as a Web address).
What I am asking here is this: am I right in thinking that this could be done as:
If photo1= photo 1
then photo 1 =
or
if photo2 = photo2
then photo2 =
etc
end if
I would be grateful for any advice here.
Here is the original script:
<%Option Explicit%>
<%Response.Buffer = "True"%>
<HTML>
<HEAD>
<BODY>
<%
Dim objFSO
Dim objFolder
Dim objFile
Dim Path
Dim Series
Dim ImageCount
Dim ImageNumber
Dim NextImage
Dim PreviousImage
Dim FileExtention
Dim ErrorPage
ImageCount = 0
Set Path = Request.QueryString("Path"
Set Series = Request.QueryString("Series"
If Path = "" OR Series = "" Then
Response.Redirect(ErrorPage)
End If
If ImageCount = 0 Then
Set objFSO = CreateObject("Scripting.FileSystemObject"
Set objFolder = objFSO.GetFolder(Server.MapPath(Path & "/" & Series))
For Each objFile In objFolder.Files
FileExtention = LCase(Right((objFile.Name), 4))
If FileExtention = ".jpg" Then
ImageCount = Cint(ImageCount) + 1
End If
Next
Set objFSO = Nothing
Set objFolder = Nothing
Set objFile = Nothing
End If
ImageNumber = Cint(Request.QueryString("ImageNumber"
If ImageNumber < 1 Then
ImageNumber = 1
ElseIf ImageNumber > ImageCount Then
ImageNumber = ImageCount
End If
'This function generates the "previous" & "next" buttons
Function Buttons(ImageCount, ImageNumber)
If ImageNumber = 1 Then
NextImage = "<A HREF=""gallery1.asp?Path=" & Path & "&Series=" & Series & "&ImageNumber=" & (ImageNumber + 1) & """>next</A>"
PreviousImage = "previous"
ElseIf ImageNumber > 1 AND ImageNumber < ImageCount Then
NextImage = "<A HREF=""gallery1.asp?Path=" & Path & "&Series=" & Series & "&ImageNumber=" & (ImageNumber + 1) & """>next</A>"
PreviousImage = "<A HREF=""gallery1.asp?Path=" & Path & "&Series=" & Series & "&ImageNumber=" & (ImageNumber - 1) & """>previous</A>"
Else
NextImage = "next"
PreviousImage = "<A HREF=""gallery1.asp?Path=" & Path & "&Series=" & Series & "&ImageNumber=" & (ImageNumber - 1) & """>previous</A>"
End If
Buttons = PreviousImage & " | " & NextImage
End Function
%>
<TABLE WIDTH="300">
<TR>
<TD WIDTH="300" ALIGN="Right">
<%
'Displays the current image number, and total number of images
Response.Write("<H1>Image " & ImageNumber & " of " & ImageCount & "</H1><BR>"
%>
</TD>
</TR>
<TR>
<TD WIDTH="300" ALIGN="Right">
<%
'Displays the current image.
Response.Write("<IMG SRC=""" & Path & "/" & Series & "/" & Series & "_" & ImageNumber & ".jpg" & """>"
%>
</TD>
</TR>
<TR>
<TD WIDTH="300" ALIGN="Right">
<%=Buttons(ImageCount, ImageNumber)%>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Many thanks again - I know this is a tall order!
Hatter