WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: NextGEN Gallery] display amount of images\galleries\albums

[Resolved] [Plugin: NextGEN Gallery] display amount of images\galleries\albums

  • On the OVERVIEW page nextgen gallery tells how many images are in the database:

    At a Glance
    100 Images
    20 Galleries
    5 Albums

    Is there a way to display these infos outside the admin area?
    I´d like to use it in the templates – thinking of something like this: <?php ngg-overview(‘images’,’galleries’,’albums’) ?>

    Thanks for any help and cheers to alex for this awesome plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • This is the code you need to count the images :

    global $wpdb;
    $images    = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggpictures") );
    $galleries = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggallery") );
    $albums    = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggalbum") );

    works like a charm. Thanks a lot.

    Hi guys, this is exactly what i’m looking for but I’m no coder.

    How exactly would I go about putting this to use?

    As in a page with:

    “This site currently has X number of pics.”

    Thanks

    Muz

    This should work:

    "This site currently has <?php echo $images; ?> number of pics."

    Hi,

    Whereabouts do I add the code below ?:

    global $wpdb;
    $images = intval( $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->nggpictures”) );
    $galleries = intval( $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->nggallery”) );
    $albums = intval( $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->nggalbum”) );

    To allow me to use :

    “This site currently has <?php echo $images; ?> number of pics.”

    thanks

    Sam

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] [Plugin: NextGEN Gallery] display amount of images\galleries\albums’ is closed to new replies.
Skip to toolbar