WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: NextGEN Gallery] Random Images funtion only get from certain galleries? (2 posts)

  1. intended
    Member
    Posted 5 years ago #

    Hello,

    I would like to make the NextGen Gallery random widget (or in this case I am using the php function in my template) only pull random images from certain galleries.

    I am settings up a client area to the site where clients can type in their client code and view their photography proofs online and make their payment and such, but I do not want these photos viewable by anybody else (yes I am building a small plugin to do this using the nextgen system) but I have 6 nextgen galleries that are public for the portfolio and I only want the random image widget to pull from those 6 galleries.

    Is this possible and has anyone done it already? I could take the time to look into it myself but maybe the plugin author knows of an easy modification to make this work.

    Your help is much appreciated!

    Casey

  2. intended
    Member
    Posted 5 years ago #

    I figured it out, I modified widgets.php line #374 from

    $imageList = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 $exclude_list ORDER by rand() limit {$items}");

    to

    $imageList = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid IN ('1','2','3','4','5','6') AND tt.exclude != 1 $exclude_list ORDER by rand() limit {$items}");

    If anyone needs to do the same :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.