Get Random Images from specific album

Hello,
I have read through the forum to try to find the answer to my issue, but I can't seem to get it to work.
All I am trying to achieve is to get random images to be selected from one specific album.
The original code is this:
<?php
if (($zpfocus_showrandom) == 'single') { $sscount=1; } else { $sscount=5; }
if ((in_context(ZP_ALBUM)) || (in_context(ZP_IMAGE))) { $sstype = 'album'; $ssalbum = $_zp_current_album->getFolder(); $sstitle = gettext('Random Album Image'); } else { $sstype = 'all'; $sstitle = gettext('Random Gallery Image'); }
?>
<div id="random-wrap">
<?php printRandomImages($sscount,'',$sstype,$ssalbum,300,300,true); ?>
<div id="random-title">
<?php echo $sstitle; ?>

I changed it to this:

<?php
if (($zpfocus_showrandom) == 'single') { $sscount=1; } else { $sscount=5; }
if ((in_context(ZP_ALBUM)) || (in_context(ZP_IMAGE))) { $sstype = 'album'; $ssalbum = $_zp_current_album->getFolder()=='appliances'; $sstitle = gettext('Random Album Image'); } else { $sstype = 'all'; $sstitle = gettext('Random Gallery Image'); }
?>
<div id="random-wrap">
<?php printRandomImages($sscount,'',$sstype,$ssalbum,300,300,true); ?>
<div id="random-title">
<?php echo $sstitle; ?>
I am probably missing something very simple. Any suggestions would be appreciated. Thank-you!

Zenphoto version 1.4.2.3 [9980] (Official Build)
Current gallery theme: zpFocus_ v1.4.2.2

Comments

Sign In or Register to comment.