Member
Member
vstam   2014-06-22, 09:08
#1

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

Administrator
Administrator
acrylian   2014-06-22, 09:27
#2

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().

Member
Member
vstam   2014-06-22, 10:00
#3

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.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.