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:

&lt;%
Dim tblGCImages_total
tblGCImages_total=0
While (Not tblGCImages.EOF)
tblGCImages_total = tblGCImages_total + 1
tblGCImages.MoveNext
Wend
If (tblGCImages.CursorType &gt; 0) Then
tblGCImages.MoveFirst
Else
tblGCImages.Requery
End If
%&gt;

&lt;table width="100%" border="0" cellspacing="0" cellpadding="5"&gt;
&lt;% While tblGCImages_total &gt; 0 %&gt;
&lt;tr align="center" valign="bottom"&gt;
&lt;td width="25%"&gt;
&lt;% If tblGCImages_total &gt; 0 Then %&gt;
&lt;img src="/uploads/fotos/&lt;%=(tblGCImages.Fields.Item("RandomPrefix".Value)%&gt;&lt;%=(tblGCImages.Fields.Item("Thumbnail".Value)%&gt;" border="0"&gt;
&lt;%
tblGCImages.MoveNext()
tblGCImages_total = tblGCImages_total - 1
End If
%&gt;
&lt;/td&gt;
&lt;td width="25%"&gt;
&lt;% If tblGCImages_total &gt; 0 Then %&gt;
&lt;img src="/uploads/fotos/&lt;%=(tblGCImages.Fields.Item("RandomPrefix".Value)%&gt;&lt;%=(tblGCImages.Fields.Item("Thumbnail".Value)%&gt;" border="0"&gt;
&lt;%
tblGCImages.MoveNext()
tblGCImages_total = tblGCImages_total - 1
End If
%&gt;
&lt;/td&gt;
&lt;td width="25%"&gt;
&lt;% If tblGCImages_total &gt; 0 Then %&gt;
&lt;img src="/uploads/fotos/&lt;%=(tblGCImages.Fields.Item("RandomPrefix".Value)%&gt;&lt;%=(tblGCImages.Fields.Item("Thumbnail".Value)%&gt;" border="0"&gt;
&lt;%
tblGCImages.MoveNext()
tblGCImages_total = tblGCImages_total - 1
End If
%&gt;

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

Reply to this topic