Check the new Tutorial subforum with helpfull guides and tutorials for modifications and tweaks.
0 Members and 1 Guest are viewing this topic.
Quote from: fgallery on January 21, 2006, 02:03:29 AMWhy admins do not receive comments for their images?Only admins? have you tested it with regular member(s) or more then one admin account with VALID email address?
Why admins do not receive comments for their images?
if ($user_allowemails == 1) {
if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
I'd suggest you using this code instead:http://www.4homepages.de/forum/index.php?topic=2705.msg14792#msg14792then replaceCode: [Select]if ($user_allowemails == 1) {with:Code: [Select]if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) {
//-----------------------------------------------------// Start Emailer for comments//----------------------------------------------------- $recipient_name = $image_row['user_name']; $recipient_email = $image_row['user_email']; $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id; $sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name; $result = $site_db->query($sql); $row = $site_db->fetch_array($result); $user_allowemails = ($row['user_allowemails']); if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) { 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);}
$lang['send_comment_emailsubject'] = "COMMENT_NOTIFICATION_SUBJECT_HERE";
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";
$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;
@fgallery:Looks good. However, these two lines :Quote$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";could also simply be stated like this :Quote$image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id;$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name;
URL_IMAGE_ID."=".$id."";
URL_IMAGE_ID."=".$id;
".get_user_table_field("", "user_name")."
If I write for e.g. testin' in Hedline and/or Comment I'll receive it as testin\'
"comment_headline"=>$comment_headline,
"comment_headline"=>(stripslashes($comment_headline)),
Update :I found it. You're probably talking about this line :Quote"comment_headline"=>$comment_headline,change it to :Code: [Select]"comment_headline"=>(stripslashes($comment_headline)),
I guess I should do the same with 'comment_text'.
[EDITED]All right I've made all corrections specified above & below (till this reply) and the final code was (it works ): Code: [Select]//-----------------------------------------------------// Start Emailer for comments//----------------------------------------------------- $recipient_name = $image_row['user_name']; $recipient_email = $image_row['user_email']; $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id; $sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE ".get_user_table_field("", "user_name")." = ".$recipient_name; $result = $site_db->query($sql); $row = $site_db->fetch_array($result); $user_allowemails = ($row['user_allowemails']); if ($image_row['user_id'] != $user_info['user_id'] && $user_allowemails == 1) { 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);}Don't forget to add:Code: [Select]$lang['send_comment_emailsubject'] = "COMMENT_NOTIFICATION_SUBJECT_HERE";to /lang/language/main.phpPS.It will also disable sending you your own comments.Perhaps I'd be useful for someone ...