printMostRatedAlbums, Random?

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:

'<div id="random-wrap">
<?php printMostRatedAlbums( $number = 11, $showtitle = false, $showdate = false, $showdesc = false, $width = 300, $height = 300, $crop = false, $albumfolder = '', $firstimglink = false ); ?>
<div id="random-title">
<?php echo $sstitle; ?>
</div>
</div>'
Thank-you! Renee

Comments

  • acrylian Administrator, Developer
    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.
  • Hello,
    You are right, I should have investigated the documentation further.
    But, I tried the code with '$option = random'.

    '<div id="random-wrap">
    <?php printMostRatedAlbums( $number = 11, $option = random, $showtitle = false, $showdate = false, $showdesc = false, $width = 300, $height = 300, $crop = false, $albumfolder = '', $firstimglink = false ); ?>
    <div id="random-title">
    <?php echo $sstitle; ?>
    </div>'
    It doesn't print the albums (images) randomly, but instead shows the album title. Did I forget something in the code?
    Thank-you.
  • acrylian Administrator, Developer
    Please look at your code and and compare with the link I posted. It should be really obvious why it doesn't work...
  • acrylian Administrator, Developer
    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.
  • 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
  • acrylian Administrator, Developer
    I cannot reproduce this. printAlbumsStatistcs with the random option does work as expected. Be sure to set the parameters correctly.
Sign In or Register to comment.