I have a dynamic album, let's call it Macro (http://www.frenchguys.com/gallery/Techniques/Macros.alb/), it contains a static album called "Insect and Flowers" and a few photos. Its query is based on a tag called "macro".
For sub-albums, my album.php code displays the number of sub-albums it itself contains, the number of photos and how many times it was viewed.
Strangely, you'll see that the "Insect and Flowers" subalbums has different characteristics while viewed in Macros (http://www.frenchguys.com/gallery/Techniques/Macros.alb) or BzzAgent Volunteering Day (http://www.frenchguys.com/gallery/Others/BzzAgentFoodProject/).
The later is correct with 0 subalbums and 58 photos. I have tracked the problem here to getNumsubalbums(); returning the wrong value for an album within a sub-album.
So it seems that getNumsubalbums(); & getNumImages(); don't work well in the context that I am using them in here. Which if I understand is within a dynamic-album, in the while (next_album()): loop, before the while (next_image(false, $firstPageImages)): loop.
Moreover, as a result of calling these functions, the image loop that comes after I close the while (next_album()): subalbums loop stops working and doesn't display the images of my context. I have tracked that to the getNumImages(); call within the sub-albums loop. Removing it displays my images correctly.
Am I not using the right API calls ?
This is the additional code I am using within the while (next_album()): loop :
`
`
(Can this be moved to Usage instead of Installation, my bad)
After looking a bit into it, I am guessing the first issue (printing a total number of subalbums in the dynamic albums instead of printing the number of subalbums in a subalbum of the dynamic albums) is because of this code which behaves differently whether it's a search (or dynamic album) or a static album:
` function getNumSubalbums() {
global $_zp_current_album, $_zp_current_search;
if (!is_null($_zp_current_search)) {
return count($_zp_current_search->getNumAlbums());
} else {
return count($_zp_current_album->getSubalbums());
}
}
`
Sorry about that. We felt it better to not let the query be edited. Then we won't have to respond to problems created by the editing. It is relatively simple to recreate the album from a query. There should not have abeen a "." at the end anyway, but it probably did no harm.