Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Email Comments Plugin for CPG 1.5.x  (Read 3161 times)

0 Members and 1 Guest are viewing this topic.

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 720
    • GMC Design Photo Gallery
Email Comments Plugin for CPG 1.5.x
« on: April 17, 2015, 02:54:59 am »

This plugin adds the ability to email comments left in the gallery to the photo owner, and optionally to others that have commented on the same photo.
The message sent is configurable, as is the option to embed the thumbnail photo in the email.
Sample email content is displayed on configuration page reflecting the current settings.
Emails are sent when the comment is left if no approval is needed - or when approved if approval is required.
View the 'readme' at: http://greggallery.gmcdesign.com/plugins/email_comments/readme.php

You need at least cpg1.5.28 to install/use this plugin - as the plugin action points used were added in that release.

This plugin is based on requests/ideas/code/information in this thread: http://forum.coppermine-gallery.net/index.php/topic,71072.0.html

Comments welcome... (pun intended...  :) )

Thanks!
Greg (gmc)

V1.1 added:
   Corrected detection of owner reported by cmfa (wrong prefix used in message)
   - message: http://forum.coppermine-gallery.net/index.php/topic,78163.msg378160.html#msg378160
    Added option to use persons username in constructed email to individually address
    - token {username} can be used in email_owner, email_author, and email_textx fields on config page
    - updated picture of config for non-coppermine viewing (most of the size difference)
« Last Edit: April 18, 2015, 01:19:59 am by gmc »
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 824
  • +Tinyportal Support team.
Re: Email Comments Plugin for CPG 1.5.x
« Reply #1 on: April 17, 2015, 08:32:27 am »

Greg, I just installed it on my site.  Must say you've done a great job on this, looks fantastic. (Big thumbs up)

Been waiting for this plugin to come for a long time, and no more editing files each time I update the gallery.

Thank you so much.

I'll see how my members get on with it, and report back.
Logged
Running SMF 2.0.13  / Tinyportal 1.2, bridged with Coppermine 1.5.34, plus cpmfetch 2.0.0

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Email Comments Plugin for CPG 1.5.x
« Reply #2 on: April 17, 2015, 09:33:19 am »

hi,
good work,
"plugin_email_comments_owner" is not sent to me.
Had it been set up in the db_input the admin is also informed of comments, this is possible with the plugin and the author of the image can be addressed by name.

cmfa
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 720
    • GMC Design Photo Gallery
Re: Re: Email Comments Plugin for CPG 1.5.x
« Reply #3 on: April 17, 2015, 01:51:03 pm »

Greg, I just installed it on my site.  Must say you've done a great job on this, looks fantastic. (Big thumbs up)

Been waiting for this plugin to come for a long time, and no more editing files each time I update the gallery.

Thank you so much.

I'll see how my members get on with it, and report back.

lurkalot,
You're welcome... glad you like it. let me know how it goes...

hi,
good work,
"plugin_email_comments_owner" is not sent to me.
Had it been set up in the db_input the admin is also informed of comments, this is possible with the plugin and the author of the image can be addressed by name.

cmfa

cmfa,
 "plugin_email_comments_owner" causes email to be sent to the owner of the picture the comment was left for. (of course must be a valid email attached to the owner in the users table (cpg or bridged). 
There is already a config option "Notify admin of comments by email" in core code that will send email to the admin - so I didn't duplicate that in the plugin.  They will work together to add email notification to the gallery admin.
(or is there something this doesn't do?)

I can certainly get the name of the person to address the email too if that is what you are looking for...  possible in both standalone and bridged galleries.  Very simple change...

Let me see if there are other suggestions before I post v1.1... :)

Greg
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Email Comments Plugin for CPG 1.5.x
« Reply #4 on: April 17, 2015, 03:27:00 pm »

hi grec,

see picture attached
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 720
    • GMC Design Photo Gallery
Re: Email Comments Plugin for CPG 1.5.x
« Reply #5 on: April 17, 2015, 04:01:49 pm »

Oops... I fixed that before I posted it... but apparently had already zipped up the file...
Thanks for letting me know - as it was working fine in my gallery - I wouldn't have caught that.

In codebase.php, find:
Code: [Select]
        $mail_body = ($row['user_id'] == $picture[0]['owner_id']) ? $mail_owner . $mail_message : $mail_author . $mail_message;
and replace with:
Code: [Select]
        $mail_body = ($row['user_id'] == $picture['owner_id']) ? $mail_owner . $mail_message : $mail_author . $mail_message;
(I had changed the call to cpg_fetch_rowset to cpg_fetch_row as there was a LIMIT 1 in the SQL.. and missed removing the subscript in this statement initially...)

I'll fix that in v1.1...
If you would like to send your translated language file, I would be happy to add as well.
Coming soon...

Greg

(EDIT: change included in V1.1 now attached to first post.)
« Last Edit: April 17, 2015, 10:22:00 pm by gmc »
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 720
    • GMC Design Photo Gallery
Re: Email Comments Plugin for CPG 1.5.x
« Reply #6 on: April 17, 2015, 08:49:15 pm »

V1.1 attached to first thread:

2015-04-17 - V1.1 Updated package
                  Corrected detection of owner reported by cmfa (wrong prefix used in message)
                  - message: http://forum.coppermine-gallery.net/index.php/topic,78163.msg378160.html#msg378160
                  Added option to use persons username in constructed email to individually address
                  - token {username} can be used in email_owner, email_author, and email_textx fields on config page
                  Added updated picture of config page for viewing outside CPG
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Email Comments Plugin for CPG 1.5.x
« Reply #7 on: April 19, 2015, 12:39:46 pm »

hi greg,

I have a question when a guest gives off a comment is the normal standard of the gallery, if a user has logged in is the content of the plugin. Is that so wanted?
two small corrections I have done for me.
In the modified admin.php on line 209 removed ")" and inserted on line 183 {$ lang_plugin_email_comments ['show']}.
{$ lang_plugin_email_comments ['show']} nachgepflegt in the lang.php

vg cmfa
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 720
    • GMC Design Photo Gallery
Re: Email Comments Plugin for CPG 1.5.x
« Reply #8 on: April 19, 2015, 01:58:27 pm »

I have a question when a guest gives off a comment is the normal standard of the gallery, if a user has logged in is the content of the plugin. Is that so wanted?
If you are referring to lines 147-148:
Code: [Select]
      // get list of registered authors that have commented (exclude guest comments - we won't have an email address)
      $result = cpg_db_query("SELECT DISTINCT author_id FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid = '{$parm['pid']}' AND author_id != 0");
At this point I am looking for previous commenters to let them know about a new comment... For guest comments, I will not have an email address to send to - so I excluded them via SQL.
A guest leaving a comment will still send notification to the owner, (and others that left comments if chosen in config) - but they will not receive notifications of later comments since I don't have access to any email address (and certainly wouldn't have a verified email address).

Note that if the owner leaves a comment on their own photo as a guest - they WILL get an email as the owner... If logged in, and commenter=owner - an email is not sent to the owner (figured they should know they just left a comment...  :) )

Quote
two small corrections I have done for me.
In the modified admin.php on line 209 removed ")" and inserted on line 183 {$ lang_plugin_email_comments ['show']}.
{$ lang_plugin_email_comments ['show']} nachgepflegt in the lang.php
Updated both for next release...
Removed extra ")" and placed string "Show / Hide Plugin Settings" in language file.
(I'll make the equivalent change to line 183 in Gallery Merge line 369...)

Thanks for the feedback!
Greg
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.