ZenphotoCMS Forum
printMostRatedAlbums, Random? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: printMostRatedAlbums, Random? (/thread-10486.html)



printMostRatedAlbums, Random? - reneesanguinetti - 2012-10-09

Hello,
I am using Zenphoto version 1.4.3.1 [10646] (Official build) with zpFocus v1.4.3.
In my sidebar I use printMostRatedAlbums and it works just fine! But I was wondering how to add a function so the images from the albums would display randomly. This is the code I use:

'

        '

Thank-you! Renee




printMostRatedAlbums, Random? - acrylian - 2012-10-09

YOu really should sometimes look at the documentation:..
http://www.zenphoto.org/documentation/plugins/_zp-extensions---image_album_statistics.php.html#functionprintImageStatistic

Ups, wrong link but still the same:
http://www.zenphoto.org/documentation/plugins/_zp-extensions---image_album_statistics.php.html#functionprintAlbumStatistic

All the "print" functions of the plugin are just convenience wrappers. All use these two functions.




printMostRatedAlbums, Random? - reneesanguinetti - 2012-10-09

Hello,
You are right, I should have investigated the documentation further.
But, I tried the code with '$option = random'.

'

            '

It doesn't print the albums (images) randomly, but instead shows the album title. Did I forget something in the code?
Thank-you.




printMostRatedAlbums, Random? - acrylian - 2012-10-09

Please look at your code and and compare with the link I posted. It should be really obvious why it doesn't work...




printMostRatedAlbums, Random? - acrylian - 2012-10-09

Probably I misunderstood you. You want the most rated albums displayed randomly? That is not possible at all. Either most rated or random with this plugin (if you use - hint- the right function) Otherwise you have to create an entire new custom function. That is why there is a "get" function.




printMostRatedAlbums, Random? - reneesanguinetti - 2012-10-09

Yes, I want the most rated albums displayed randomly. And I did use the printAlbumStatistic function with $option = random and it still did not print the albums (images) randomly, but instead showed the album title. I will look at the get functions.
I appreciate your time! Renee




printMostRatedAlbums, Random? - acrylian - 2012-10-09

I cannot reproduce this. printAlbumsStatistcs with the random option does work as expected. Be sure to set the parameters correctly.