Vis 3 billeder pr række
Hej,Jeg er ved at lave et lille galleri der trækker stien til billederne ud fra min database, resizer dem med aspimage og viser dem i galleriet. Jeg vil gerne have det sådan at der bliver vist fx 3 billeder pr. række.
Jeg har lavet databaseudtræk til billede, men vil gerne have hjælp til at udskrive de 3 billeder pr. række.
Min kode:
<!--#include file="../Database.asp"-->
<%
If isEmpty(Request.Querystring("albumID")) then
albumID = 1
else
albumID = Request.Querystring("albumID")
End if
If isEmpty(Request.Querystring("pictureID")) then
pictureID = 1
else
pictureID = Request.Querystring("pictureID")
End if
SQL2 = "Select * FROM Galleries WHERE GalleryID=" & albumID
Set rs2 = Conn.Execute(SQL2)
SQL3 = "Select * FROM Gallerypictures WHERE PictureID=" & pictureID
Set rs3 = Conn.Execute(SQL3)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Billedgalleri</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="Style.css" rel="stylesheet" type="text/css" />
<script language='javascript' type='text/javascript'>
function visbilled( billedUrl ) {
window.open( "picture.asp?"+billedUrl, "picvindue", "resizable=1" );
}; //end visbilled( string )
</script>
</head>
<body id="gal">
<table width="100%" border="0" cellspacing="0">
<tr bgcolor="#BA242D">
<td colspan="2"><div id="titel"><%=rs2("Title")%></div></td>
</tr>
<tr>
<td colspan="2">
<div class="galnav">
<%
If rs2.eof or rs2.bof then
Response.Write "Ingen gallerier i systemet."
else
Do While not rs2.eof
SQL = "Select * FROM Gallerypictures WHERE AlbumID=" & rs2("GalleryID")
Set rs = Conn.Execute(SQL)
%>
<a href="default.asp?albumID=<%=rs2("GalleryID")%>&pictureID=<%=pictureID%>"><%=rs2("Title")%></a>
<%
rs2.movenext
loop
End if
%>
</div>
</td>
</tr>
<tr>
<td width="422" align="center" valign="top"><p><img src="Images/<%=rs3("Path")%>" alt="<%=rs3("Title")%>"></p>
<div class="indhold">
<p> </p>
</div>
<p> </p></td>
<td valign="top">
<%
If rs.eof or rs.bof then
Response.Write "Der findes ingen billeder i dette galleri."
else
%>
<table width="400" border="0" cellpadding="0" cellspacing="0" id="thumbtb">
<%
Do While not rs.eof
strBillede = rs("Path")
%>
<tr align="center" valign="top">
<td width="133">
<a href="java script:void(0)" onclick="visbilled('<%="Images/" & strBillede%>')">
<%
Response.Write "<img src='showpic.asp?pic=" & strBillede & "' class='thumbpic' alt='" & rs("Title") & "'></a>"
%>
<div class="indhold"><p class="mininav"><%=rs("Title")%></p>
</div></td>
<td width="134">
</td>
<td width="133"> </td>
</tr>
<%
rs.movenext
loop
%>
<tr align="left" valign="top">
<td id="billedmenu" colspan="3"><div class="indhold">indsæt billedmenu her (1-9 | 10-18 osv.)</div></td>
</tr>
</table>
<%
End if
%>
</td>
</tr>
<tr valign="top">
<td id="galdis" colspan="2"><div align="center" class="disclaimer"></div></td>
</tr>
</table>
</body>
</html>
