![]() |
|
Count Album Pages - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Themes (https://forum.zenphoto.org/forum-5.html) +--- Thread: Count Album Pages (/thread-979.html) |
Count Album Pages - guischarf - 14-12-2006 Hello, Is there a function that return the number of album pages (without printing)? I am using Thanks Count Album Pages - Donkikong - 15-12-2006 You could try this: `function getNumAlbums(){
} ` (there are probably much better ways of doing it, but this should be a quick and dirty hack) Count Album Pages - thinkdreams - 15-12-2006 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.... Count Album Pages - thinkdreams - 15-12-2006 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() {
$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() {
$count = mysql_result($result, 0); echo $count; }` Count Album Pages - guischarf - 02-01-2007 Hi think dreams! How do I create a custom functions file? Thanks, GS Count Album Pages - aitf311 - 02-01-2007 You would create a new php file say for instance you have it in your theme folder you would insert the following code in the head where you other includes are: Count Album Pages - Donkikong - 03-01-2007 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):
Count Album Pages - Mazer23 - 23-04-2009 Here is a basic fix that doesn't require you to use a custom functions file: ` [align=center] [/align] ` |