<%
'################################################# ##################
'# Image Gallery v1.0
'#
'# This script will automatically create links for thumbs
'# and links to the full image. You just need to upload the
'# Full Image and the Thumbnail in the right directories.
'# All underscores ('_') in directories & FileNames will be
'# replaced by Spaces. The FileName will apear on top of the
'# page when you view the full Image.
'#
'# It will create a Previous & Next link to limit the amount
'# of thumbs showed on a page and also when you view a Full
'# Image. This way you don't need to return to the thumbs.
'#
'# Created by Sebastien Morel
'# Contact me on '
[email protected]' for bugs or comments
'################################################# ##################
%>
<!--#INCLUDE FILE="includes/inc_Common.asp" -->
<%
On Error Resume Next
StartPosition = Request("imgCount")
Folder = Request("Folder")
ImageFilePath = myFolder + "/" + Request("Folder")
indPicturesFolderSpaces = Replace(Folder,"_"," ")
counter = 0
lImgCounter = 0
%>
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" bgcolor="#DEBD94">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<tr>
<td align="left" width="20"><img src="images/td_top_left.gif" width="20" height="20" border="0"></td>
<td class="Header" align="center" width="*" background="images/td_top.gif">Galeria <%=folder%></td>
<td class="Header" align="center" width="*" background="images/td_top.gif"><A href="galeria-fotos.asp"><img src="images/nav-up.gif" width="16" height="16" border="0" alt="Mas Galerias"></a></td>
<td align="right" width="20"><img src="images/td_top_right.gif" width="20" height="20" border="0"></td>
</tr>
</table>
<table cellpadding="0" cellspacing="20" border="0" width="100%" background="images/td_centro.gif">
<tr>
<%
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath(ImageFilePath))
For Each objFile In objFolder.Files
strFileExtension = LCase(Mid(objFile.Name, InStrRev(objFile.Name, ".", -1, 1) + 1))
If strFileExtension = "gif" Or strFileExtension = "jpg" Then
If (CLng(counter) >= CLng(StartPosition)) and (Clng(counter) < (CLng(StartPosition) + Clng(ImageLimit))) then
lImgCounter = lImgCounter + 1
%>
<td align="center" bgcolor="#FFFFFF">
<a href="javascript
:abrir_img('popupfoto.asp?cod=<%= ImageFilePath & "/" & objFile.Name %>')">
<img src=<%= ImageFilePath & "/" & objFile.Name %> vspace="5" hspace="5" width="120" border="0" alt="<%= objFile.Name %>"></a>
</td>
<%
If (lImgCounter Mod Imagerow) = 0 Then Response.Write "<TR>"
end if
counter = counter + 1
End If
Next
ThumbNextLink = CLng(StartPosition) + Clng(lImgCounter)
ThumbPreviousLink = CLng(StartPosition) - Clng(ImageLimit)
%>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<tr>
<td class="middle" align="left" width="20"><img src="images/td_bot_left.gif" width="20" height="20" border="0"></td>
<% If (CLng(StartPosition) >= CLng(ImageLimit)) Then %>
<td class="middle" align="left" width="100" background="images/td_bot.gif">
<A href="foto.asp?Folder=<%= Folder %>&imgCount=<%= ThumbPreviousLink %>" class="links">Anterior</A>
</td>
<% End If %>
<td class="middle" align="center" width="*" background="images/td_bot.gif"> </td>
<% If (CLng(StartPosition)) < (CLng(counter) - (CLng(ImageLimit))) Then %>
<td class="middle" align="right" width="100" background="images/td_bot.gif">
<A href="foto.asp?Folder=<%= Folder %>&imgCount=<%= ThumbNextLink %>" class="links">Siguiente</A>
</td>
<% End If %>
<td class="middle" align="right" width="20"><img src="images/td_bot_right.gif" width="20" height="20" border="0"></td>
</tr>
</table>
</td>
</tr>
</table>
<!--#INCLUDE FILE="includes/inc_footer.asp" -->
<%
Set objFSO = Nothing
Set objFolder = Nothing
%>