I thing I've found a typo in line 347 of mod_phocagallery_random_image.php it looks like follows:
Code: Select all
$image = '';
Code: Select all
$images = '';
Before the following line (building of the query) there is no check if $implodeAllowedCategoriesArray isn't an empty string (rare but possible), which in my case leads to "500 - JDatabaseMySQL::query: 1064 - You have an error in your SQL syntax; ...".
I've found also an interesting post concerning the speed of ORDER BY RAND() in big tables which could be important with some biiiig galeries and I think it may help sometimes with the query described above. The first example is broken (not proper html), so you must look at the source of the page.
EDIT:
I've tested it and it's good for LIMIT 1, not for more, and the lover ID's have bigger chance to be caught when some record was deleted or unpublished. Interesting proposition anyway.
And one thing more. I've changed last lines of the file from:
Code: Select all
} else {
$i = 0;
$output[$i] = ''; // there is no image to get it as random image
}
require(JModuleHelper::getLayoutPath('mod_phocagallery_random_image'));
?>
Code: Select all
require(JModuleHelper::getLayoutPath('mod_phocagallery_random_image'));
}
?>