qry_photos.cfm
------------------
<cfset serverdir = "d:\serverdir\photos\full\">
<cfset httpdir = "http://urladdress/images/photos/full">
<!--- retrieve all JPGs --->
<cfdirectory name="getrecords"
action=""> directory="#serverdir#"
filter="*.jpg" >
act_photos.cfm
-----------------
<cfparam name="displayamount" default="6">
<cfparam name="startrecord" default="1">
<cfif #getrecords.recordcount# GT (startrecord + (displayamount -1))>
<cfset displaynext = startrecord + (displayamount -1)>
<cfelse>
<cfset displaynext = getrecords.recordcount>
</cfif>
dsp_photos.cfm
-----------------
<cfoutput>
<h2>Photo Gallery</h2>
<p><span class="dropcap">T</span>his is a collection of sample gallery photos from the Hokonui Fashion Awards</p><br / >
<div id="gallery">
<cfif getrecords.recordcount IS NOT 0>
<cfif startrecord GT 1>
<cfset prevrecord = (#startrecord# - #displayamount#)>
<a href="" class="prevnext">&##171; Previous</a>
</cfif>
<cfif getrecords.recordcount GT (#startrecord# + (#displayamount# - 1))>
<cfset nextrecord = #displaynext# + 1>
<a href="" class="prevnext">Next &##187;</a>
</cfif>
<cfelse>
<p>There are no images at this time.</p>
</cfif>
<div style="width:360px; padding-top:10px;">
<cfloop query="getrecords" startrow="#startrecord#" endrow="#displaynext#">
<a href=""> <img src="" alt="" height="150" width="100" />
</a>
</cfloop>
</div>
</div>
</cfoutput>
and dsp_photosFull.cfm
--------------------------
<cfoutput>
<img src="" border="0"><br />
<a href="" class="prevnext">Back to Gallery</a>
</cfoutput>
This does the following. I'm still using cfdirectory to query all the images. On the main display page I set to show 6 thumbs at a time (displaying next and previous where appropriate). When a thumbnail is clicked on it opens dsp_photosFull.cfm and the corresponding full sized image (with the same name). When on this page a 'back to gallery' link is provided which will return the user to the correct part of the thumbnail gallery (ie the page they just came from, whether it be the 2nd or 3rd or 4th ).
This is pretty simple and works well. However, I'm pretty sure by simplifying things to this degree I wont be able to accomplish my next goal without some difficulty. And that would be the following - once a user clicks on a thumb and is taken to the page displaying the full size image, I would also like to provide a next and previous button here (one which would display the next or previous full size image in the query on this page WITHOUT having to return to the gallery thumbs). Since this has been done using block ranges I'm not sure how to achieve this.
Ideas?
TIA
Mark H
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

