Re: [rez] showing wrong number of thumbs
Hi rez,
The trick here is to first combine each record's list of uploads into one big list of all the uploads, then shuffle it.
Also, instead of using the $counter trick, I used array_slice to trim the list down to its first 12 entries. $counter would have worked just as well too. :)
<?php
// make one big list of all the 'uploads' from all the records
$allUploads = array();
foreach ($galleryRecords as $record) {
$allUploads = array_merge($allUploads, $record['uploads']);
}
// randomize their order
shuffle($allUploads);
// keep only the first 12 uploads
$allUploads = array_slice($allUploads, 0, 12);
?>
<?php foreach ($allUploads as $upload): ?>
<li><a href="<?php echo $upload['urlPath'] ?>" ><img src="<?php echo $upload['thumbUrlPath'] ?>" /></a></li>
<?php endforeach ?>
I hope this helps! Please let me know if you have any questions.
All the best,
Chris