PDA

View Full Version : No Thumbnail in Email


Dkozikowski
10-31-2005, 11:17 PM
When a new comment is made, i receive an email but the thumbnail is not showing. Its just a red x. i looked at the email code and also added the option to send a link to the thumbnail, this was the output of the link:

http://www.dwilkinsjr.com/thumbnails/thumb_

so my guess is the image path looks the same way.

for some reason, the rest of the image name is not going through.

heres the code i have in my index.php

// ################################################## ########################################//
// EMAIL NOTE ON COMMENTS
// ################################################## ########################################//

if($_GET['x'] == "save_comment")
{
if($cfgrow['commentemail'] == "yes" && $email_flag == 1)
{

$admin_email = $cfgrow['email'];
$comment_name = clean($_POST['name']);
$comment_url = $_POST['url'];
$comment_image_id = $_POST['parent_id'];
$comment_message = $_POST['message'];
$comment_message = stripslashes($comment_message);
$comment_email = clean($_POST['email']);
$link_to_comment = $cfgrow['siteurl']."index.php?showimage=$comment_image_id";
$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_site_title - New Comment Made";
$sent_date = gmdate("Y-m-d",time()+(3600 * $cfgrow['timezone'])) ;
$sent_time = gmdate("H:i",time()+(3600 * $cfgrow['timezone'])) ;

if ($cfgrow['htmlemailnote']!='yes')
{
// Plain text note email
$body = "Hello,\r\n
A new comment has been made at your photoblog.
$link_to_comment

The Comment is
----------------------------------------------------------------------
$comment_message
by <a href='$comment_url' >$comment_name </a>- $comment_email
----------------------------------------------------------------------
Powered by Pixelpost
";
$headers = "Content-type: text/plain; charset=UTF-8\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";

if ($comment_email!="") $headers .= "From: $comment_name<$comment_email>\n";
else $headers .= "From: PIXELPOST <$admin_email>\n";

$recipient_email = "admin <$admin_email>";
}
else
{
// HTML note email
$body = "Dave,<br>
A new comment has been made on Mixed Medium Artworks!<br><br>
<a href='$link_to_comment'>$link_to_comment</a><br>
$img_thumb_cmmnt<br>
$link_to_img_thumb_cmmnt<br>
<br>
The Comment is: <br>
----------------------------------------------------------------------<br>
$comment_message<br>
by $comment_name - $comment_email<br>
----------------------------------------------------------------------<br>
<br>
";

for whatever reason, $comment_image_name is not doing its job.

Any ideas?

Connie
11-01-2005, 05:01 AM
which pixelpost version
which php version

which thumbnail name?

please give these informations, I forgot my crystal ball ;=)

raminia
11-01-2005, 05:50 AM
do you have / at the end of the image path in admin panel >> Options >> General?

raminia
11-01-2005, 05:56 AM
maybe you missed to add
<input type='hidden' name='parent_id' value='<IMAGE_ID>' />
<input type='hidden' name='parent_name' value='<IMAGE_NAME>' />
to the comment form inside the template. If you have popup comments you should add this into comment_template.html. Else, you should add this to browse_template.html.
The above code should be added after the tag <form ...>
and before </form>

Dkozikowski
11-01-2005, 10:46 AM
maybe you missed to add

<input type='hidden' name='parent_name' value='<IMAGE_NAME>' />
to the comment form inside the template.

BINGO! Nailed it right on the head. That was missing from the template I was using.

Thanks for everyones help. I appreciate the quick responses.

Just an FYI, I am using the pepper template. So if this comes up again when this template is used, you will know why!