forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Emails/Notifications => Topic started by: fcarentz on December 29, 2005, 05:41:56 am

Title: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: fcarentz on December 29, 2005, 05:41:56 am
I will be updating this First post with all the updates for this Mod as I complete them or add in fixes, enhancements etc. Thus please use whatever is in this first post for your 1.4.2 Gallery. A word of caution to this tale...this is my first Coppermine Mod so please leave feedback, suggestions etc... and be merciful please. :)

Also thanks to Nibbler for stepping me in the right direction.

Purpose of the Mod: Enable your gallery users to receive notifications via email when other users leave them comments.


Updates:
12-29-05: Added Database support. Now on a picture by picture basis users can choose whether or not to be notified. This option defaults to Yes when the picture is submitted, so your users will have to edit their pics and Uncheck the notifications if they dont want to be notified.
12-29-05: Added Flood Protection. Users will only be notified once until they return to the gallery to view their comments.


(Please make sure you back up EVERYTHING before testing this Mod)


Step 1: First we have to update our Database table. To do this Run this mySQL command. This will be used to let users decide whether or not to be notified on a picture by picture basis.
Code: [Select]
ALTER TABLE `gal_pictures` ADD `notify` ENUM( 'Yes', 'No' ) DEFAULT 'Yes' NOT NULL ;
ALTER TABLE `gal_pictures` ADD `sent` INT( 11 ) NOT NULL ;



Changes in lang/english.php


Step 2:Open /lang/english.php (english in my case...you might use a different language file remember)

FIND THIS (/lang/english.php)
Code: [Select]
  'forb_ext' => 'Forbidden file extension.',//cpg1.4
AFTER IT ADD THIS
Code: [Select]
'notify_comm' => 'Notify me of comments.',//cpg1.4


Changes in editOnePic.php

Step 3: Open editOnePic.php

FIND THIS
Code: [Select]
$del_comments = isset($_POST['del_comments']) || $delete;
AFTER IT ADD THIS
Code: [Select]
$notify = isset($_POST['notify']);
NEXT FIND THIS
Code: [Select]
if ($reset_votes) $update .= ", pic_rating = '0', votes = '0'";
AFTER IT ADD THIS
Code: [Select]
if($notify) {
$update .= ", notify = 'Yes'";
}else{
$update .= ", notify = 'No'";
}


NEXT FIND THIS
Code: [Select]
// If this is the users gallery icon then check it
$isgalleryicon_selected = ($CURRENT_PIC['galleryicon']) ? 'checked="checked" ': '';
$isgalleryicon_disabled = ($CURRENT_PIC['category'] < FIRST_USER_CAT)? 'disabled="disabled" ':'';

AFTER IT ADD THIS
Code: [Select]
// If the user is being notfied already then check it.
$isnotified = ($CURRENT_PIC['notify']) == "Yes" ? 'checked="checked" ': '';


NEXT FIND THIS
Code: [Select]
<tr>
           <td width="20%" align="center"><input type="checkbox" name="galleryicon" {$isgalleryicon_selected}{$isgalleryicon_disabled}value="{$CURRENT_PIC['pid']}" class="checkbox" />{$lang_editpics_php['gallery_icon']}</td>
          <td width="20%" align="center"><input type="checkbox" name="read_exif" value="1" class="checkbox" />{$lang_editpics_php['read_exif']}</td>
          <td width="20%" align="center"><input type="checkbox" name="reset_vcount" value="1" class="checkbox" />{$lang_editpics_php['reset_view_count']}</td>
          <td width="20%" align="center"><input type="checkbox" name="reset_votes" value="1" class="checkbox" />{$lang_editpics_php['reset_votes']}</td>
          <td width="20%" align="center"><input type="checkbox" name="del_comments" value="1" class="checkbox" />{$lang_editpics_php['del_comm']}</td>
</tr>

AFTER IT ADD THIS
Code: [Select]
<tr>
        <td width="100%" align="center" colspan="5"><input type="checkbox" name="notify" value="1" {$isnotified} class="checkbox" />{$lang_editpics_php['notify_comm']}</td>
</tr>



Changes in db_input.php

Step 4: Open db_input.php

Open db_input.php and find (around line 165)
Code: [Select]
                  if (!USER_ID) { // Anonymous users, we need to use META refresh to save the cookie

Right before/Above it Add this:
Code: [Select]

//Start New User Notification Code
                                 $result = cpg_db_query("SELECT owner_id, notify, sent  FROM {$CONFIG['TABLE_PICTURES']} WHERE pid=".$pid);
                                 list($uid, $notify, $sent) = mysql_fetch_row($result);

                                // We can't send an email if this pic was uploaded by a guest
                                //User must request notification.
                                if ($uid && $notify == "Yes"){

                                                // This can get the right info if the bridge is enabled or not.
                                               $picture_owner_data = $cpg_udb->get_user_infos($uid);

                                               //make sure we don't email ourself and that we arent being flooded
                                                if(USER_ID != $uid  && !$sent){
                                                                // check the user has specified an email address
                                                                if ($picture_owner_data['user_email']){
                                                                                $subject = "TMV: New Gallery Comment by ".USER_NAME;
                                                                                $mail_body  = "Hi ".$picture_owner_data['user_name']."!!<br />\n".USER_NAME." just wrote a comment on one of your photos, click the link below to read and reply to it.<br /><br />\n";
                                                                                $mail_body .= $CONFIG['site_url'] . "displayimage.php?pos=-".$pid."<br /><br />\n";
                                                                                $mail_body .= "More comments may be posted, but you won't receive any more notifications until you read them.<br />\n";
                                                                                $mail_body .= "Thanks,<br />{$CONFIG['gallery_name']} Team.";
                                                                                cpg_mail($picture_owner_data['user_email'], $subject, $mail_body);
                                                                }
                                                               //Mark that we've sent a notification so the pic owner doesnt get flooded.
                                                               if(!$sent){
                                                                           $result = cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET sent = 1  WHERE pid=".$pid);
                                                               }
                                              }
                                }
// End User Notification Code.




Changes in displayimage.php

Step 4: Open displayimage.php

Open displayimage.php and find (around line 76)
Code: [Select]
<a href="javascript:;" onclick="return MM_openBrWindow('picEditor.php?id={$CURRENT_PIC_DATA['pid']}','Crop_Picture','scrollbars=yes,toolbar=no,status=yes,resizable=yes')" class="admin_menu" >{$lang_display_image_php['crop_pic']}</a> <a href="editOnePic.php?id={$CURRENT_PIC_DATA['pid']}&amp;what=picture"  class="admin_menu">{$lang_display_image_php['edit_pic']}</a> <a href="delete.php?id={$CURRENT_PIC_DATA['pid']}&amp;what=picture"  class="admin_menu" onclick="return confirm('{$lang_display_image_php['confirm_del']}'); return false; ">{$lang_display_image_php['del_pic']}</a>
EOT;

AFTER IT ADD
Code: [Select]
//Email Notification Flood Protection.
                if($CURRENT_PIC_DATA['sent']==1){
                $result = cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET sent = 0 WHERE pid = '".$CURRENT_PIC_DATA['pid']."'");
                }
//End Email Notification Flood Protection.
Title: Re: Notify Members on Comment
Post by: Nibbler on December 29, 2005, 05:50:45 am
Hmm, you must be using SMF integration. That should be cpg_db_query instead of db_query.
Title: Re: HACK: Notify Members on Comment
Post by: Tranz on December 29, 2005, 05:53:08 am
coolio... this would be a useful mod.
Title: Re: Notify Members on Comment
Post by: fcarentz on December 29, 2005, 05:55:02 am
Hmm, you must be using SMF integration. That should be cpg_db_query instead of db_query.

Yes I am...why will this Hack only work for SMF?

While looking at the  udb_base.inc.php it seemed like they would all share the same information for this set up and that it would work across the board...Let me know what the differences are if you please I would be very happy to make this as generic as possible.

Going to edit that query now. Thanks!

Is there any documentation on the coding for Coppermine, I am VERY new.
Title: Re: HACK: Notify Members on Comment
Post by: fcarentz on December 29, 2005, 05:57:37 am
coolio... this would be a useful mod.

Thanks, I thought so as well!
Title: Re: HACK: Notify Members on Comment
Post by: Nibbler on December 29, 2005, 06:01:32 am
db_query() was renamed cpg_db_query() in 1.4 because it conflicted with other apps (particularly SMF) that have a function of the same name. That's the only reason the hack works for you - it is in fact using SMF's database functions and not Coppermine's.

I'll post a tidied up version, there are several problems with this hack. :)
Title: Re: HACK: Notify Members on Comment
Post by: fcarentz on December 29, 2005, 06:03:23 am
db_query() was renamed cpg_db_query() in 1.4 because it conflicted with other apps (particularly SMF) that have a function of the same name. That's the only reason the hack works for you - it is in fact using SMF's database functions and not Coppermine's.

I'll post a tidied up version, there are several problems with this hack. :)

Thanks Nibbler...
Like I was saying I would be very interested in any coding documentation that there may be available.
Title: Re: HACK: Notify Members on Comment
Post by: Nibbler on December 29, 2005, 06:10:28 am
Here's the more generic version, db_input.php:

Find:

Code: [Select]
        if (!USER_ID) { // Anonymous users, we need to use META refresh to save the cookie
Above/before that, add

Code: [Select]
//Start New User Notification Code
$result = cpg_db_query("SELECT owner_id  FROM {$CONFIG['TABLE_PICTURES']} WHERE pid=".$pid);
list($uid) = mysql_fetch_row($result);

// We can't send an email if this pic was uploaded by a guest
if ($uid){

// This can get the right info if the bridge is enabled or not.
$picture_owner_data = $cpg_udb->get_user_infos($uid);

//make sure we don't email ourself.
if(USER_ID != $uid){

// check the user has specified an email address
if ($picture_owner_data['user_email']){
$subject = "New Gallery Comment by ".USER_NAME." at  {$CONFIG['gallery_name']} ";
$mail_body  = "Hi ".$picture_owner_data['user_name']."!\n\n".USER_NAME." just wrote a comment on one of your photos, click the link below to read and reply to it.\n";
$mail_body .= $CONFIG['site_url'] . "displayimage.php?pos=-".$pid;
cpg_mail($picture_owner_data['user_email'], $subject, $mail_body);
}
}
}
// End User Notification Code.

There is no coding documentation available, you just have to learn by reading the code :)
Title: Re: HACK: Notify Members on Comment
Post by: Tranz on December 29, 2005, 06:29:16 am
I'm not sure if it's in the code, but does the picture owner have an option not to receive notification, as they can do for forum post notifications?
Title: Re: HACK: Notify Members on Comment
Post by: Nibbler on December 29, 2005, 06:32:58 am
No, but it could be added.
Title: Re: HACK: Notify Members on Comment
Post by: fcarentz on December 29, 2005, 07:21:01 am
I'm not sure if it's in the code, but does the picture owner have an option not to receive notification, as they can do for forum post notifications?

That was going to be my next step or attempt with learning the Coppermine system. Only problem is I'm not sure where to put the clickable option...Should it be on a picture by picture basis? or an over all option. Also if its an over all option and you are using an integration such as SMF the option would have to be in the Profile which would require updating the SMF profile file...so not sure how to handle that...IF its an option you set on each individual picture it would seem to be a bit easier to handle especially since coppermine can be integrated with so many systems.
Title: Re: HACK: Notify Members on Comment
Post by: fcarentz on December 29, 2005, 08:53:14 am
No, but it could be added.

Oh its added. I really needed this feature for my site, so I figured a lot of other people probably would to. Hope this is a step in the right direction here.
Title: Re: MOD: Email Notification to members on Comment
Post by: Tranz on December 29, 2005, 06:59:18 pm
It seems that there is no check to see if the member has seen the comment... So let's say they don't view comment #1. Then comments 2-10 arrive with notifications each? Is it possible to make it like forums where the user doesn't get notified again until they view the image? It's probably a bit difficult, but this would minimize emails people get.

Thanks for your work on this.

disclaimer: I personally don't need this (now) because I don't have other people uploading pictures and such, so I'm just trying to help those who would be using it.
Title: Re: MOD: Email Notification to members on Comment
Post by: fcarentz on December 29, 2005, 07:03:58 pm
Can it be done, well sure it can the forums do it. But I've never looked into how they track that. I would guess that it just checks to see if the previous post was by the owner

Thats how it seems to work on my forums...If i want to continue to be notified I have to keep replying...but I only get notified on the first post following mine. Then I wont get an email again until I respond.

at least thats how I think it works on the forums...I'm not competely sure. If someone knows different please speak up and I will see what I can do with this MOD to make that part of it.
Title: Re: MOD: Email Notification to members on Comment
Post by: Tranz on December 29, 2005, 07:10:00 pm
I think -- and I might be wrong -- but forums I've used (phpbb and smf) track by simple viewing. That's how they know if there are new posts for us to read.

This would require a second mod, it seems. One that tracks the user's views. This has been requested before, I think.
Title: Re: MOD: Email Notification to members on Comment
Post by: fcarentz on December 29, 2005, 07:53:22 pm
It appears that SMF uses a seperate table called smf_log_notify to see whether or not an email has already been sent. Now I just need to find where/how they change the value back to NULL once I look at it.

I am guessing that would be somewhere in the Display section.
Title: Re: MOD: Email Notification to members on Comment
Post by: fcarentz on December 29, 2005, 10:03:08 pm
That should do it....Flood Protection has been added.

If you have already used this mod you just need to add the New mySQL Alter Table to add the sent column to the pictures table. Also you will have to reupdate your db_input.php file again and then do the changes to your displayimage.php

I think this makes it much nicer and wasn't that big of a Mod at all. I originally thought it was going to be much more complex. Happy to give something back to the community for making such a great gallery available for free!

Question, comments, suggestions, wants or needs? Post em!
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: nitram on December 31, 2005, 04:01:35 pm
I use version 1.4.2 but in my editOnePic.php i don't find this parts:

// If this is the users gallery icon then check it
$isgalleryicon_selected = ($CURRENT_PIC['galleryicon']) ? 'checked="checked" ': '';
$isgalleryicon_disabled = ($CURRENT_PIC['category'] < FIRST_USER_CAT)? 'disabled="disabled" ':'';


and

<tr>
           <td width="20%" align="center"><input type="checkbox" name="galleryicon" {$isgalleryicon_selected}{$isgalleryicon_disabled}value="{$CURRENT_PIC['pid']}" class="checkbox" />{$lang_editpics_php['gallery_icon']}</td>
          <td width="20%" align="center"><input type="checkbox" name="read_exif" value="1" class="checkbox" />{$lang_editpics_php['read_exif']}</td>
          <td width="20%" align="center"><input type="checkbox" name="reset_vcount" value="1" class="checkbox" />{$lang_editpics_php['reset_view_count']}</td>
          <td width="20%" align="center"><input type="checkbox" name="reset_votes" value="1" class="checkbox" />{$lang_editpics_php['reset_votes']}</td>
          <td width="20%" align="center"><input type="checkbox" name="del_comments" value="1" class="checkbox" />{$lang_editpics_php['del_comm']}</td>
</tr>


Why not?  ???
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: fcarentz on January 01, 2006, 01:10:24 am
This is on/around line 374
Code: [Select]
// If this is the users gallery icon then check it
$isgalleryicon_selected = ($CURRENT_PIC['galleryicon']) ? 'checked="checked" ': '';
$isgalleryicon_disabled = ($CURRENT_PIC['category'] < FIRST_USER_CAT)? 'disabled="disabled" ':'';

and is immediately followed by

Code: [Select]
<tr>
           <td width="20%" align="center"><input type="checkbox" name="galleryicon" {$isgalleryicon_selected}{$isgalleryicon_disabled}value="{$CURRENT_PIC['pid']}" class="checkbox" />{$lang_editpics_php['gallery_icon']}</td>
          <td width="20%" align="center"><input type="checkbox" name="read_exif" value="1" class="checkbox" />{$lang_editpics_php['read_exif']}</td>
          <td width="20%" align="center"><input type="checkbox" name="reset_vcount" value="1" class="checkbox" />{$lang_editpics_php['reset_view_count']}</td>
          <td width="20%" align="center"><input type="checkbox" name="reset_votes" value="1" class="checkbox" />{$lang_editpics_php['reset_votes']}</td>
          <td width="20%" align="center"><input type="checkbox" name="del_comments" value="1" class="checkbox" />{$lang_editpics_php['del_comm']}</td>
</tr>

Are you using an upgraded version? Not why you wouldnt have that in your file. All my changes have been done on a new install.
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: AWJunkies on March 29, 2006, 10:01:55 pm
I changed the code around to add the comment and the picture within the E-mail. This makes a HUGE difference to me and maybe some other people. Please just change a few of the variables in the E-mail from website to what your site realy is. I also am adding code into editpics.php to make it so you can click all photos to not recieve comments within an album or indevidualy click on and off within that.

Code: [Select]
//Start New User Notification Code
                                 $result = cpg_db_query("SELECT owner_id, filename, filepath, notify, sent, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} WHERE pid=".$pid);
                                 list($uid, $filename, $filepath, $notify, $sent, $pwidth, $pheight) = mysql_fetch_row($result);

                                // We can't send an email if this pic was uploaded by a guest
                                //User must request notification.
                                if ($uid && $notify == "Yes"){

                                                // This can get the right info if the bridge is enabled or not.
                                               $picture_owner_data = $cpg_udb->get_user_infos($uid);

                                               //make sure we don't email ourself and that we arent being flooded
                                                if(USER_ID != $uid  && !$sent){
                                                                // check the user has specified an email address
if ($CONFIG['make_intermediate'] && max($pwidth, $pheight) > $CONFIG['picture_width']) {
$picture_url = normal_;
    } else {
    $picture_url = '';
}
                                                                // send an email to the owner of the picture
                                                                if ($picture_owner_data['user_email']){
                                                                                $subject = "New website Comment by ".USER_NAME;
                                                                                $mail_body  = "Hi <b>".$picture_owner_data['user_name']."!</b>\n\n".USER_NAME." just wrote a comment on one of your photos:<br /><b>".$_POST['msg_body']."</b><br /><br /><a href='$CONFIG[site_url]displayimage.php?pos=-$pid'><img src='$CONFIG[site_url]albums/".$filepath."".$picture_url."$filename'></img></a><br />Click the image above to reply to the comment or click <a href='$CONFIG[site_url]displayimage.php?pos=-$pid'><b>HERE</b></a>.<br />\n";
                                                                                $mail_body .= "More comments may be posted, but you won't receive any more notifications until you read them.<br />\n";
                                                                                cpg_mail($picture_owner_data['user_email'], $subject, make_clickable($mail_body), 'text/plain', "website", 'name@website.com');
                                                                }
                                                               //Mark that we've sent a notification so the pic owner doesnt get flooded.
                                                               if(!$sent){
                                                                           $result = cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET sent = 1  WHERE pid=".$pid);
                                                               }
                                              }
                                }
// End User Notification Code.
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: AWJunkies on March 29, 2006, 11:16:38 pm
HERE are the edits to make the editpics.php work and function correctly. Now you can edit all files at once and not one by one.


Open lang/english.php

FIND THIS
Code: [Select]
  'del_all_comm' => 'Delete ALL comments', //cpg1.4

AFTER ADD THIS
Code: [Select]
  'notify_all_comm' => 'Notify me on ALL comments',


Open editPics.php

FIND THIS
Code: [Select]
$del_comments = isset($_POST['del_comments'.$pid]) || $delete;
AFTER IT ADD THIS
Code: [Select]
$notify = isset($_POST['notify'.$pid]);
NEXT FIND THIS
Code: [Select]
if ($reset_votes) $update .= ", pic_rating = '0', votes = '0'";
AFTER IT ADD THIS
Code: [Select]
if($notify) {
$update .= ", notify = 'Yes'";
}else{
$update .= ", notify = 'No'";
}

NEXT FIND THIS
Code: [Select]
// If this is the users gallery icon then check it
$isgalleryicon_selected = ($CURRENT_PIC['galleryicon']) ? 'checked="checked" ': '';
$isgalleryicon_disabled = ($CURRENT_PIC['category'] < FIRST_USER_CAT)? 'disabled="disabled" ':'';

AFTER IT ADD THIS
Code: [Select]
// If the user is being notfied already then check it.
$isnotified = ($CURRENT_PIC['notify']) == "Yes" ? 'checked="checked" ': '';

NEXT FIND THIS
Code: [Select]
<tr>
           <td width="20%" align="center"><input type="checkbox" name="galleryicon" {$isgalleryicon_selected}{$isgalleryicon_disabled}value="{$CURRENT_PIC['pid']}" class="checkbox" />{$lang_editpics_php['gallery_icon']}</td>
          <td width="20%" align="center"><input type="checkbox" name="read_exif" value="1" class="checkbox" />{$lang_editpics_php['read_exif']}</td>
          <td width="20%" align="center"><input type="checkbox" name="reset_vcount" value="1" class="checkbox" />{$lang_editpics_php['reset_view_count']}</td>
          <td width="20%" align="center"><input type="checkbox" name="reset_votes" value="1" class="checkbox" />{$lang_editpics_php['reset_votes']}</td>
          <td width="20%" align="center"><input type="checkbox" name="del_comments" value="1" class="checkbox" />{$lang_editpics_php['del_comm']}</td>
</tr>

AFTER IT ADD THIS
Code: [Select]
                        <tr>
    <td width="100%" align="center" colspan="5"><input type="checkbox" name="notify{$CURRENT_PIC['pid']}" id="notify{$CURRENT_PIC['pid']}" value="1" {$isnotified} class="checkbox" /><label for="notify{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['notify_comm']}</label></td>
</tr>

NEXT FIND THIS
Code: [Select]
                        <td width="20%" align="right">
                            <b>{$lang_editpics_php['select_unselect']}:</b>
                        </td>
                        <td width="20%" align="center">
                            <span class="admin_menu">
                                <input type="checkbox" name="deleteAll" onclick="selectAll(this,'delete');" class="checkbox" id="deleteAll" />
                                <label for="deleteAll" class="clickable_option">{$lang_editpics_php['del_all']}</label>
                            </span>
                        </td>
                        <td width="20%" align="center">
                            <span class="admin_menu">
                                <input type="checkbox" name="reset_vcountAll" onclick="selectAll(this,'reset_vcount');" class="checkbox" id="reset_vcountAll" />
                                <label for="reset_vcountAll" class="clickable_option">{$lang_editpics_php['reset_all_view_count']}</label>
                            </span>
                        </td>
                        <td width="20%" align="center">
                            <span class="admin_menu">
                                <input type="checkbox" name="reset_votesAll" onclick="selectAll(this,'reset_votes');" class="checkbox" id="reset_votesAll" />
                                <label for="reset_votesAll" class="clickable_option">{$lang_editpics_php['reset_all_votes']}</label>
                            </span>
                        </td>
                        <td width="20%" align="center">
                            <span class="admin_menu">
                                <input type="checkbox" name="del_commentsAll" onclick="selectAll(this,'del_comments');" class="checkbox"reset_votesAll" id="del_commentsAll" />
                                <label for="del_commentsAll" class="clickable_option">{$lang_editpics_php['del_all_comm']}</label>
                            </span>
                        </td>

REPLACE WITH THIS
Code: [Select]
                        <td align="right">
                            <b>{$lang_editpics_php['select_unselect']}:</b>
                        </td>
                        <td align="center">
                            <span class="admin_menu">
                                <input type="checkbox" name="deleteAll" onclick="selectAll(this,'delete');" class="checkbox" id="deleteAll" />
                                <label for="deleteAll" class="clickable_option">{$lang_editpics_php['del_all']}</label>
                            </span>
                        </td>
                        <td align="center">
                            <span class="admin_menu">
                                <input type="checkbox" name="reset_vcountAll" onclick="selectAll(this,'reset_vcount');" class="checkbox" id="reset_vcountAll" />
                                <label for="reset_vcountAll" class="clickable_option">{$lang_editpics_php['reset_all_view_count']}</label>
                            </span>
                        </td>
                        <td align="center">
                            <span class="admin_menu">
                                <input type="checkbox" name="reset_votesAll" onclick="selectAll(this,'reset_votes');" class="checkbox" id="reset_votesAll" />
                                <label for="reset_votesAll" class="clickable_option">{$lang_editpics_php['reset_all_votes']}</label>
                            </span>
                        </td>
                        <td align="center">
                            <span class="admin_menu">
                                <input type="checkbox" name="del_commentsAll" onclick="selectAll(this,'del_comments');" class="checkbox"reset_votesAll" id="del_commentsAll" />
                                <label for="del_commentsAll" class="clickable_option">{$lang_editpics_php['del_all_comm']}</label>
                            </span>
                        </td>
                        <td align="center">
                            <span class="admin_menu">
                                <input type="checkbox" name="notify" {$isnotified} onclick="selectAll(this,'notify');" class="checkbox"reset_votesAll" id="notify" />
                                <label for="notify" class="clickable_option">{$lang_editpics_php['notify_all_comm']}</label>
                            </span>
                        </td>

Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: Stramm on March 30, 2006, 07:23:08 pm
http://forum.coppermine-gallery.net/index.php?topic=20688.0

this was my attempt. Maybe you can use parts of it. Has subscribe/ unsubscribe, global on/ off in config, users can turn it on/ off in their profile, a manager to unsubscribe from multiple images

It's in my 1.4 modpack as well
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: AWJunkies on March 31, 2006, 03:35:13 am
I didn't want to mess with profile because I run a universal profile page and user control panel for 22 domains. They are all linked and adding more to it is huge hassle. I like the idea and will actually port it to this as well. I will look at your link now.
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: odie3 on June 05, 2006, 06:47:47 pm
i would like to know do I just use the first post MOD Code?  Or do I have to include the other code within this thread?

I am on Bridged phpBB/Coppermine 1.4.6.

Thanks - rather do all this editing once...  ;)
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: odie3 on June 10, 2006, 04:04:27 am
I did the first post edits - seems to work just fine.

Note:  Seem you have to disable send Admin Email of comments to get this MODs emails.  I guess that makes since but had me worried until I figured that out.  ;)
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: willemt on August 20, 2006, 03:42:05 am
Tried this mod and it works excellent on 1.4.8 bridged with phpbb2. ;D
One question though: My phpbb2 setup sends out message notifications using html email.... It would be terrific if I could use the same html template for the emails send after commenting on pictures....
Anyone who knows how to send html email instead of plain text?

Thanks!
Willem.
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: nickfzx on September 08, 2006, 05:39:05 am
hi

I want to try this on a punbb integration

I am guessing it will work as people have it runing with phpbb...my question is, as the profile page is not accessable because it is now punbb's profile page, will users till be able to opt out of email notifications?

all the best

Nick
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: Mr Tee on December 23, 2006, 09:06:17 am
Tried this mod and it works excellent on 1.4.8 bridged with phpbb2. ;D
One question though: My phpbb2 setup sends out message notifications using html email.... It would be terrific if I could use the same html template for the emails send after commenting on pictures....
Anyone who knows how to send html email instead of plain text?

Thanks!
Willem.

If you are refering to the fact that the link is not clickable in the notification email you can chage this in db_input.php

Find this
Code: [Select]
cpg_mail($picture_owner_data['user_email'], $subject, $mail_body);
Replace with
Code: [Select]
cpg_mail($picture_owner_data['user_email'], $subject, make_clickable($mail_body), 'text/plain);
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: Stramm on December 23, 2006, 09:27:41 am
hi

I want to try this on a punbb integration

I am guessing it will work as people have it runing with phpbb...my question is, as the profile page is not accessable because it is now punbb's profile page, will users till be able to opt out of email notifications?

all the best

Nick

I haven't tried that mod here... so I'm not 100% sure. But I don't think a user can opt in/ out in his profile to receive notifications. At least I wasn't able to spot a database addition that stores
You can tag a single picture. And all users who have written a comment will get notified once another user writes a new comment.

Don't you use the modpack anymore? It has a notification system. Users can opt in/ out using their profile (either CPG's or, if you're bridged, the forum's). It uses a new db table to store which user subscribed to a certain pic. So even users who haven't commented can subscribe (and of course opt out). Users can set to auto subscribe to pics they upload and/ or comment.
Little restrictions if you're bridged. Then (depending on the forum) auto subscribe can't be divided up. The user enables the notification with the forums notification checkbox (no seperate setting)
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: nickfzx on December 23, 2006, 08:23:33 pm
I've done it and got it working fine...you even helped me out with it a month or so ago :)
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: Stramm on December 23, 2006, 08:54:57 pm
ups, yes, I remember  :-X
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: icnd on May 22, 2007, 12:03:23 pm
I Think that it is a mistake but

Code: [Select]
if($notify) {
$update .= ", notify = 'Yes'";
}else{
$update .= ", notify = 'No'";
}


must be added after

Code: [Select]
    if ($reset_votes) {$update .= ", pic_rating = '0', votes = '0'";resetDetailVotes($pid);}

and not

Code: [Select]
    if ($reset_votes) {$update .= ", pic_rating = '0', votes = '0'";resetDetailVotes($pid);

It is missing a
Code: [Select]
}  and without it, it is not working the update.

Thanks
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: icnd on May 23, 2007, 09:35:13 am
If you are refering to the fact that the link is not clickable in the notification email you can chage this in db_input.php

Find this
Code: [Select]
cpg_mail($picture_owner_data['user_email'], $subject, $mail_body);
Replace with
Code: [Select]
cpg_mail($picture_owner_data['user_email'], $subject, make_clickable($mail_body), 'text/plain);

It is missing a
Code: [Select]
'Replace with
Code: [Select]
cpg_mail($picture_owner_data['user_email'], $subject, make_clickable($mail_body), 'text/plain');
 ;) Bye
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: Bazzah on May 27, 2007, 02:09:19 pm
I decided to try this using the invision board bridge (www.hirescovers.net) Should this work OK, or have I done something drastically wrong?? When I go into edit file information, and select 'Notify me of comments' I get 'Critical error - There was an error while processing a database query'
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: Bazzah on May 27, 2007, 10:30:42 pm
p.s I have just gone to approve some images, and I am receiving the same error! HELP!!!
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: Mr Tee on September 20, 2007, 08:53:43 pm
I have been using this mod for some time and it works very well. One of my members has asked if there was any way of being informed when a new comment is added to any image and not just their own. Obviously, like this one, there would have to be a way of opting out because not everyone would want to be flooded with emails.

The more I think about it I can see it getting very involved because perhaps members would then like to be able to subscribe only to certain authors. Anyway I thought I would mention it. Great mod though thanks.
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: vonmax on January 16, 2008, 01:11:47 am
One of my members has asked if there was any way of being informed when a new comment is added to any image and not just their own.

hello
I had the same question
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: Halfhidden on February 10, 2008, 11:08:36 pm
I would like to use this mod. But on the original mod the first instructions were to run a query for the following:

ALTER TABLE `gal_pictures` ADD `notify` ENUM( 'Yes', 'No' ) DEFAULT 'Yes' NOT NULL ;
ALTER TABLE `gal_pictures` ADD `sent` INT( 11 ) NOT NULL ;

I am running Coppermine 1.4.14 bridged to phpbb3. when I run the query I get errors from Sql because the tables don't exist.  I know I've missed the point here somewhere.
One again I'm cap in hand!
Sorry,
Steff

Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: Joachim Müller on April 19, 2008, 02:33:53 pm
I am running Coppermine 1.4.14 bridged to phpbb3.
That setup goes unsupported (as in "no support at all"). You're not allowed to ask questions on a mods thread if you run this setup. You know our thoughts on this: upgrade to the most recent stable release, and figure out stuff that may be related to the unsupported phpbb3 bridge on your own.
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: Halfhidden on April 19, 2008, 04:05:36 pm
That post is very old... You'll know that I am running the latest version 1.4.18 as you posted to me only a day or so ago. The question wasn't about support for the bridge.... as you can see rather establishing if my problem was created by the fact that I ran the bridge... in which case Obviously I would seek help about the bridge from the appropriate forum.... Is there a point to your attitude towards me of late? Have I upset you?
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: Joachim Müller on April 20, 2008, 03:21:54 am
Have I upset you?
Yes. You encourage others to downgrade with your incorrect assumptions. That's not what I would expect from someone with your skill level. It's damaging the reputation of the app. You drew the false conclusions. Please keep the downgrade discussion you started to the threads that you already posted in about your downgrade suggestions.
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: Halfhidden on April 20, 2008, 04:54:23 am
I applaud your honesty. I think that this is not the place to play this out. This is after all a support forum. Allow me to explain that I did indeed have problems with the upgrade. Nothing worked as it should after the install... I have installed many upgrades before to know what I'm doing. Although I may well have concluded prematurely that the upgrade was to blame for all that went wrong, and for that I apologise. I have since moved the site and installed Coppermine on a fresh install of 1.4.18 and then re-introduced the mods and plugins... finally bridging the phpbb3 and Coppermine. You'll be happy to learn that everything works well. I now have to create the name servers and replace the old public gallery that is running live.
I've been an administrator myself for many years and understand your statue. May I suggest that you strike my comments from the forum if you think that genuine damage will be caused by them, I certainly wouldn't be offended if you did.... after all that is administration. I have no wish to make enemies of anyone who supports Coppermine! least of all you. Perhaps we should put this to one side and move on?
As I said at the beginning, this is a support forum so I think that after you have read this message it should be removed.
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: dwo on May 23, 2008, 08:13:40 pm
Is it right, that with this mod, you only get emails to comments of your own pics?

So you can not subscribe to other pics comments?

Is stramms mod better if I want such a functionality, too? http://forum.coppermine-gallery.net/index.php/topic,20688.0.html

Thank you.

Thanks.
Title: Re: MOD: Email Notification to members on Comment (UPDATED 12-29-05)
Post by: seanbluekey on June 06, 2008, 03:01:32 am
Okay, well. I want to send email to alllll my registered members. I don't want it based on commenting, just a simple email to all my members!

Kind Regards, Sean.