Dele Thumbnails ind i rækker
Jeg har siddet og fusket med et system her, jeg har ingen problemer med at kalde billederne og vise dem som thumbs osv. med ASPImage.Men når jeg kalder thumbs bliver de vist på en lang række.... er det muligt at ændre i det nedenstående script så det kommer til at stå fx 4 billeder pr række i en table ?
<%
ImageDir = "/Images/HosBuhl/HosBuhl/"
directpath = server.mappath("/") & "/Images/HosBuhl/HosBuhl/"
picturesperpage = 20
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD>
<TITLE>PS</TITLE>
<meta name="Generator" content="Stone's WebWriter 4">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
a.sider {
font-size: 0.7em;
}
</style>
</HEAD>
<body>
<div>
<%
Function IsComponentInstalled(ProgId)
Dim tmpObject
On Error Resume Next
Set tmpObject = Server.CreateObject(ProgId)
If Err.Number = 0 Then
IsComponentInstalled = True
Else
IsComponentInstalled = False
End If
Set tmpObject = Nothing
End Function
picture = request("picture")
id = request("id")
pagenumber = request("page")
If isNumeric(pagenumber) = False Or pagenumber < 1 Then
pagenumber = 1
End If
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.GetFolder(Server.MapPath(ImageDir))
Set objFiles = objFolder.Files
numberofpictures = objFiles.Count
strScriptName = Request.Servervariables("ScriptName")
intPageCount = -Int(-(numberofpictures/picturesperpage))
antalBillederPrSide = 140
antalBillederPrRekke = 4
IF picture="" then
Response.Write "Der er " & numberofpictures & " billeder i denne sektion"
Response.Write " This is page " & pagenumber & " of " & intPageCount & "<BR><BR>"
END IF
If pagenumber > 1 Then
newpage = pagenumber - 1
Response.Write "<a href='" & strScriptName & "?page=" & newpage & "' class=""sider"">[Prev. page] </A>"
End If
For i = 1 To intPageCount
Response.Write " <a href='" & strScriptName & "?page=" & i & "' class=""sider"">" & i & " </a>"
Next
If Cint(pagenumber) < Cint(intPageCount) then
newpage = pagenumber + 1
Response.Write "<a href='" & strScriptName & "?page=" & newpage & "' class=""sider"">[Next page]</A>"
End If
DIM picturearray
For Each Image In objFiles
intFile = intFile + 1
picturelist = picturelist & Image.Name & ","
Next
picturearray = Split(picturelist,",")
IF picture="" then
response.write "<BR>"
FOR countit=0 TO intFile-1
If (countit >= (pagenumber-1)*picturesperpage) And (countit < (picturesperpage*pagenumber)) Then
If IsComponentInstalled("AspImage.Image") Then
response.write "<A href="""&strScriptName&"?picture="&picturearray(countit)&"&id="&countit&"""><IMG SRC=""test-2.asp?Path=" & directpath & "&File=" & picturearray(countit) & """ alt=""Tryk for at se det store billede""></A> "
else
response.write "<A href="""&strScriptName&"?picture="&picturearray(countit)&"&id="&countit&"""><IMG SRC="""&ImgDir&picture&""" height=""65"" alt=""Tryk for at se det store billede""></A> "
end if
end if
next
END IF
IF picture<>"" then
if cint(id)=0 then
prev=numberofpictures-1
else
prev=id-1
end if
if cint(id)=cint(numberofpictures-1) then
nextone=0
else
nextone=id+1
end if
response.write "<BR><BR><A href="""&strScriptName&"?picture="&picturearray(prev)&"&id="&prev&""">Forrige</A> "
response.write "<A href="""&strScriptName&"?picture="&picturearray(nextone)&"&id="&nextone&""">Næste</A> "
response.write "<BR><BR><IMG src=""" & ImageDir & picture & """ >"
end if
Set objFS = Nothing
%>
</DIV>
<BR><BR><BR>
<DIV>
</DIV>
</BODY>
</HTML>