Advanced search  

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]

Pages: [1]   Go Down

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

0 Members and 1 Guest are viewing this topic.

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • 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: 947
  • +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.1.4  / Tinyportal 3.0.0, bridged with Coppermine 1.6.25, 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: 785
    • 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: 785
    • 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: 785
    • 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: 785
    • 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

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 947
  • +Tinyportal Support team.
Re: Email Comments Plugin for CPG 1.5.x
« Reply #9 on: November 17, 2018, 01:35:23 pm »

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

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Re: Email Comments Plugin for CPG 1.5.x
« Reply #10 on: November 17, 2018, 02:46:37 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.
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: 785
    • GMC Design Photo Gallery
Re: Re: Re: Email Comments Plugin for CPG 1.5.x
« Reply #11 on: November 17, 2018, 03:15:09 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.
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: 947
  • +Tinyportal Support team.
Re: Email Comments Plugin for CPG 1.5.x
« Reply #12 on: November 17, 2018, 04:14:04 pm »

Thank you Greg.  Installed.  ;)
Logged
Running SMF 2.1.4  / Tinyportal 3.0.0, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

MG

  • Contributor
  • Coppermine newbie
  • ***
  • Country: pl
  • Offline Offline
  • Gender: Male
  • Posts: 12
    • om
Re: Email Comments Plugin for CPG 1.5.x
« Reply #13 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
Logged
Forum Vbulletin 4.1.11  / Portal vBadvanced CMPS v4.2.0, bridged with CPG 1.5.46, cpmfetch 2.0.0

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Email Comments Plugin for CPG 1.5.x
« Reply #14 on: February 01, 2019, 08:17:20 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
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

MG

  • Contributor
  • Coppermine newbie
  • ***
  • Country: pl
  • Offline Offline
  • Gender: Male
  • Posts: 12
    • om
Re: Email Comments Plugin for CPG 1.5.x
« Reply #15 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
Logged
Forum Vbulletin 4.1.11  / Portal vBadvanced CMPS v4.2.0, bridged with CPG 1.5.46, cpmfetch 2.0.0

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Email Comments Plugin for CPG 1.5.x
« Reply #16 on: February 02, 2019, 01:08:52 am »

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.
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.069 seconds with 20 queries.