Getting the total number of images in whole gallery

So I seem to be having a problem getting a number of all the images in the entire gallery. First I tried using getTotalImagesIn($_zp_gallery) and it gave the error:

`Fatal error: Call to undefined method Gallery::getSubalbums() in /home/web29205/domains/archlinuxgallery.com/public_html/zenphoto/zp-core/template-functions.php on line 1712`

Then I tried to use getNumImages($_zp_gallery) and it gives this error:

`Fatal error: Call to a member function isDynamic() on a non-object in /home/web29205/domains/archlinuxgallery.com/public_html/zenphoto/zp-core/template-functions.php on line 1691`

Am I doing something wrong and is there any easier way to do this?

Thanks,
kagutsuchi

EDIT: Never mind, I used the getNumImages() from the Gallery class and that worked perfectly!

Comments

  • Hi,

    I am also seeing this error message when I updated versions. Could you please elaborate on how you resolved the issue with getNumImages()?

    Thanks,
    Marc
  • acrylian Administrator, Developer
    Use the gallery object `$_zp_gallery->getNumImages()`. See also the object model tutorial about that.
  • Hi,

    Sorry but I'm a real noob.

    I checked out the tutorial at http://www.zenphoto.org/2010/02/zenphotos-object-model-framework/. However, I'm not sure what I need to do. Do I need to go to the theme file editor and update the code? If so, which code am I replacing and if so, what code am I replacing it with.

    Are there any step-by-step instructions?

    Thanks!
  • acrylian Administrator, Developer
    I can't answer this, you have to edit there where your error occurs. Where that is I can't answer because you provide no info about anyhting. Probably you are using an outdated third party theme.
  • Btw, I did use what acrylian posted above. :)
  • Ok...you can see the error message here:
    http://www.marilynandmarc.com/miami09/index.php?album=Oscar

    The error says:
    Fatal error: Call to undefined method Album::getSubalbums() in /home5/marilyn4/public_html/miami09/zp-core/template-functions.php on line 484

    In addition, if I go to the Themes tab, I see:
    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home5/marilyn4/public_html/miami09/zp-core/admin-functions.php on line 2391

    I'm assuming I have to change one of the files in the Theme File Editor...I just have problems trying to pinpoint the actual line where the problem occurs.

    I hope this helps in providing more info about the problem.

    album.php
    404.php
    archive.php
    image.php
    index.php
    search.php
    slideshow.php
    contact.php
    theme_description.php
    themeoptions.php
    register.php
    password.php
    Style sheets (.css)
    slideshow.css
    zen.css
  • Oh...one thing I did want to add is I saw these error messages AFTER updating to the most recent version of Zenphoto.
  • acrylian Administrator, Developer
    The `getSubAlbums()` method is deprecated. You have apparently not updated correctly as that method has been replaced with `getAlbums()` method on that line in template-function.php. Please do a reinstall.
Sign In or Register to comment.