mappe listning isteder for drop down menu

Tags:    asp

hey lige et spørgsmål, er ikke den største haj til asp.. men jeg har fundet et galleri på nettet og der er en dropdown menu som der viser hvilke mapper der ligger i det angivet directory..
jeg kunne godt tænke mig at mapperne istedet for at være i en drop down menu bare blev listet under hinanden nogle der kan hjælpe mig til hvad jeg skal ændre på og hvilke ændringer jeg skal lave

kode:

<% Response.Buffer = True %><html>

<head>
<script language="JavaScript">
<!--
function jumppage(sel)
{
var i = sel.selectedIndex
self.location.href = sel.options.value
}
// -->
</script>
</head>

<body>

<b><font size="4"> Billed-galleri:</font></b><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="789" id="galleri" height="1">
<tr>
<td align="center" width="39%" height="1" rowspan="2">
</td>
<td align="center" width="49%" height="1">
<form action=<%=CurFile%> method="POST">
<p align="right">
<b><font size="2">Vælg album</font></b>  </p>
</form>
</td>
<td align="center" width="12%" height="1">
<p align="left"> <select name="go" onChange="jumppage(this);" size=1>
<%
ShowSub = request("ShowSub")
ShowPic = request("ShowPic")
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
For each Folder in objFolder.SubFolders
If Left(Folder.Name,1)<>"_" Then
Response.write "<option "
If ShowSub=Folder.Name Then
Response.Write "selected "
End if
Response.Write"value='" & CurFile & "?ShowSub="
Response.Write(Replace(Folder.Name, " ", "%20"))
response.write "'>"
Response.Write(Folder.Name & "</option>")
If ShowSub <= " " Then
ShowSub = Folder.Name
End if
End if
Next
Set objFSO = Nothing
%>
</select></td>
</tr>
<tr>
<td align="center" width="49%" height="1">
</td>
<td align="center" width="12%" height="1">
</td>
</tr>
</table>

<%
If ShowPic > " " then
ShowPic = Replace(ShowPic, " ", "%20")
Response.Write "<a href='JavaScript:history.go(-1)'><img border=1 src='" & ShowPic & "'><BR><BR><B><font size='2'>Tilbage til sidste side</font></B></a>"
Else
%>
<table border="0" cellpadding="0" cellspacing="5" style="border-collapse: collapse" bordercolor="#000000" width="789" id="Pics1">
<tr>
<%
strPhysicalPath = Server.MapPath(".\\" & ShowSub)
If ShowSub > " " then
ShowSub = Replace(ShowSub, " ", "%20")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPhysicalPath)
Set objFolderContents = objFolder.Files
For Each objFileItem in objFolderContents
If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" OR Ucase(Right(objFileItem.Name,4))=".BMP" THEN
ShowPic = Replace(objFileItem.Name, " ", "%20")
'Response.write "<td align='center' width='25%'><a href=" & ShowSub & "\\"
Response.write "<td align='center' width='25%'><a href=" & CurFile & "?ShowPic=" & ShowSub & "\\" & ShowPic
'Response.Write(Replace(objFileItem.Name, " ", "%20"))
Response.write ">"
Response.Write("<img border=1 src='" & ShowSub & "\\" & objFileItem.Name & "' width=100>")
Response.Write("<p align='center'><b>" & Mid(objFileItem.Name,1,Len(objFileItem.Name)-4) & "</b>")
Response.write "</a></td>"
PictureNo = PictureNo + 1
If PictureNo=4 Then
Response.write "</tr><tr>"
PictureNo = 0
End if
End if
Next
Set objFSO = Nothing
End if
%>
</tr>
</table>
<%
End if
%>

</body>
</html>


/jesper




1 svar postet i denne tråd vises herunder
1 indlæg har modtaget i alt 5 karma
Sorter efter stemmer Sorter efter dato
Jeg har ikke testet det, men dette burde virke:

Fold kodeboks ind/udKode 




t