Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Auto tag plugin for cpg1.5.x (automatically add existing keywords to pictures)  (Read 10837 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764

This plugin has been created based on a feature request:
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).
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me

Great work on this. I think is a really useful plugin. In SEO terms tags are becoming ever more important.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 251
    • Flavio's page

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.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764

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.
Logged

mitko

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 119
    • World of Lighthouses

Hi Andre! Is it okay to use this plugin if number of tags us quite large? I.e. thousand etc

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764

Sorry, but I don't get what you're asking for.
Logged

mitko

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 119
    • World of Lighthouses

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?

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764

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.
Logged

mitko

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 119
    • World of Lighthouses

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)?

mitko

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 119
    • World of Lighthouses

Sorry, i clarify: if one keyword has space inside i.e. Great Britain - doesn't work.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.