Forums
This topic is locked
Picture gallery
Posted 12 Nov 2001 12:24:16
1
has voted
12 Nov 2001 12:24:16 Jon Kerbey posted:
Hi....I want to set up a gallery of images that is called from a database. This is fairly straight forward if I just wanted the images to be 1 per row, however I would like 5 images per row, and if I set this up in the same way as 1 per row and use the repeat region function, I get 5 images on a row, but of the same picture.
Can anyone help?
Thx <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replies
Replied 13 Nov 2001 09:55:18
13 Nov 2001 09:55:18 Viktor Farcic replied:
Take a look at this code:
<%
Dim tblGCImages_total
tblGCImages_total=0
While (Not tblGCImages.EOF)
tblGCImages_total = tblGCImages_total + 1
tblGCImages.MoveNext
Wend
If (tblGCImages.CursorType > 0) Then
tblGCImages.MoveFirst
Else
tblGCImages.Requery
End If
%>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<% While tblGCImages_total > 0 %>
<tr align="center" valign="bottom">
<td width="25%">
<% If tblGCImages_total > 0 Then %>
<img src="/uploads/fotos/<%=(tblGCImages.Fields.Item("RandomPrefix".Value)%><%=(tblGCImages.Fields.Item("Thumbnail".Value)%>" border="0">
<%
tblGCImages.MoveNext()
tblGCImages_total = tblGCImages_total - 1
End If
%>
</td>
<td width="25%">
<% If tblGCImages_total > 0 Then %>
<img src="/uploads/fotos/<%=(tblGCImages.Fields.Item("RandomPrefix".Value)%><%=(tblGCImages.Fields.Item("Thumbnail".Value)%>" border="0">
<%
tblGCImages.MoveNext()
tblGCImages_total = tblGCImages_total - 1
End If
%>
</td>
<td width="25%">
<% If tblGCImages_total > 0 Then %>
<img src="/uploads/fotos/<%=(tblGCImages.Fields.Item("RandomPrefix".Value)%><%=(tblGCImages.Fields.Item("Thumbnail".Value)%>" border="0">
<%
tblGCImages.MoveNext()
tblGCImages_total = tblGCImages_total - 1
End If
%>
This is code for displaying table with 4 cells with images inside. Number of rows depends of number of records.
<%
Dim tblGCImages_total
tblGCImages_total=0
While (Not tblGCImages.EOF)
tblGCImages_total = tblGCImages_total + 1
tblGCImages.MoveNext
Wend
If (tblGCImages.CursorType > 0) Then
tblGCImages.MoveFirst
Else
tblGCImages.Requery
End If
%>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<% While tblGCImages_total > 0 %>
<tr align="center" valign="bottom">
<td width="25%">
<% If tblGCImages_total > 0 Then %>
<img src="/uploads/fotos/<%=(tblGCImages.Fields.Item("RandomPrefix".Value)%><%=(tblGCImages.Fields.Item("Thumbnail".Value)%>" border="0">
<%
tblGCImages.MoveNext()
tblGCImages_total = tblGCImages_total - 1
End If
%>
</td>
<td width="25%">
<% If tblGCImages_total > 0 Then %>
<img src="/uploads/fotos/<%=(tblGCImages.Fields.Item("RandomPrefix".Value)%><%=(tblGCImages.Fields.Item("Thumbnail".Value)%>" border="0">
<%
tblGCImages.MoveNext()
tblGCImages_total = tblGCImages_total - 1
End If
%>
</td>
<td width="25%">
<% If tblGCImages_total > 0 Then %>
<img src="/uploads/fotos/<%=(tblGCImages.Fields.Item("RandomPrefix".Value)%><%=(tblGCImages.Fields.Item("Thumbnail".Value)%>" border="0">
<%
tblGCImages.MoveNext()
tblGCImages_total = tblGCImages_total - 1
End If
%>
This is code for displaying table with 4 cells with images inside. Number of rows depends of number of records.
Replied 02 Jan 2002 20:58:00
02 Jan 2002 20:58:00 Tolu Ayoola replied:
you're getting the same picture because you're using the same query and it's filtered. what you need to do is create another db and make sure that is not filtered. use the repeated function on the second db. that should work? did it? <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>
The initial fright of failure is the beginning of failure itself -Tolu
The initial fright of failure is the beginning of failure itself -Tolu