ZenphotoCMS Forum
next_image() troubleshooting when not displaying images - 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: next_image() troubleshooting when not displaying images (/thread-11837.html)



next_image() troubleshooting when not displaying images - vstam - 2014-06-22

I have altered my theme to detect when it is showing images by evaluating whether next_image() returns TRUE or FALSE. I then present some html bits if it evaluates TRUE and also go through the while loop to show all the images of an album.
The problem is that most of the time it works, but in some albums it wont show any photos, although it does evaluate to TRUE.

if(next_image(TRUE, NULL, NULL))
{
//do bits here ?>

// print thumbs




next_image() troubleshooting when not displaying images - acrylian - 2014-06-22

If you want to check if an album actually has images so you only print the html of the loop then, the better way would be using if(getNumImages()) { … }. Same for next_album using getNumAlbums().




next_image() troubleshooting when not displaying images - vstam - 2014-06-22

I used getNumImages() in the if statement instead of next_image() and it works as expected. Thank so much! It's been driving me mad.