Her er en lille ASP ting, som finder ALLE JPG og GIF filer i en mappes
undermapper !!!
Du ligger altså dette scrips i Roden, og opretter så et bibliotek for hver
billed-gruppe, og placerer dine billeder her !!!
Neuhafen
<%
Dim CurFile, ShowSub, ShowPic, PictureNo
Dim strPathInfo, strPhysicalPath,teller,ts,fs,s
CurFile = "Default.asp"
%>
<html>
<head>
<title>Vis Billed Bog</title>
<script language="JavaScript">
<!--
function jumppage(sel)
{
var i = sel.selectedIndex
self.location.href = sel.options[i].value
}
// -->
</script>
</head>
<body bgcolor="#000000" text="#C0C0C0" link="#00FF00" vlink="#00FF00"
alink="#00FF00">
<div align="center"><center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:
collapse"
bordercolor="#111111" width="800" id="AutoNumber1">
<tr>
<td align="center" width="25%"><form action="<%=CurFile%>"
method="POST">
<div align="left"><h3>Select Album : <select name="go"
onChange="jumppage(this);" size="1">
<%
ShowSub = request("ShowSub")
ShowPic = request("ShowPic")
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></h3>
</div>
</form>
</td>
</tr>
</table>
</center></div>
<hr align="center">
<%
If ShowPic > " " then
ShowPic = Replace(ShowPic, " ", "%20")
Response.Write "<a href='JavaScript:history.go(-1)'> <center><img src='"
& ShowPic & "'></center><BR><BR><B>Go Back</B></a>"
Else
s=1
FS=1
TS=1
s=trim(Request.QueryString("S"))
FS=trim(Request.QueryString("Fra"))
TS=trim(Request.QueryString("Til"))
if s="" then s=1
if FS="" then FS=1
if TS="" then TS=1
%>
<div align="center">
<p>Aktiv SIDE [<%=S%>]<%
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
%> </p>
<p align="center"><%
AntalPrSide=8
Antal=1
Antal=objFolderContents.count
''''
if ts=1 and Antal>= AntalPrSide then TS= AntalPrSide
sider=int(antal/AntalPrSide)+1
Fra=1
Til =1
if antal < AntalPrSide and antal>0 then ts = antal
Teller=1
for t=1 to sider
fra=(t*AntalPrSide)-(AntalPrSide)
if fra=0 then fra =1
til=(t*AntalPrSide)-1
if til>antal then til=antal
%>
<a
href="Default.asp?S=<%=t%>&Fra=<%=Fra%>&Til=<%=Til%>&ShowSub=<%=showsub%>">[<%=t%>]</a>
<%
next
%></p>
<div align="center"><center>
<table border="0" cellpadding="0" cellspacing="5" style="border-collapse:
collapse"
bordercolor="#111111" width="800" id="AutoNumber1">
<tr>
<%
For Each objFileItem in objFolderContents
'response.write "<TR>" & teller & "-" & fs & "-" & Ts & " </TR>"
'if (teller) > abs(fs) then response.write teller & " Større " & fs
'if (teller) < abs(fs) then response.write teller & " mindre " & fs
if (teller) >= abs(fs) and (Teller)<= abs(ts) then
'response.write teller & " </TR>"
If Ucase(Right(objFileItem.Name,4))=".GIF" OR
Ucase(Right(objFileItem.Name,4))=".JPG" 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 src='" & ShowSub & "\" & objFileItem.Name & "'> ")
'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
end if 'teller
teller=teller+1
Next
Set objFSO = Nothing
End if
%>
</tr>
</table>
</center></div></div><%
End if
%>
<p> </p>
<p align="center"> </p>
</body>
</html>
"Jeppe Christensen" <mr.puity@gmail.com> skrev i en meddelelse
news:421df401$0$29272$14726298@news.sunsite.dk...
> Leder efter et script der automatisk kan sætte alle billeder i en
> mappe ind på siden. Den må gerne sætte det en i tabeller så det
> kommer til at passe ind i mit design....^^
>
> --
> Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
> - Pædagogiske tutorials på dansk
> - Kom godt i gang med koderne
> KLIK HER! =>
http://www.html.dk/tutorials