Har prøvet at rodde lidt videre med det og jeg er kommet frem til dette:
http://sloejfeloebet.dk/test.aspProblemet er bare at den tager alle filer to gange, og jeg ved simpelthen ikke hvorfor. Koden er således:
<%
Dim objFSO, objFolder, Path, subPath, antalFiler
antalFiler = 0
subPath = "images/Tour de Bornholm 2008"
Path = Server.MapPath("/"&subPath)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Path)
For Each file in objFolder.Files
antalFiler = antalFiler + 1
Next
show=request.querystring("show")
billedeSti = "images/Tour de Bornholm 2008"
antalBillederPrSide = 1
antalBillederPrRekke = 1
if Request.QueryString("billede") = "" then
start = request.querystring("pic")
if start = "" then start = 0
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(server.mappath(billedeSti))
Set fc = f.Files
For Each billed in fc
if inStr(1,"gif,jpg,jpeg,bmp",LCase(fs.GetExtensionName(billed.name))) > 0 then
arrayBuild = arrayBuild & billed.name & "|"
end if
next
if arrayBuild <> "" then arrayBuild = left(arrayBuild, (len(arrayBuild) - 1))
myArray = Split(arrayBuild, "|")
Antalsider = int(ubound(myarray) / antalBillederPrSide)
antal = 0
for i = start to (start + antalBillederPrSide-1)
if not i > ubound(myarray) then
if antal = 0 then Response.Write "<TR>"
%>
<td ><p align="center">
<a href="?billede=<%=billedeSti%>/<%=myArray(i)%>">
<img SRC="<%=billedeSti%>/<%=myArray(i)%>" border="0" color="black" height="275">
</a></td>
<%
else
nesteside = 1
end if
antal = antal + 1
if antal = antalBillederPrRekke then
Response.Write "</TR>"
antal = 0
end if
next
if antal > 0 then Response.Write "</TR>"
%>
</table>
<center>
<%
if start <> 0 then
response.write "<a href=""?pic=" & (start - antalBillederPrSide) & "&show=" & show & """>Forrige</a>"
end if
response.write(" ")
if nesteside <> 1 and then
response.write "<a href=""?pic=" & (start + antalBillederPrSide) & "&show=" & show & """>Næste</a>"
end if
%>
</center>
<%
else
'Vis billedet
%>
<tr><td align="center">
<img SRC="<%=Request.QueryString("billede")%>" border="1">
<p align="center"><a href = "java script:history.back()">Tilbage</a></p>
</td>
</tr>
</table>
<%
end if %>
<!--Lav thumbnails med start-link-id-->
<%
pic=request.querystring("pic")
antalBillederPrSide = 4
antalBillederPrRekke = 4
if Request.QueryString("billede") = "" then
start = request.querystring("show")
if start = "" then start = 0
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(server.mappath(billedeSti))
Set fc = f.Files
For Each billed in fc
if inStr(1,"gif,jpg,jpeg,bmp",LCase(fs.GetExtensionName(billed.name))) > 0 then
arrayBuild = arrayBuild & billed.name & "|"
end if
next
if arrayBuild <> "" then arrayBuild = left(arrayBuild, (len(arrayBuild) - 1))
myArray = Split(arrayBuild, "|")
Antalsider = int(ubound(myarray) / antalBillederPrSide)
antal = 0
for i = start to (start + antalBillederPrSide-1)
if not i > ubound(myarray) then
if antal = 0 then Response.Write ""
%>
<a href="?pic=<%=i%>&show=<%=start%>">
<img SRC="<%=billedeSti%>/<%=myArray(i)%>" border="0" color="black" height="70">
</a>
<%
else
nesteside = 1
end if
antal = antal + 1
if antal = antalBillederPrRekke then
Response.Write "</TR>"
antal = 0
end if
next
if antal > 0 then Response.Write ""
%>
</table>
<center>
<%
if start <> 0 then
response.write "<a href=""?pic=" & pic & "&show=" & (start - antalBillederPrSide) & """>Forrige</a>"
end if
response.write(" ")
if nesteside <> 1 then
response.write "<a href=""?pic=" & pic & "&show=" & (start + antalBillederPrSide) & """>Næste</a>"
end if
%>
</center>
<%
else
'Vis billedet
%>
<tr><td align="center">
<img SRC="<%=Request.QueryString("billede")%>" border="1">
<p align="center"><a href = "java script:history.back()">Tilbage</a></p>
</td>
</tr>
</table>
<%
end if %>