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] 2 3   Go Down

Author Topic: Email users on new comments  (Read 68496 times)

0 Members and 1 Guest are viewing this topic.

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 947
  • +Tinyportal Support team.
Email users on new comments
« on: March 01, 2011, 07:31:17 pm »

Email users on new comments is a feature that I'd love to see built into coppermine.  Ideal for photographic communities.

I just noticed this post by Andre,  http://forum.coppermine-gallery.net/index.php/topic,70352.msg346215.html#msg346215  And was wondering

1: If this mod will work ok with coppermine bridged with SMF2.
2: Is it configurable. Would my members be able to turn the notifications on, or off.

Any ideas Andre?

Would love someone to make this a stand alone plugin. ;)
Logged
Running SMF 2.1.4  / Tinyportal 3.0.0, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Email users on new comments
« Reply #1 on: March 02, 2011, 09:23:30 am »

Should be quite easy to make it compatible to bridged galleries. If I'd modify the code can you test it for me? Regarding the on/off toggle I think this should too much for a simple mod and should be accomplished by the person who creates the plugin :)
Logged

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 947
  • +Tinyportal Support team.
Re: Email users on new comments
« Reply #2 on: March 02, 2011, 10:00:05 am »

Andre.  Thanks, Sure I'll test it. 

I'll use one of my test sites to check it on first. ;)
Logged
Running SMF 2.1.4  / Tinyportal 3.0.0, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Email users on new comments
« Reply #3 on: March 02, 2011, 10:16:10 am »

Please try the following. Open db_input.php, find
Code: [Select]
            if ($CONFIG['email_comment_notification'] && !USER_IS_ADMIN ) {
                $mail_body = "<p>" . bb_decode(process_smilies($msg_body, $CONFIG['ecards_more_pic_target'])) . '</p>' . $LINEBREAK .$lang_db_input_php['email_comment_body'] . ' ' . $CONFIG['ecards_more_pic_target'] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . $redirect;
                cpg_mail('admin', $lang_db_input_php['email_comment_subject'], make_clickable($mail_body));
            }
and below, add
Code: [Select]
            $result = cpg_db_query("SELECT filename, title, owner_id FROM {$CONFIG['TABLE_PICTURES']} WHERE pid = $pid LIMIT 1");
            $picture = cpg_db_fetch_rowset($result);
            mysql_free_result($result);
            if ($picture[0]['owner_id'] && $picture[0]['owner_id'] != USER_ID) {
                global $cpg_udb;
                $result = cpg_db_query("SELECT ".$cpg_udb->field['username']." AS user_name, ".$cpg_udb->field['email']." AS user_email FROM ".$cpg_udb->usertable." WHERE ".$cpg_udb->field['user_id']." = {$picture[0]['owner_id']} LIMIT 1");
                $owner = cpg_db_fetch_rowset($result);
                mysql_free_result($result);
                $title = $picture[0]['title'] ? $picture[0]['title'] : $picture[0]['filename'];
                $mail_body = "Your picture '$title' has received a new comment. You can see it at " . ' ' . $CONFIG['ecards_more_pic_target'] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . $redirect;
                cpg_mail($owner[0]['user_email'], $lang_db_input_php['email_comment_subject'], make_clickable($mail_body));
            }
Logged

EC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Fotonicamente
Re: Email users on new comments
« Reply #4 on: March 02, 2011, 12:36:37 pm »

I tested too!. My gallery is phpBB3 bridged. It works apart the title which gives null result.
elena
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Email users on new comments
« Reply #5 on: March 02, 2011, 01:24:48 pm »

the title which gives null result.
Try to replace
Code: [Select]
$title = $picture[0]['title'] ? $picture[0]['title'] : $picture[0]['filename'];with
Code: [Select]
$title = $picture[0]['title'] != '' ? $picture[0]['title'] : $picture[0]['filename'];
Logged

EC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Fotonicamente
Re: Email users on new comments
« Reply #6 on: March 02, 2011, 01:36:20 pm »

:-( It doesn't work
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Email users on new comments
« Reply #7 on: March 02, 2011, 01:43:08 pm »

Please post some information if you expect help:
- Post the content of the received mail
- Post a link to the picture you tested
- Does the picture you're testing with has a title?
Logged

EC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Fotonicamente
Re: Email users on new comments
« Reply #8 on: March 02, 2011, 01:52:51 pm »

I'm sorry. I made a stupid mistake. The first picture I tested has a simple title "...".
I use a picture with a title and your code works, and it returns correctly a message

La tua foto 'Punti di vista' ha ricevuto un nuovo commento. Puoi leggerlo al link seguente http://www.fotonicamente.it/Gallery/displayimage.php?pid=5193


thanks again
elena
Logged

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 947
  • +Tinyportal Support team.
Re: Email users on new comments
« Reply #9 on: March 02, 2011, 08:32:22 pm »

Andre, thanks.  Tested and working. 

Shame about users not being able to turn them Off / On though..  I don't think I'll be able to use this mod without.  Some members won't want to get emails.

Believe me, if I had a clue about coding a plug then I would in a flash.  I'll see if one of my coder friends can sort this for me, and report back. ;)
Logged
Running SMF 2.1.4  / Tinyportal 3.0.0, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Email users on new comments
« Reply #10 on: March 03, 2011, 09:53:47 am »

I've ported the modpack version of the notification system some time back. However it's a mod and not a plugin and it's not prepared for posting though. But users can turn on/ off notifications in general and for certain images.

When I'm in coding mood I'll either write some instructions on how to mod your gallery or I'll see if a plugin version will work. But you can't expect from Αndré to code such a featurerich enhancement over night ;)
 

EC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Fotonicamente
Re: Email users on new comments
« Reply #11 on: March 03, 2011, 10:27:20 am »


Many features of the mod you did for coppermine 1.4... were very useful. The notification also of comments from other users, the private messagging, the avatar...which worked also in bridged gallery.
Are you going to do such a mod also for the latest version of coppermine?
thanks
elena
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Email users on new comments
« Reply #12 on: March 03, 2011, 12:45:39 pm »

As far as I've seen a user has ported the PM plugin to 1.5. This I've written as a replacement for the modpack version. I do not know if it'll work as I've not tested it so far.

Avatars... some avatar plugin is around there. Therefore I won't spend any time there (again I do not know neither if that plugin is working nor what it's doing exactly).

A 'modpack' I won't do again. Hopefully a good bunch of the features as plugins.

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 947
  • +Tinyportal Support team.
Re: Email users on new comments
« Reply #13 on: March 03, 2011, 06:41:15 pm »


When I'm in coding mood I'll either write some instructions on how to mod your gallery or I'll see if a plugin version will work. But you can't expect from Αndré to code such a featurerich enhancement over night ;)
 

Stramm, thanks that would be great.  A plugin just containing the "Email users on new comments" mod, and a on / off check box, so my members can choose would be fantastic.
Logged
Running SMF 2.1.4  / Tinyportal 3.0.0, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

EC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Fotonicamente
Re: Email users on new comments
« Reply #14 on: March 14, 2011, 10:24:05 am »

Is there the possibility to notify also commenters and not only the owner about the discussion/comments posted on a photo?
Thanks a lot
Elena
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Email users on new comments
« Reply #15 on: April 29, 2011, 06:36:45 pm »

Is there the possibility to notify also commenters and not only the owner about the discussion/comments posted on a photo?
You can say a big 'Thank you' to jmcreis, who was ready to pay to put this modification to the top on my to-do list :)

Replace my first modification with the following code:
Code: [Select]
        $result = cpg_db_query("SELECT filename, title, owner_id FROM {$CONFIG['TABLE_PICTURES']} WHERE pid = $pid LIMIT 1");
        $picture = cpg_db_fetch_rowset($result);
        mysql_free_result($result);
        if ($picture[0]['owner_id'] != USER_ID) {
            $user_id_array[] = $picture[0]['owner_id'];
        }

        $result = cpg_db_query("SELECT author_id FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid = $pid AND author_id != 0");
        while ($row = mysql_fetch_assoc($result)) {
            if ($row['author_id'] != USER_ID) {
                $user_id_array[] = $row['author_id'];
            }
        }
        mysql_free_result($result);

        if (count($user_id_array)) {
            global $cpg_udb;
            $title = $picture[0]['title'] ? $picture[0]['title'] : $picture[0]['filename'];
            $mail_body = "Your picture '$title' has received a new comment. You can see it at " . ' ' . $CONFIG['ecards_more_pic_target'] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . $redirect;
            $result = cpg_db_query("SELECT ".$cpg_udb->field['email']." AS user_email FROM ".$cpg_udb->usertable." WHERE ".$cpg_udb->field['user_id']." IN (".implode(', ', $user_id_array).")");
            while ($row = mysql_fetch_assoc($result)) {
                cpg_mail($row['user_email'], $lang_db_input_php['email_comment_subject'], make_clickable($mail_body));
            }
            mysql_free_result($result);
        }
Logged

EC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Fotonicamente
Re: Email users on new comments
« Reply #16 on: April 29, 2011, 07:13:44 pm »

Thanks! Thanks a lot to both. It works fine
Elena
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Email users on new comments
« Reply #17 on: May 11, 2011, 03:27:27 pm »

hi,

that's what I had in mind for quite a while. Is it possible not only the title but also with the Thumbinal to pass in the e-mail?

CMFA
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Email users on new comments
« Reply #18 on: May 14, 2011, 08:27:03 pm »

There are 2 possibilities to include the thumbnail:
1.) Attach it to the email
2.) Embed the image in the email (= use it directly from your gallery)


Which one do you prefer? Afaik the ecard function just embeds the image, so maybe we should do it here the same way.
Logged

cmfa

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 226
Re: Email users on new comments
« Reply #19 on: May 15, 2011, 02:17:49 pm »

hi,

yes, as in the e-card would be good.

VG
Logged
Pages: [1] 2 3   Go Up
 

Page created in 0.028 seconds with 21 queries.