macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Re: recordset functions

Subject: Re: recordset functions
From: "900spg"
Date: Fri, 10 Aug 2007 03:21:51 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
Thanks for the help with this. Here is what I ended up doing based on your 
suggestion.
 In the image display page I am doing the following:
 <cfset currentrow = #url.r#>
 <cfif #currentrow# LTE 1>
                <cfset previousimage='index.cfm'>
                <cfset previousrow=0>
                <cfset nextimage = #getallphotos.filename[(#currentrow# + 1)]#>
                <cfset nextrow = (#currentrow# + 1)>
 <cfelse>
        <cfif #currentrow# GTE #getallphotos.recordcount#>
                <cfset nextimage = 'index.cfm'>
                <cfset nextrow = (#currentrow#+1)>
                <cfset previousimage = #getallphotos.filename[(#currentrow# - 
1)]#>
                <cfset previousrow =(#currentrow# - 1)>
        <cfelse>
                
                        <cfset previousrow =(#currentrow# - 1)>
                        <cfset nextrow = (#currentrow# + 1)>
                        <cfset previousimage = 
#getallphotos.filename[(#currentrow# - 1)]#>
                        <cfset nextimage = #getallphotos.filename[(#currentrow# 
+ 1)]#>
                        
        </cfif>
 </cfif>

 And then this to make the links:
 <cfoutput>
 <a href="displayimage.cfm?f=#previousimage#&r=#previousrow#">PREVIOUS</a><a 
href="displaythumbs.cfm">THUMBNAILS</a><a 
href="displayimage.cfm?f=#nextimage#&r=#nextrow#">NEXT</a><br />
 <br />
 <img src="/images/#getphotos.filename#">

 </cfoutput>

 So far it is working out. Thanks for getting me started.


<Prev in Thread] Current Thread [Next in Thread>