Skip to main content
July 27, 2006
質問

Dynamic Image Gallery First, Next,Previous,Last

  • July 27, 2006
  • 返信数 1.
  • 315 ビュー
had a friend help me build this but now he's gone and I don't understand arrays or coldfusion really. I have an image gallery that works beautifully except that I want to be able to add two behaviors to the page. 1.Pagination. 2. Display Record Count. (I know how to use the Dreamweaver built in Server Behaviors with Dynamic Tables but this is a little different from that b/c he's using arrays to build the table instead. I've almost go the pagination working. Except I can't figure how to show the last record. I've got "First, Next, & Previous" to work. But the "Last" doesn't. This is the part of the code that I'm concerned with as everything else is working.

<cfset CountUp=Count + 10>
<cfset CountDown=Count - 10>
<p align="center"><cfif Count gte 1><a href="gallery.cfm">First</a></cfif>  <cfif Count gte 10><a href="gallery.cfm?Count=<cfoutput>#CountDown#</cfoutput>">Previous</a></cfif>  <cfif ArrayLen(PhotoArray) gt CountUp><a href="gallery.cfm?Count=<cfoutput>#CountUp#</cfoutput>">Next</a></cfif><cfif ArrayLen(PhotoArray) lt CountUp><a href="gallery.cfm?Count=<cfoutput>#CountUp#</cfoutput>">Last</a></cfif>

I have no idea how to write the "Display record counts" so if someone can help me write that part I would be so greatful.

Here is all of the code for this page attatched...
Attach Code
このトピックへの返信は締め切られました。

返信数 1

Participating Frequently
August 10, 2006
Your code is more complicated than it needs to be. I honestly didn't dig through it, but here are a few suggestions.

Use ArrayLen(array[]) to count the number of rows in an aray.

Use array[ArrayLen(array)] to find the last record