iamxuan
08-21-2002, 04:05 PM
Hi, wonder if you can help me on this ASP script, what it does is that it generates the directory folders and then you can click them to open view images, im sure the pros must have heard of this simple image gallery before.
The problem is that the list of folders goes down one list and it is getting longer, I am wondering if it can have page 1 list, page 2 list and so on? Below is the script: Thanks!!
<%
'Check the global.asa contains the correct settings...
if Application("Gallery#rows")="" then
response.write "ASPGallery settings are not configured in the global.asa<br>"
response.write "Check the readme.txt file for help.<br>"
response.End
end if
'Start processing the gallery folder...
strGalleryPath=server.MapPath(Application("Gallery#Path"))
'Create the file system object
Set fso = CreateObject("Scripting.FileSystemObject")
'Check the gallery path exists
if fso.FolderExists(strGalleryPath) then
Set GalleryFolder = fso.GetFolder(strGalleryPath)
'If there are subfolders, show them in the browser...
if GalleryFolder.SubFolders.Count > 0 then
for each Folder in GalleryFolder.SubFolders
if left(Folder.name,4)<>"_vti" and Folder.attributes<>18 then
response.write "<a href='pics/viewer.asp?path=" & replace(Folder.Name," ","%20") & "'><img src='folderclosed.gif' align=absmiddle border=0> " & Folder.Name & "</a>"
'If the showFolderDetails settings is set, show folder size and creation date...
if Application("Gallery#showFolderDetails") then
response.write "<font size=1> " & formatdatetime(Folder.DateCreated,vbshortdate) & "</small></font><br>"
end if
response.write "" & vbcrlf
end if
next
else
response.write "No folders to work with.<br>"
end if
end if
set fso=nothing
%>
The problem is that the list of folders goes down one list and it is getting longer, I am wondering if it can have page 1 list, page 2 list and so on? Below is the script: Thanks!!
<%
'Check the global.asa contains the correct settings...
if Application("Gallery#rows")="" then
response.write "ASPGallery settings are not configured in the global.asa<br>"
response.write "Check the readme.txt file for help.<br>"
response.End
end if
'Start processing the gallery folder...
strGalleryPath=server.MapPath(Application("Gallery#Path"))
'Create the file system object
Set fso = CreateObject("Scripting.FileSystemObject")
'Check the gallery path exists
if fso.FolderExists(strGalleryPath) then
Set GalleryFolder = fso.GetFolder(strGalleryPath)
'If there are subfolders, show them in the browser...
if GalleryFolder.SubFolders.Count > 0 then
for each Folder in GalleryFolder.SubFolders
if left(Folder.name,4)<>"_vti" and Folder.attributes<>18 then
response.write "<a href='pics/viewer.asp?path=" & replace(Folder.Name," ","%20") & "'><img src='folderclosed.gif' align=absmiddle border=0> " & Folder.Name & "</a>"
'If the showFolderDetails settings is set, show folder size and creation date...
if Application("Gallery#showFolderDetails") then
response.write "<font size=1> " & formatdatetime(Folder.DateCreated,vbshortdate) & "</small></font><br>"
end if
response.write "" & vbcrlf
end if
next
else
response.write "No folders to work with.<br>"
end if
end if
set fso=nothing
%>