forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: mykee on July 11, 2014, 02:45:01 pm

Title: Photocols plugin
Post by: mykee on July 11, 2014, 02:45:01 pm
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

Title: Re: Photocols plugin
Post by: Jeff Bailey on July 11, 2014, 11:23:06 pm
Looks great! Thanks for your contributions!
Title: Re: Photocols plugin
Post by: wilk on August 26, 2014, 07:56:03 pm
Plugin looks good, however it completely ignores group policies.
Title: Re: Photocols plugin
Post by: mykee on August 26, 2014, 08:33:17 pm
Plugin use approved and video filter only, see this query (for random selection) from codebase.php:
Code: [Select]
$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.
Title: Re: Photocols plugin
Post by: Αndré on August 27, 2014, 10:41:48 am
Replacing
Code: [Select]
WHEREwith
Code: [Select]
$RESTRICTEDWHEREshould 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.
Title: Re: Photocols plugin
Post by: mykee on August 27, 2014, 08:26:45 pm
I changed WHERE to $RESTRICTEDWHERE, but I get a critical error.. :( What's my problem?

Line has changed too from this:
Code: [Select]
        $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:
Code: [Select]
        $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...:
Code: [Select]
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.
Title: Re: Photocols plugin
Post by: Αndré on August 28, 2014, 09:00:14 am
$RESTRICTEDWHERE is there on global line of course.

Additionally, add
Code: [Select]
get_meta_album_set();somewhere before the first use of $RESTRICTEDWHERE.
Title: Re: Photocols plugin
Post by: mykee on August 31, 2014, 02:50:27 pm
Thanks for help, I updated codebase.php for group policies (I will update this for my other plugins soon)
Title: Re: Photocols plugin
Post by: mykee on September 27, 2014, 10:33:53 am
Updated plugin for restricted mode. See first post for new versions.