Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Images per page 12 - 16 - 32 - 64

Posted 31 Mar 2005 06:42:26
1
has voted
31 Mar 2005 06:42:26 David Forshaw posted:
Hi

I am trying to get a feature to work on a clients website.

I am building a image library in ASP VB Script and I want the user to be
able to select the amount of images they view on the page.

eg. Images per page 12 - 16 - 32 - 64

So selecting 12 for example would only show 12 records.

I am using the Horizontal Looper extension to display my images in 4
columns.

Have anyone ever done this before or know of how to do it?

Any help will be greatly appreciated.

Here are some examples that I have seen:
intersoft.net.au/KirkLand/program/pwp.exe?SESSION_ID=12481&TARGET_FORM=THUMB_PAGE&SET_ID=18

www.agefotostock.com/099hwdliqr/ingles/iskw01.asp?actual=1&tam=2&querystr=Dogs&id=9937660&anteriorbloque=1&tfoto=SSNNN&categs=NNNNNNNNNNNN&others=SSSSSSN&vertam=1&newtf=0

Thanks and regards
David Forshaw

<font face='Verdana'></font id='Verdana'>

Replies

Replied 31 Mar 2005 07:40:36
31 Mar 2005 07:40:36 Dave Thomas replied:
this is an old tutorial for ultradev4, but it may be useful as the logic is the same for what u need.

www.dmxzone.com/showDetail.asp?TypeId=7&NewsId=2658

regards

Dave Thomas
<b>DMX Zone Manager</b>
Replied 31 Mar 2005 07:50:13
31 Mar 2005 07:50:13 David Forshaw replied:
Hi Dave

Thanks for your speedy reply. Its very appreciated <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Unfortunately I have tried this method before and it works fine for the standard Dreamweaver Repeat Region behaviour.

The problem is that I am using the Horizontal recordset extension behaviour.

Now I have got it to work based on that same request.Querystring principle but then some other features stop working.

For example, once I edit the Horizontal looper code the recordset paging and recordset navigation bars stop working.

Any ideas??

Heres my Horizontal Looper code (before I altered it):
&lt;%
Dim HLooper1__numRows
HLooper1__numRows = 12
Dim HLooper1__index
HLooper1__index = 0
rsImageList_numRows = rsImageList_numRows + HLooper1__numRows
%&gt;

AND AROUND THE TABLE:

&lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt;
&lt;%
startrw = 0
endrw = HLooper1__index
numberColumns = 4
numrows = 3
while((numrows &lt;&gt; 0) AND (Not rsImageList.EOF))
startrw = endrw + 1
endrw = endrw + numberColumns
%&gt;
&lt;tr align="center" valign="top"&gt;
&lt;%
While ((startrw &lt;= endrw) AND (Not rsImageList.EOF))
%&gt;
&lt;td align="left"&gt;
&lt;table width="150" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;&lt;img src="images/images/&lt;%= Thumbnail("s",(rsImageList.Fields.Item("txtThumbnail".Value)) %&gt;" /&gt;&lt;/td&gt;
&lt;td width="10" rowspan="2"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;%=(rsImageList.Fields.Item("txtImageNumber".Value)%&gt;&lt;/td&gt;
&lt;td&gt;B V &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;%
startrw = startrw + 1
rsImageList.MoveNext()
Wend
%&gt;
&lt;/tr&gt;
&lt;tr align="center" valign="top"&gt;
&lt;td align="left"&gt;&nbsp;
&lt;table border="0" width="50%" align="center"&gt;
&lt;tr&gt;
&lt;td width="23%" align="center"&gt;
&lt;% If MM_offset &lt;&gt; 0 Then %&gt;
&lt;a href="&lt;%=MM_moveFirst%&gt;"&gt;First&lt;/a&gt;
&lt;% End If ' end MM_offset &lt;&gt; 0 %&gt;
&lt;/td&gt;
&lt;td width="31%" align="center"&gt;
&lt;% If MM_offset &lt;&gt; 0 Then %&gt;
&lt;a href="&lt;%=MM_movePrev%&gt;"&gt;Previous&lt;/a&gt;
&lt;% End If ' end MM_offset &lt;&gt; 0 %&gt;
&lt;/td&gt;
&lt;td width="23%" align="center"&gt;
&lt;% If Not MM_atTotal Then %&gt;
&lt;a href="&lt;%=MM_moveNext%&gt;"&gt;Next&lt;/a&gt;
&lt;% End If ' end Not MM_atTotal %&gt;
&lt;/td&gt;
&lt;td width="23%" align="center"&gt;
&lt;% If Not MM_atTotal Then %&gt;
&lt;a href="&lt;%=MM_moveLast%&gt;"&gt;Last&lt;/a&gt;
&lt;% End If ' end Not MM_atTotal %&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;%
numrows=numrows-1
Wend
%&gt;
&lt;/table&gt;

Any ideas on how that could be altered??

Thanks
Dave
Replied 31 Mar 2005 08:14:11
31 Mar 2005 08:14:11 Dave Thomas replied:
i aint no genius when it comes to programming code, and surely there's a more
advanced way of doing this. So because i have to keep things simple for myself, i'd go with
something like.

have 4 pages for the different img values 12,16,32,64.
use your code as a default page to show the 12 images.
have a radio button set up that passes a querystring so if someone selects a different number it loads
that page instead?

u could also have this written to a cookie so it remembers the img numbers to display.

sounds feasible enough <img src=../images/dmxzone/forum/icon_smile_blackeye.gif border=0 align=middle>

regards

Dave Thomas
<b>DMX Zone Manager</b>
Replied 31 Mar 2005 10:38:28
31 Mar 2005 10:38:28 Chris Charlton replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>I am building a image library in ASP VB Script and I want the user to be able to select the amount of images they view on the page. (eg. Images per page 12 - 16 - 32 - 64). So selecting 12 for example would only show 12 records. I am using the Horizontal Looper extension to display my images in 4 columns.

Have anyone ever done this before or know of how to do it?<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
The <i>Recordset</i> navigation that may be intergrated with Horizontal Looper. I know I did it with InterAKT's <i>MX Looper</i>, so shouldn't be too hard. The <i>Repeat Region</i> should be limited to 12, and all should fall in line.

~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>

Reply to this topic