forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: Αndré on June 24, 2014, 12:21:01 pm

Title: Auto tag plugin for cpg1.5.x (automatically add existing keywords to pictures)
Post by: Αndré on June 24, 2014, 12:21:01 pm
This plugin has been created based on a feature request (http://forum.coppermine-gallery.net/index.php/topic,74611.0.html):
Example: I upload a photo of a church, and write the word "church" in the title or the description. Then cpg automatically scans for every word in the title and description fields, and check if one of those words already exist in the tag keyword list.
If the tag "church" already exists, it will be automatically added as a tag keyword for that photo.

It works exactly as requested. The "keyword list" is a list of all keywords that are added to pictures in your gallery. There's no configuration. The plugin checks for keywords each time you edit file information (editpics.php / edit_one_pic.php).
Title: Re: Auto tag plugin for cpg1.5.x (automatically add existing keywords)
Post by: phill104 on June 24, 2014, 12:25:45 pm
Great work on this. I think is a really useful plugin. In SEO terms tags are becoming ever more important.
Title: Re: Auto tag plugin for cpg1.5.x (automatically add existing keywords to pictures)
Post by: flapane on June 24, 2014, 11:21:22 pm
Thanks, it works great and eases the process of adding photo details a lot.

My feedback:
Maybe the keyword's first letter should be uncapitalized, just in case it's at the beginning of a phrase or if it's a noun like in german.
I don't know if utf_strtolower() is a function which has already been defined in cpg core, but if I type "Chiesa" in the title, the result keyword is "Chiesa". I wonder whether "chiesa" should have been the expected result?

Dynamic suggestion (cfr. with Simple Tags for WP) would be a great feature in v1.6, even if I'm afraid it would require jquery.
Title: Re: Auto tag plugin for cpg1.5.x (automatically add existing keywords to pictures)
Post by: Αndré on June 25, 2014, 12:05:50 am
Maybe the keyword's first letter should be uncapitalized
That's a matter of taste IMHO. Some people like to have the keyword in lowercase, others like to have them as entered. An earlier revision of that plugin used to set the keywords in lowercase. This might be configurable.
Title: Re: Auto tag plugin for cpg1.5.x (automatically add existing keywords to pictures)
Post by: mitko on July 09, 2014, 08:21:30 pm
Hi Andre! Is it okay to use this plugin if number of tags us quite large? I.e. thousand etc
Title: Re: Auto tag plugin for cpg1.5.x (automatically add existing keywords to pictures)
Post by: Αndré on July 09, 2014, 09:42:50 pm
Sorry, but I don't get what you're asking for.
Title: Re: Auto tag plugin for cpg1.5.x (automatically add existing keywords to pictures)
Post by: mitko on July 13, 2014, 10:06:01 pm
I worry about gallery performance, as i understand it will search among the existing tags during every image editing, what if the number of tags would be really high (i.e. 1-2 thousand) would you recommend to use the plugin in this case?
Title: Re: Auto tag plugin for cpg1.5.x (automatically add existing keywords to pictures)
Post by: Αndré on July 13, 2014, 10:17:50 pm
I haven't tested that, but it shouldn't affect the overall performance significantly. I assume the number of existing pictures will affect the performance more than the number of different keywords. Feel free to post your results (have a look at the debug output while editing - actually, directly after you submitted the form - a picture or several pictures). If you edit several pictures at a time (editpics.php), the plugin only searches (i.e. query the database) for existing pictures once when submitting the form.
Title: Re: Auto tag plugin for cpg1.5.x (automatically add existing keywords to pictures)
Post by: mitko on July 24, 2014, 02:11:07 pm
Hi Andre!

Debug logs are attached.
Also find the issue - plugin doesn't work for keywords separated by "space".
And additionally feature request - is it possible to keep it for single-edit page (not for multiple-edit)?
Title: Re: Auto tag plugin for cpg1.5.x (automatically add existing keywords to pictures)
Post by: mitko on July 24, 2014, 02:14:35 pm
Sorry, i clarify: if one keyword has space inside i.e. Great Britain - doesn't work.
Title: Re: Auto tag plugin for cpg1.5.x (automatically add existing keywords to pictures)
Post by: Αndré on July 25, 2014, 11:49:36 am
Debug logs are attached.
Page query time is ~ 100ms for single and multiple files edit. Looks good to me.

Also find the issue - plugin doesn't work for keywords separated by "space".
Correct, as the initial feature request was
scans for every word in the title and description fields
and words are separated by spaces ;) This could be changed by inverting the check, i.e. check if already existing keywords occur in the title and description.

is it possible to keep it for single-edit page (not for multiple-edit)
Should be possible, but I haven't checked that yet. I'll have a look when I try to fix the keywords with spaces issue.