Thanks Vano,
but there is still no e-mail. There is simply no e-mail sent!
Hi Vano, would you have this code may take a look? I think in the code does not error.
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
$msg = $lang['comment_success'];
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------
$recipient_name = $image_row['user_name'];
$recipient_email = $image_row['user_email'];
$image_url = $script_url."/img".$id;
$sql = "SELECT user_allowmailcomments FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = '".$recipient_name."'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowmailcomments = ($row['user_allowmailcomments']);
if ($image_row['user_id'] != $user_info['user_id'] && $user_allowmailcomments == 1) {
$current_time = time();
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to($recipient_email);
$site_email->set_from($config['site_email'], $config['site_name']);
$site_email->set_subject($lang['send_comment_emailsubject']);
$site_email->register_vars(array(
"user_name" => stripslashes($user_name),
"recipient_name" => stripslashes($image_row['user_name']),
"image_name" => $image_row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_name" => $config['site_name'],
"image_url" => $image_url,
"comment_text" =>(stripslashes($comment_text)),
"comment_headline"=>(stripslashes($comment_headline)),
));
$site_email->set_body("comment_email", $config['language_dir']);
$site_email->send_email();
}
//----------------------------------------------------
}
}
unset($row);
unset($spam_row);
}
//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------