Hello, I build a homepage with a slide show using the Galleriffic script. I succeed with this code:
`
<?php
$images = getImageStatistic(6, "popular", "home");
foreach ($images as $image) {
?>
class="thumb" href="<?php echo html_encode($image->getCustomImage(null, null, null, null, null, null, null, false)); ?>" title="<?php echo html_encode($image->getTitle()); ?>"><?php } ?>
`
but I'd like to use a more proper way instead of `getImageStatistic` as:
`
$albumobj = new Album($_zp_gallery, "home");
$images = $albumobj->getImages();
foreach ($images as $image)
...
`
but in this one looks like I'm doing something wrong in the second line. So how do I call the images?
Thanks
Comments
What is wrong with using the getImageStatistics function? That is meant for these things as the object model has no functions to sort by popular at all.
That said, it's not really wrong, but I don't need any special sort order (random, popular or whatever) and I'd like instead to show all the pics in the album. Moreover I'm trying to improve my code learning, so I was looking for a more 'right' way.
Now, since `getImageStatistic` is working I can live with that (actually I didn't understand by your comment if the second way is ok or not).
You did not exactly point out what your problem was.