Potential Gallery Feature: E-mail Notification When Comments
gregchet
Joined: 2003-01-10
Posts: 105 |
Posted: Sun, 2003-01-12 10:12 |
I'm sure this is planned for a future release, but it would be very handy if an e-mail notification could be sent every time someone posts a comment in Gallery. Some of the galleries I moderate are completely public, so the content has to remain fairly tame. Without getting an e-mail notification, you have to search through each one of the galleries and see if there are any new comments. This is very time consuming, and would become impossible to do when your image gallery gets too big. Maybe even just have a feature when you login as an admin, you can view a list of the most recently comments, and delete them if the content isn't appropriate. Below is a small modification I made to "add_comment.php" in the main Gallery directory. It sends out an e-mail notification when a comment is posted, and it's very easy to implement. All the information is hard coded right now, but it would be handy if it could be implemented directly into Gallery, so that you can modify the fields when you're logged in as an admin. HOW TO IMPLEMENT: Open "add_comment.php" in the main Gallery directory. Search for the below lines. $gallery->album->save(); CHANGE TO: $gallery->album->save(); NEW CODE: // THIS IS THE START OF THE MODIFICATION // E-mail 'To' Address // Subject // Headers // THIS IS THE END OF THE MODIFICATION And that's all there is to it. I hope someone can get some use out of this. Best regards, Greg Chetcuti |
|
Posts: 260
Also, those of you interested could have a look to <!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&name=phpBB_14&file=index&action=viewtopic&topic=458&4063" TARGET="_blank">this thread</A><!-- BBCode End -->.
Just cross-referencing.
p
Posts: 70
This works fine for me except in the from address in the email i get this UNEXPECTED_DATA_AFTER_ADDRESS@.SYNTAX-ERROR. along with the from address
Here is my code:
// E-mail 'To' Address
$toaddress = "admin@mydamnpage.com";
// Subject
$subject = "Comment added by ".$commenter_name." to the gallery";
// Headers
$headers .= "From: Mydamn gallery <gallery@mydamnpage.com>";
$headers .= "X-Sender: <gallery@mydamnpage.com>";
$headers .= "X-Mailer: PHP"; // mailer
$headers .= "X-Priority: 1"; // Urgent message!
$headers .= "Return-Path: <admin@mydamnpage.com>"; // Return path
// Message
$message .= "Name: $commenter_name, ";
$message .= "IP Address: $IPNumber, ";
$message .= "Comment: $comment_text, ";
$message .= "Commented pic URL: ";
$id = $gallery->album->getPhotoId($index);
$message .= makeAlbumUrl($gallery->session->albumName, $id);
mail($toaddress,$subject,$message, $headers);
Any one have any ideas?