With this plugin can use Photocols gallery on your Coppermine site. This very nice addon, and I modified original script too for more photos. :)
I optimized this plugin for faster load, and can use thumbnails too. Can use all settings of this script (overlay, font size, rows, columns) by admin panel (see my scereenshot).
Demo on my photo site. :)
-------------------------
Update 1.x to 1.2:
- download PHC_Update_1.1_to_1.2.zip
- unpack it
- replace codebase.php and readme.txt in plugins/photocols folder
-------------------------
Changelog:
1.2:
fixed restriction mode in sql query
1.1:
add group policies parameter (thanks for wilk and André)
1.0:
Initial version
Looks great! Thanks for your contributions!
Plugin looks good, however it completely ignores group policies.
Plugin use approved and video filter only, see this query (for random selection) from codebase.php:
$photocols_query = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p LEFT JOIN {$CONFIG['TABLE_ALBUMS']} as a ON a.aid = p.aid WHERE filename like '%.jpg'$orifilter AND approved = 'YES' AND filename not like 'youtube_%' $photocols_FORBIDDEN_SET $META_ALBUM_SET ORDER BY RAND() LIMIT $photocolslimit";
If you need, add more parameters too.
Replacing
WHERE
with
$RESTRICTEDWHERE
should fix the permission issue.
You maybe have to change the alias of the albums table to "r" instead of "a" if an SQL issue occurs.
I changed WHERE to $RESTRICTEDWHERE, but I get a critical error.. :( What's my problem?
Line has changed too from this:
$photocols_query = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p LEFT JOIN {$CONFIG['TABLE_ALBUMS']} as a ON a.aid = p.aid WHERE filename like '%.jpg'$orifilter AND approved = 'YES' AND filename not like 'youtube_%' $photocols_FORBIDDEN_SET $META_ALBUM_SET ORDER BY RAND() LIMIT $photocolslimit";
to this:
$photocols_query = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p LEFT JOIN {$CONFIG['TABLE_ALBUMS']} ON {$CONFIG['TABLE_ALBUMS']}.aid = p.aid $RESTRICTEDWHERE filename like '%.jpg'$orifilter AND approved = 'YES' AND filename not like 'youtube_%' $photocols_FORBIDDEN_SET $META_ALBUM_SET ORDER BY RAND() LIMIT $photocolslimit";
result this, 'Where' nowhere...:
SELECT * FROM cpg1411_pictures AS p LEFT JOIN cpg1411_albums ON cpg1411_albums.aid = p.aid filename like '%.jpg' AND pwidth < pheight AND approved = 'YES' AND filename not like 'youtube_%' ORDER BY RAND() LIMIT 20
$RESTRICTEDWHERE is there on global line of course. I attached my modded file, include a print_r for sql comment debug.
Quote from: mykee on August 27, 2014, 08:26:45 PM
$RESTRICTEDWHERE is there on global line of course.
Additionally, add
get_meta_album_set();
somewhere before the first use of
$RESTRICTEDWHERE.
Thanks for help, I updated codebase.php for group policies (I will update this for my other plugins soon)
Updated plugin for restricted mode. See first post for new versions.