• psperkins

    (@psperkins)


    Love NextGenGallery – using it on many sites. One request that I get from customers all of the time is “can you display the total number of images in each gallery?”

    Now, this seems like a simple enough request for someone who maybe knows their stuff a little better than I. I have been able to achieve it, but I feel the way I am doing it is just sort of “hack-y” and I am looking for a more graceful solution.

    As it stands now, without having to do multiple JOINs on multiple tables the only way I can get this to work it seems, is if I put an identifying word in each image description box for each image in the gallery, and then COUNT the images in the ngg_pictures table WHERE description = “whatever”

    Obviously this is an unwieldy process when adding images to a gallery, having to either run an UPDATE query in phpMyAdmin or hand punch the info into each image in the gallery. Seems like a pretty simple thing to do – like I said, for someone more adept with PHP than I – so I was wondering if there is a solution that someone else has found that will return an image count for each corresponding gallery without too much fuss? Can this be a feature request?

Viewing 1 replies (of 1 total)
  • Thread Starter psperkins

    (@psperkins)

    A little further clarification – I see that on album pages using the extend template do show gallery image counts, but I cannot figure out how to use this outside a nextgen template – like in a custom sidebar for instance, or under a post in the loop that points to a shoot with number of images shown beneath post. A site I am building does not make use of the album template at all. It’s a unique situation all around and I’ve been asked to perform some miracles.

    I see where $picturesCounter is defined in nggfunctions but I haven’t quite figured out how to use it elsewhere. I also see where echo $gallery->counter is being used in a foreach in the album template to return this value. I gotta be able to use this number in the custom sidebar PHP widget (client wants one widget per gallery with a running count of images in both galleries and albums) and I can’t figure out an easy way to do it.

    I am not a PHP master by any means, but I have a decent grasp of the fundamentals.

    Nudge, nudge, anyone? Come on….

Viewing 1 replies (of 1 total)
  • The topic ‘NextGenGallery Image Count’ is closed to new replies.