Customizing a Gallery Script with CMS - thumbnail separate gallery from full size
3 posts by 2 authors in: Forums > CMS Builder
Last Post: August 6, 2010 (RSS)
By meg - August 5, 2010
The lightboxed gallery script for the website lists out the thumbnail and fullsize as such:
I essentially want the user in the CMS to upload specifically sized images for the thumbnails in a separate gallery from the full-sized image gallery. (If there's a better way of achieving this - please let me know.) However, I can't get this method to work properly. Here's the PHP I have right now....what am I doing wrong?? Any solution, even if it's a different approach would be much appreciated!
<li><a href="fullsize-image.jpg"><img src="thumbnail-image.jpg" width="54" height="80" alt="kids are alright" border="0"/></a></li>
I essentially want the user in the CMS to upload specifically sized images for the thumbnails in a separate gallery from the full-sized image gallery. (If there's a better way of achieving this - please let me know.) However, I can't get this method to work properly. Here's the PHP I have right now....what am I doing wrong?? Any solution, even if it's a different approach would be much appreciated!
<li><a href="<?php foreach ($record['gallery_full_sized_images'] as $upload): ?><?php if ($upload['hasThumbnail']): ?><?php elseif ($upload['isImage']): ?><?php echo $upload['urlPath'] ?><?php endif ?><?php endforeach ?>">
<?php foreach ($record['gallery_thumbnails_80px_h'] as $upload): ?><?php if ($upload['hasThumbnail']): ?><?php elseif ($upload['isImage']): ?><img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo $upload['info1'] ?>" border="0"/><?php endif ?><?php endforeach ?> </a></li>
Re: [meg] Customizing a Gallery Script with CMS - thumbnail separate gallery from full size
By Chris - August 5, 2010
Hi meg,
As I understand it, you have two arrays, like this:
I think the simplest way to accomplish this would be to have a loop count through the elements of the arrays. Try this:
Does that help? Please let me know if you have any questions.
As I understand it, you have two arrays, like this:
$fullsized = array(
$image1,
$image2,
$image3
);
$thumbnails = array(
$thumb1,
$thumb2,
$thumb3
);
I think the simplest way to accomplish this would be to have a loop count through the elements of the arrays. Try this:
<?php $thumbnails = $record['gallery_thumbnails_80px_h']; ?>
<?php $fullimages = $record['gallery_full_sized_images']; ?>
<?php $highest = min(sizeof($thumbnails), sizeof($fullimages)); ?>
<?php for($i = 0; $i < $highest; $i++): ?>
<?php $thumbnail = $thumbnails[$i]; ?>
<?php $fullimage = $fullimages[$i]; ?>
<li><a href="<?php echo $fullimage['urlPath'] ?>">
<img src="<?php echo $thumbnail['urlPath'] ?>" width="<?php echo $thumbnail['width'] ?>" height="<?php echo $thumbnail['height'] ?>" alt="<?php echo $thumbnail['info1'] ?>" border="0"/>
</a></li>
<?php endfor ?>
Does that help? Please let me know if you have any questions.
All the best,
Chris
Chris
Re: [chris] Customizing a Gallery Script with CMS - thumbnail separate gallery from full size
By meg - August 6, 2010
Worked liked a charm!! Thank you! Thank you! I love your CMS!! [;)]