Hi to all.
I made my own theme, and now i want to show the total number of the images i have in different albums. I'd like to have it on the index.php page of my template.
I noticed that if i use the getTotalImagesIn function without parameters it didn't work.
I'm pretty ignorant in php
I tried this but it dont work
Any help???
Thanks in advance
alredy tried. It seems wherever I insert getNumImages() or getTotalImagesIn() functions in the index.php page it simply block the page.
It seems to work on my album.php page instead.
I wonder why.. Missing parameters?
If u want to take a look my ZP gallery is in filmposter.netsons.org/zenphoto/index.php
You need to place getNumImage() within the albums loop that starts with `` since it returns only the images of one album. getTotalimages instead returns the number of images in an album and all of it's subalbums.
Please take a look at our functions guide, too.
If you mean the total number of all images in all albums? There is no function for that if I recall correctly. Use something like this:
``(taken from stopdesign theme).
Probably worth considering a standard function for that.
From class-gallery.php:
`
224 /**
225 Returns the number of images from a database SELECT count()
226 * Ideally one should call garbageCollect() before to make sure the database is current.
227 * @return int
228 */
229 function getNumImages() {
230 $result = query_single_row("SELECT count(*) FROM ".prefix('images'));
231 return array_shift($result);
232 }
`
Thanks a lot. Now i'll give a try to your tips. Indeed i'm looking for a function that returns total numbers of images in the whole gallery, as shown in the gallery stats on the admin page. There it works, i hoped there was something similare for the templates.
If u look at my pages, u'll find that i did 26 albums (A, B, C, etc.) to make a gallery browsable by the starting letter of an image's name. So a function that returns total numbers of images in all allbums would be nice for me.
Thanks a lot and please excuse my english, I'm from Italy
hi,
I'm looking for a function like getNumImages() but I would like to exclude images from unpublished albums, is it possible ?
in my template, I use this code
[code]
[/code]
I have a lot of unpublished albums (images and docs used in a CMS, files are shared between the CMS and ZP). Around 60% of images are in unpublished albums (± 2500 images)
thanks
ps: sorry for my english, I'm french
I haven't tried yet, but if you are logged in there are no "unpublished" albums/images. The admin sees them all.
Actually getNumImages() gets only the image count of the current selected album.
You could try instead using the gallery class method $_zp_gallery->getNumImages() that gets the count of all images of your gallery.
thanks acrylian
I've tried but the count is the same with $_zp_gallery->getNumImages()
I tried to see with orther browsers, clean all cookies, history, etc... but I have the total of images (published and unpublished albums)
I don't know if the problem is coming from my computer or not, you can see my gallery (still under construction) here :
http://www.bilin-village.org/photos/
1813 images in 18 published albums ... and 4816 in all abums
ok thanks, I'll check it... and thanks for zenphoto, really nice "tool"... I could manage to include albums and recent images in other pages from my website (powered by Plume CMS)
Please "pardonnez moi" OT..
Hi macalter, thanks for your good words. That was a site I did a lot time ago. I programmed to translate it into english but i never did it...
To make subtitles to image thumbnails I symply made a div beneath the div with the thumbnail with in it. A little adjustament by CSS and it worked very fine
hi,
I've updated my ZP install with the latest nighly version (5/06) and tried $gallery->getNumImages(true) but the count is still the total of all images (I'm not logged on the gallery)... must I uncheck "visible" for images in unpublished albums ?
Gallery (http://www.bilin-village.org/photos/) :
Admin Tool (Gallery Stats)