/ Forside/ Teknologi / Udvikling / ASP / Spørgsmål
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
liste mapper isteder for en dr
Fra : hubi
Vist : 704 gange
200 point
Dato : 12-03-07 21:28

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[i].value
}
// -->
</script>
</head>

<body>

<b><font size="4">&nbsp;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>&nbsp; </p>
</form>
</td>
<td align="center" width="12%" height="1">
<p align="left">&nbsp;<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>

 
 
Kommentar
Fra : smorch


Dato : 13-03-07 00:21

Prøv nedenstående, men H U S K at skifte SIDESNAVN.ASP ud med dét din side hedder!!

Mvh

sMorch


;<select name="go" onChange="jumppage(this);" size=1>
<%
ShowSub = request("ShowSub")
<body>

<b><font size="4">&nbsp;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>&nbsp; </p>
</form>
</td>
<td align="center" width="12%" height="1">
<p align="left">&nbsp;<select name="go" onChange="jumppage(this);" size=1>
<%
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 "<a href='SIDENSNAVN.ASP?"
   
   Response.Write"ShowSub="

   Response.Write(Replace(Folder.Name, " ", "%20"))

   response.write "'>"

   If ShowSub=Folder.Name Then    
      Response.Write "<b>"
   End if

   Response.Write(Folder.Name)

   If ShowSub=Folder.Name Then    
      Response.Write "</b>"
   End if
   Response.Write("</a><br>")

   If ShowSub <= " " Then

      ShowSub = Folder.Name

   End if

End if
Next
Set objFSO = Nothing
%>
></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>

Kommentar
Fra : smorch


Dato : 13-03-07 00:23

Ups - der røg en linie for meget med i toppen:

;<select name="go" onChange="jumppage(this);" size=1>


Slet den

Accepteret svar
Fra : smorch

Modtaget 200 point
Dato : 13-03-07 00:38

Ok - klokken er l... i mit univers og jeg har arbejdet siden kl. kvart i kvalme i morges - dén her virker:


Kode
<% @language = "VBscript" %>
<%
ShowSub = request("ShowSub")
%>
<body>

<b><font size="4">&nbsp;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>&nbsp; </p>
</form>
</td>
<td align="center" width="12%" height="1">
<p align="left">&nbsp;
<%
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 "<a href='mapper.ASP?"
   
   Response.Write"ShowSub="

   Response.Write(Replace(Folder.Name, " ", "%20") & "'>")

   If ShowSub=Folder.Name Then    
      Response.Write "<b>"
   End if

   Response.Write(Folder.Name)

   If ShowSub=Folder.Name Then    
      Response.Write "</b>"
   End if
   Response.Write("</a><br>")

   If ShowSub <= " " Then

      ShowSub = Folder.Name

   End if

End if
Next
Set objFSO = Nothing
%>
</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 forrige 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>


mvh

sMorch

Kommentar
Fra : mikmeier48


Dato : 13-03-07 07:51

Hvor har du fundet det galleri?

Godkendelse af svar
Fra : hubi


Dato : 13-03-07 14:34

Tak for svaret smorch. var lige hvad jeg skulle bruge..

Kommentar
Fra : hubi


Dato : 13-03-07 14:37

mikmeier48 kan faktisk ikke huske det.. har brugt nogle dage på at finde et galleri så jeg har været på mange forskellige sider. men script.dk og hotscripts.com og planetsourcecode.com har jeg bl.a brugt.... sørg for at kigge under partnere på diverse kodesider der nogle gange sider der ikke bliver fundet ved en googlesøgning

Du har følgende muligheder
Eftersom du ikke er logget ind i systemet, kan du ikke skrive et indlæg til dette spørgsmål.

Hvis du ikke allerede er registreret, kan du gratis blive medlem, ved at trykke på "Bliv medlem" ude i menuen.
Søg
Reklame
Statistik
Spørgsmål : 177577
Tips : 31968
Nyheder : 719565
Indlæg : 6409071
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste