WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] [Plugin: NextGEN Gallery] Random Images funtion only get from certain galleries?

[Resolved] [Plugin: NextGEN Gallery] Random Images funtion only get from certain galleries?

  • 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

Viewing 1 replies (of 1 total)
  • 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 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: NextGEN Gallery] Random Images funtion only get from certain galleries?’ is closed to new replies.
Skip to toolbar