Email Comments Plugin for CPG 1.5.x Email Comments Plugin for CPG 1.5.x
 

News:

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

Main Menu

Email Comments Plugin for CPG 1.5.x

Started by gmc, April 17, 2015, 02:54:59 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

gmc

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)
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

lurkalot

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.
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

cmfa

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

gmc

Quote from: lurkalot 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.

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

Quote from: cmfa 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

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
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

cmfa

hi grec,

see picture attached

gmc

#5
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:

        $mail_body = ($row['user_id'] == $picture[0]['owner_id']) ? $mail_owner . $mail_message : $mail_author . $mail_message;

and replace with:

        $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.)
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

gmc

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
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

cmfa

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

gmc

Quote from: cmfa on April 19, 2015, 12:39:46 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:

      // 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
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

lurkalot

Anyone know if this plugin is compatible with 1.6.x ? 
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

gmc

Quote from: lurkalot on November 17, 2018, 01:35:23 PM
Anyone know if this plugin is compatible with 1.6.x ?
Needs minor tweaks... and I have 2 changes below/above that aren't in the package... Will be ready shortly.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

gmc

Quote from: gmc on November 17, 2018, 02:46:37 PM
Needs minor tweaks... and I have 2 changes below/above that aren't in the package... Will be ready shortly.
CPG 1.6 compatible version (v1.2) posted here: http://forum.coppermine-gallery.net/index.php/topic,79541.0.html
V1.2 requires CPG 1.5.42 as minimum version - compatible with CPG 1.6 and PHP 7.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

lurkalot

Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

MG

Great mod gmc and works very well.
BTW
Is possible to make some changes. I mean, instead of email, create a Private Message on forum?

all the best
MG
Forum Vbulletin 4.1.11  / Portal vBadvanced CMPS v4.2.0, bridged with CPG 1.5.46, cpmfetch 2.0.0

gmc

Quote from: MG on February 01, 2019, 07:42:05 PM
Great mod gmc and works very well.
BTW
Is possible to make some changes. I mean, instead of email, create a Private Message on forum?

all the best
MG
Of course anything is possible... However there are many different 'forum' packages out there - CPG doesn't include one by default.
Not knowing what you are going to (and possibly not having it to be able to investigate/test), best I can say is the plugin code is there to be changed by a willing contributor!

I'd suggest starting with the CPG 1.6/PHP7 compatible version for any changes.
CPG 1.6 compatible version (v1.2) posted here: http://forum.coppermine-gallery.net/index.php/topic,79541.0.html
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

MG

Thanks for reply gmc,

So it's better for me if I update to the latest version of CPG and then start modifications? I do not know much about it, I give a few details below about my forum and server.
I can provide a test account if required.

Some Info:
Forum version: Forum Vbulletin 4.1.11  / Portal vBadvanced CMPS v4.2.0, bridged with CPG 1.5.46, cpmfetch 2.0.0
GD 2.X
Database Server: MySQL
MySQL 5.5.31
Php 5.3.24
Server: Apache
Forum Vbulletin 4.1.11  / Portal vBadvanced CMPS v4.2.0, bridged with CPG 1.5.46, cpmfetch 2.0.0

gmc

Quote from: MG on February 01, 2019, 09:28:05 PM
Thanks for reply gmc,

So it's better for me if I update to the latest version of CPG and then start modifications? I do not know much about it, I give a few details below about my forum and server.
I can provide a test account if required.

Some Info:
Forum version: Forum Vbulletin 4.1.11  / Portal vBadvanced CMPS v4.2.0, bridged with CPG 1.5.46, cpmfetch 2.0.0
GD 2.X
Database Server: MySQL
MySQL 5.5.31
Php 5.3.24
Server: Apache
While you certainly can upgrade to CPG 1.6 - my comment meant to use the CPG 1.6 compatible version of the plugin (which will run on CPG1.5.42 or higher.)  The changes made allow it to continue to work with CPG 1.6 and PHP7.

I don't have any experience with VBulletin other than as a user... would have to determine what code to invoke to send a PM - and add that code to the plugin.  Since you are bridged - we already have the forum user information to send to - the forum user table is what CPG is using.
I'd suggest an option of email or PM - so a single plugin can do both - and of course the PM code would be different for each bulletin system supported - start with yours of course - maybe others can contribute for other forums.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money