Support > cpg1.5 email
Email users on new comments
lurkalot:
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. ;)
Αndré:
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 :)
lurkalot:
Andre. Thanks, Sure I'll test it.
I'll use one of my test sites to check it on first. ;)
Αndré:
Please try the following. Open db_input.php, find
--- Code: --- 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));
}
--- End code ---
and below, add
--- Code: --- $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));
}
--- End code ---
EC:
I tested too!. My gallery is phpBB3 bridged. It works apart the title which gives null result.
elena
Navigation
[0] Message Index
[#] Next page
Go to full version