You could try this:
`function getNumAlbums(){
global $_zp_gallery;
return count($_zp_gallery->loadAlbumNames());
}
`
Bung it in the template-functions.php somewhere and see if it works :)
(there are probably much better ways of doing it, but this should be a quick and dirty hack)
Better yet, I would copy the entire printpagelistwithnav function, and put it into your custom functions file (if you have one - i can explain how to to this if you don't know how) and create your own function. theoretically it should work fine, and then you won't be hacking the core files at all. makes it a lot cleaner for upgrades later....
And depending on your needs, you may be able to modify these SQL counting functions to fit your needs. I use them for my custom album, subalbums counts on my zenphoto pages.
`/ SQL Counting Functions /
function show_subalbum_count() {
$sql = "SELECT COUNT(id) FROM ". prefix("albums") ." WHERE parentid \"NULL\"";
$result = query($sql);
$count = mysql_result($result, 0);
echo $count;
}
function getIDforAlbum() {
if(!in_context(ZP_ALBUM)) return false;
global $_zp_current_album;
return $_zp_current_album->getAlbumID();
}
function show_sub_count_index() {
$id = getIDforAlbum();
$sql = "SELECT COUNT(*) FROM ". prefix("albums") ." WHERE parentid = $id";
$result = query($sql);
$count = mysql_result($result, 0);
echo $count;
}`
In the context of this thread, a [b]Custom Functions File[/b] would be a php file [b]not a javascript[/b] file and as such would be included using the following at the top of index.php, album.php and image.php (in your theme folder):
The includes folder is within the theme folder that you wish to write custom functions for. (It's not necessary, but I like it for neatness)