Latest Albums

I'm using this custom function http://www.zenphoto.org/trac/wiki/ZenphotoHacks#LatestAlbumsCustomFunction and I was wondering if it is supposed to work with v 1.0.8.2 and subalbums.
My problem is that when I upload a new album it won't display anything, neither the thumb for the album, nor the link. I tried refreshing the main page, clear my computer cache etc. but with no avail.

However, if I go manually to the new album first and come back to the main page, then the thumb for the album shows up. Does anyone know what is causing this and how to fix it?

Comments

  • trisweb Administrator
    This is the natural behavior of Zenphoto. I know that's no excuse, but it's true. The gallery is not based on the database, but on the Filesystem. However, the Latest Albums hack uses the database to get its information, so if the album hasn't been 'seen' and given a database entry, then Latest Albums won't know it even exists.

    This is desirable behavior -- searching the filesystem on every page load would be very slow, and matching it with the already existing entries in the database even slower. So it's only done when absolutely needed, or when requested.

    To refresh the database, just click the [refresh] link next to the stats on the zp Admin front page. Or, as you've discovered, just visit the album.

    Come to think of it, the bug is actually in the Latest Albums hack, for going around Zenphoto's own methods, which get the current albums. (One line-- `$gallery->getAlbums(0);` would do the trick). Bypassing Zenphoto means nothing new is refreshed. I'll see if we can fix that.
Sign In or Register to comment.