<table width="100%" border="0">
<%Set strFSO = Server.CreateObject("Scripting.FileSystemObject")
Set Mapp = strFSO.getFolder(Server.MapPath("../mestfest/arkiv/tmp/Sommaravslut - 030802"))
PS = 9 'Bilder per sida
PR = 3 'Bilder per rad
If Mapp.Files.Count Mod PS Then
Sidor = Mapp.Files.Count \ PS + 1
Else
Sidor = Mapp.Files.Count \ PS
End If
If Request.Querystring("sida") Then
Sida = CInt(Request.Querystring("sida"))
Else
Sida = 1
End If
Start = (Sida - 1) * PS
Slut = Start + PS
If Mapp.Files.Count = 0 Then%>
<tr><td>Inga bilder!</td><tr>
<%Else
n=0
x=0
y=0
loopInit = False
For Each File In Mapp.Files
If n >= Start AND n < Slut Then
loopInit = True
If y = PR Then
Response.Write "<tr>"
y = 0
End If%>
<td width="33%" align="center">
<img src="bilder/<%=File.Name%>">
</td>
<%
x = x +1
y = y +1
Else
If loopInit Then Exit For
End If
n = n +1
Next
End If%>
</table>
<%If Sidor > 1 Then
Response.Write "<table width=""100%"" border=""0""><tr>"
If (Int(sida)) > 1 Then
Response.Write "<td width=""50%""><a href=""bilder.asp?sida=" & (Int(sida)-1) & """><b>Förra</b></a></td>"
Else
Response.Write "<td width=""50%"">Förra</td>"
End If
If (Int(sida)) <> (Int(Sidor)) Then
Response.Write "<td width=""50%"" align=""right""><a href=""bilder.asp?sida=" & (Int(sida)+1) & """><b>Nästa</b></a></td>"
Else
Response.Write "<td width=""50%"" align=""right"">Nästa</td>"
End If
Response.Write "</tr></table>"
End If%>
/r
Fixat buggen från att visa PS+1 bilder per sida till endast PS
