Member
Member
speckman   2010-04-30, 01:11
#1
Hi. I'm using getRandomImageAlbum() and it seems like doing this with an album of only 1 image will not work. If I have two images in the album, it will only return the 2nd image. Has this been addressed already? Thanks,
Mark
Member
Member
Blue Dragonfly   2010-04-30, 01:20
#2
Hi there,

Yes, I believe it was I who found and fixed that a few weeks ago :-) You might need to upgrade to the nightly build, or if you prefer not to, I can post the specific 2 small code changes you'd need to make.
Member
Member
Blue Dragonfly   2010-04-30, 01:33
#3
To patch your existing install, the file /zp-core/template-functions.php will contain two lines that read:

`$rand_row = rand(1, $result['row_count']);`

Change them both to read:

`$rand_row = rand(0, $result['row_count']-1);`

That should do it!
Member
Member
speckman   2010-04-30, 02:55
#4
Thank you very much! Smile
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.