I experienced some problems with the NextGen Gallery widget showing random images on http://www.metal-nights.de. There were simply no images showing up any more – the imagerotator flash keeps loading forever.
The reason for this were too many images when chosing “all images” as source for the rotator. The PHP callback providing the XML “image playlist” for the imagerotator.swf was empty because of out of memory-issues. This was the case if there were more than 1600 images in the database. The query delivered a fully parsed result set which was simply too large.
If you do not want to get rid of all your images, the only way to solve this issue is to limit the result set:
- open wp-content/plugins/nextgen-gallery/xml/imagerotator.php for editing
- look for
$thepictures = $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 ORDER BY tt.{$ngg_options['galSort']} {$ngg_options['galSortDir']} ");
- change to
$thepictures = $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 ORDER BY RAND() LIMIT 100;"); //tt.{$ngg_options['galSort']} {$ngg_options['galSortDir']} ");
This will return 100 random sorted images. This will be enough for about 10 minutes displaying the page without reload. You may even reduce the number to about 20.
The plus is that your page will speed up.
Enjoy.

