Previous/Next Gallery Pages on Detail Page

2 posts by 2 authors in: Forums > CMS Builder
Last Post: August 14, 2014   (RSS)

By csdesign - August 6, 2014

Hello! 

I would greatly appreciate some help on this. I've been working on it for HOURS... and I know it's just something obvious but I just can't quite put it together. 

I'm trying to do something that was addressed in a different post, but even with the example I'm having issues. 
similiar issue: http://www.interactivetools.com/forum/forum-posts.php?postNum=2230133#post2230133
result from that post: http://www.petersmithconstruction.ca/glist.php

The finished result from that post was pretty much what I'm trying to accomplish - a gallery that's generated from a detail page (a individual image upload field) with the capability to only show 15 images per page to help with load time. 

My Gallery starts here:  (1st image uploaded - using drag sort order - is displayed as main image for each gallery)
http://www.bighornmountainlodges.com/photos-lodging-bighorns-cabins.php

Click on "Our Favorite Photos" - this is the gallery page that I would like to show only 15 images per page. And that's where I'm having issues.  The detail page is attached and the code is pasted below. Thanks!! 

LINK TO CURRENT DETAIL PAGE
http://www.bighornmountainlodges.com/photos-lodging-bighorns-cabins-detail.php?1

   // load records   
list($photos01Records, $photos01MetaData) = getRecords(array(     
'tableName'   => 'photos01',     
'where'       => '', // load first record
'perPage'     => '15',   
));   
$photos01Record = @$photos01Records[0]; // get first record   

// show error message if no matching record is found   
if (!$photos01Record) {     
header("HTTP/1.0 404 Not Found");     
print "Record not found!";     
exit;   
}  

//Get prev/next links using the photo num    
list($prevRecord, $nextRecord, $firstRecord, $lastRecord) = getPrevAndNextRecords(array(      
'tableName' => 'photos01',      
'recordNum' => $photos01Record['num'],      
'orderBy'   => 'createdDate'   ));



<?php foreach ($photos01Record['images'] as $index => $upload): ?>
<a href="<?php echo $upload['urlPath'] ?>" rel="lightbox[uploads]" title="<?php echo $upload['info1'] ?>  www.lodgesofthebighorns.com"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" border="1" alt="<?php echo $upload['info2'] ?>" /></a>
<?php if (!$photos01Records): ?>
No photos were found!
<?php endif ?>  
<?php $maxCols=3; if (@++$count % $maxCols == 0): ?>
<?php endif; ?>
<?php endforeach ?>  


<!-- show previous and next links -->
Previous Record: <a href="<?php echo (@$prevRecord['_link'])? $prevRecord['_link'] : '?' ; ?>">Previous</a><br>                 
Next Record: <a href="<?php echo @$nextRecord['_link']; ?>" >Next</a>                  
First Record: <a href="<?php echo (@$firstRecord['_link'])? $firstRecord['_link'] : '?' ; ?>" >First</a>                  
Last Record: <a href="<?php echo @$lastRecord['_link'] ?>">Last</a>