@JensF1)Open details.php and find:
$site_db->query($sql);
$commentid = $site_db->get_insert_id();
update_comment_count($id, $user_info['user_id']);
Add after:
//-----------------------------------------------------
// 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();
}
Be sure to add this before:
}
}
unset($row);
unset($spam_row);
}
//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
2)Create file called comment_email.html, put this code into the file:
Dear {recipient_name},
{user_name} posted a comment on {image_name} at {site_name}.
To view the comment go to: {image_url}
------
Best regards, {site_name}
Upload comment_email.html to /lang/language/email/.
3)Open /lang/language/main.php and find:
$lang['post_comment'] = "post comment";
Add after:
$lang['send_comment_emailsubject'] = "COMMENT_NOTIFICATION_SUBJECT_HERE";
Replace COMMENT_NOTIFICATION_SUBJECT_HERE to whatever you want to appear in mail subject.
4)Open /templates/template/member_editprofile.html & add this code to the right place.
<tr>
<td class="row2"><b>{lang_allow_emails}</b></td>
<td class="row2">
<input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
{lang_yes}
<input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
{lang_no}</td>
</tr>
This switch will allow users to enable or disable comments notification.
I can translate this instruction into deutsch but I hope it's clear enough
@VraxorPerhaps you could update install instructions and delete all confusing comments
