Member
Member
dazkeirle   12-02-2010, 14:07
#1

Hi there,

New to Zenphoto but am already finding it very refreshing compared to crappermine.

Anyway I had assumed that displaying the number of albums and images within an album in the album description was not possible, as thumbs etc. are generated on the fly, however...

I went to the showcase and saw this site: http://www.tuscanypictures.com/

This site is clearly showing the number of sub albums and pictures for each album.

How do achieve this? Is it a plugin or a custom hack?

Thanks

Administrator
Administrator
acrylian   12-02-2010, 14:38
#2

Neither a hack nor a plugin. Standard theme functions you of course have to add to your theme pages if you wish to use them:
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetNumImages
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetNumSubalbums

Member
Member
dazkeirle   12-02-2010, 15:03
#3

many thanks for speedy reply. I'll give that a shot.

So far Zenphoto has become my favorite web app of 2010. I just regret not trying it before.

Member
Member
dazkeirle   12-02-2010, 15:22
#4
Member
Member
dazkeirle   16-02-2010, 11:23
#5

Ok so that worked great, hoever I'm looking to expand on this.

I can easily get it to give me the totals of the immediate album, however if an album has sub albums and they contain images there is no visibility of this.

Is it possible (and a standard feature) to extract the sum of all images in the child albums of an album. So "this folder contains 1000 images in 4 sub albums" ?

Is it possible to print the total of all images currently in the database / folder?

Thanks

Administrator
Administrator
acrylian   16-02-2010, 11:41
#6
  1. Number of subalbums: http://www.zenphoto.org/documentation/classes/Album.html#methodgetSubAlbums (note this will be deprecated in 1.2.9 and getAlbums() should be used instead.)

To get the total number of images within an album and its subalbums you have either to create a mysql query to get that or use the object model.

  1. Number of all images in total: http://www.zenphoto.org/documentation/classes/Gallery.html#methodgetNumImages
Member
Member
dazkeirle   16-02-2010, 12:46
#7

Again many thanks

Member
Member
dazkeirle   16-02-2010, 16:04
#8
  1. Number of all images in total: http://www.zenphoto.org/documentation/classes/Gallery.html#methodgetNumImages

Would you be so kind as to give me a single line of php which would output this.

My php is limited atm, and while i'm trying to learn i'm running into syntax errors.

Administrator
Administrator
acrylian   16-02-2010, 16:32
#9

Like this: $totalnumberimages = $_zp_gallery->getNumImages();

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.