Redigere galleri script til også at vise foldere
Jeg har fundet nedenståeden script andetsteds her på siden.Det viser fint billeder i samme mappe som selve asp filen her ligger i. Men kan det ikke tilrettes nemt så det også kan vise foldere? Så man kan sortere billeder i mapper og så klikke på hver mappe og se billeder?
<head>
<title></title>
</head>
<body bgcolor="#C0C0C0">
<h3 align="center">Galleri 1.0</h3>
<hr>
<%
'------------------------------------------------
'henter info om siden
'------------------------------------------------
page = trim(Request.QueryString("page"))
start = trim(Request.QueryString("start"))
'------------------------------------------------
'Åbner Filsystem
'------------------------------------------------
strPathInfo = Request.ServerVariables("PATH_INFO")
strPhysicalPath = Server.MapPath(strPathInfo)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strPhysicalPath)
Set objFolder = objFile.ParentFolder
Set objFolderContents = objFolder.Files
'------------------------------------------------
'grund variabler
'------------------------------------------------
row_count = 0
row = 1
max_row = 3
count = 1
If NOT start <> "" then
Start = 1
End If
%>
<p align=center>
<%
'------------------------------------------------
'Info variabler
'------------------------------------------------
info_page = 0
info_page_count = 0
info_Count = 0
'------------------------------------------------
'Info Script, udregner og udskriver info til siden
'------------------------------------------------
If page <> "" then
response.write "side <a href='index.asp'>1</a> "
else
Response.write "side 1 "
End If
For Each objFileItem in objFolderContents
info_Count = info_Count + 1
info_page = info_page + 1
if info_page = 9 then
info_page_count = info_page_count + 1
info_page = 0
End If
If info_page = 0 then
If trim(info_page_count + 1) = trim(page) then
response.write info_page_count + 1 & " "
Else
response.write "<a href='index.asp?start=" & info_count & "&page=" & info_page_count + 1 & "'>" & info_page_count + 1 & "<a> "
End If
End If
Next
Response.write "<br>Der er ialt <b>" & (info_Count) & "</b> billeder"
if (info_page_count) * 9 = info_count then
Response.write " på <b>" & (info_page_count) & "</b> sider<br>"
Else
Response.write " på <b>" & (info_page_count) + 1 & "</b> sider<br>"
End If
%>
<div align="center">
<table border="0" cellspacing="3" cellpadding="3">
<tr>
<%
For Each objFileItem in objFolderContents
If objFileItem.Name = "index.asp" then
Else
If CLng(count) < CLng(start) then
count = count + 1
Else
If CLng(row) => CLng(max_row) And row_count = 3 then
Else
If row_count > 2 then
response.write "<tr>"
row_count = 0
row = row + 1
End If
Response.write " <td><a href='"
Response.Write(objFileItem.Name)
Response.write "'><img border=0 src='" & (objFileItem.Name) & "' alt='" & (objFileItem.Name) & "' width=239 height=180></a>"
row_count = row_count + 1
count = count + 1
End If
End If
End If
Next
%>
</td>
</tr>
</table>