|
#1
|
||||
|
||||
|
Mod: Thumb in notification email
Ok... I gave up submitting paper for tonight and meeting the deadline. Thus, I'll post the first orginal thread of this category
![]() ------------------------------- I've modifided the notification email for myself to send HTML email instead of Plain Text and this let me send thumbnail of the commented image along with the comment note. It works 100% for me right now and I'm using yahoo account for photoblog email notifications. But it came with no warranty 'cause it's not tested by many users. To have it you should do some modification in index.php and add a line to image_template.html 0) Replace from where says // EMAIL NOTE ON COMMENTS to } // commentemail yes (at about lines 519-551) with this Code:
// ##########################################################################################//
// EMAIL NOTE ON COMMENTS
// ##########################################################################################//
if($cfgrow['commentemail'] == "yes") {
if($_GET['x'] == "save_comment") {
$admin_email = $cfgrow['email'];
$comment_name = clean($_POST['name']);
$comment_image_id = $_POST['parent_id'];
$comment_message = clean($_POST['message']);
// Ramin added
$comment_image_name = $_POST['parent_name'];
$link_to_comment = $cfgrow['siteurl']."?showimage=$comment_image_id";
$link_to_img_thumb_cmmnt = "Thumbnail Link:" .$cfgrow['siteurl'] ."thumbnails/thumb_$comment_image_name";
$img_thumb_cmmnt = "<img src='" .$cfgrow['siteurl'] ."thumbnails/thumb_$comment_image_name' >";
$subject = "Pixelpost - New Comment Made";
$sent_date = date("Y-m-d");
$sent_time = date("H:i");
$body = "Hello,<br>
A new comment has been made at your photoblog.<br><br>
<a href='$link_to_comment'>$link_to_comment</a><br>
$img_thumb_cmmnt<br>
<br>
The Comment is: <br>
----------------------------------------------------------------------<br>
$comment_message<br>
by $comment_name<br>
---------------------------------------------------------------------- <br>
Email Sent by pixelpost<br>
";
// Ramin added and modified
$headers = "Content-Type: text/html; charset=ISO-8859-1\r\n" ;
$headers .= "From: PIXELPOST <$admin_email>\r\n";
$recipient_email = "admin" ."<$admin_email>";
mail($recipient_email,$subject,$body,$headers);
}
} // commentemail yes
Code:
$parent_name = $_POST['parent_name']; // build a string with all comments that become like this (at about line 247) Code:
// build a string with all comments
if(($_GET['x'] == "") or ($_GET['popup'] == "comment")) {
if($_GET['comment'] == "save") {
$datetime = date("Y-m-d H:i:s");
$ip = $_SERVER['REMOTE_ADDR'];
$parent_id = $_POST['parent_id'];
// Ramin added
$parent_name = $_POST['parent_name'];
Code:
<input type='hidden' name='parent_name' value='<IMAGE_NAME>' /> Code:
<input class='input' type='text' name='email' value='<VINFO_EMAIL>'/><p />
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7 |
| Post Reply |
| Thread Tools | |
|
|