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)

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:

$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

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!! [;)]