Hi!
For English Please use Google Translate.
Mit dieser Modification werden Emails versendet, bei einer Antwort zu deinen Kommentar oder deinen Bild.
Erforderlich, aus diesen Mod:
[MOD] Sende Emails als HTML Schritt 1.) aus der "html_email_files.zip" alle Dateien im Ordner "/includes/" und "lang/yourLang/email/images/"
Schritt 7.) und 7.1)
Neue Dateien (Attachment):
lang/deutsch/email/comment_answer.html
lang/deutsch/email/comment_answer_html.html
lang/deutsch/email/comment_image.html
lang/deutsch/email/comment_image_html.html
zu Modifizierende Dateien:
include/db_field_definitions.php
lang/deutsch/main.php
root/details.php
templates/yourTemplate/member_editprofile.php
1.) Download die Datei "install.zip" (Attachment) und kopiere die Dateien in den entsprechenden Ordner in deiner Galerie.
2.) Kopiere die "install_email.php" in deinen root und führe sie aus.
3.) suche in der db_field_definitions.php "?>" und füge davor ein:
$additional_user_fields['user_comment_image'] = array($lang['comment_image'], "radio", 0);
$additional_user_fields['user_comment_answer'] = array($lang['comment_answer'], "radio", 0);
4.) suche in der main.php "?>" und füge davor ein:
$lang['user_comment_image'] = "Neuer Kommentar zu deinem Bild";
$lang['user_comment_answer'] = "Neue Antwort zu deinen Kommentar";
$lang['comment_image'] = "E-Mails bei neuen Kommentar zu ihren Bild:";
$lang['comment_answer'] = "E-Mails bei Antwort zu ihren Kommentar:";
5.) suche in templates/youTemplates/member_editprofile.html:
{lang_no}
</td>
</tr>
füge darunter ein:
<tr>
<td class="row1"><b>{lang_user_comment_image}</b></td>
<td class="row1">
<input type="radio" name="user_comment_image" value="1"{user_comment_image_yes}>
{lang_yes}
<input type="radio" name="user_comment_image" value="0"{user_comment_image_no}>
{lang_no}
</td>
</tr>
<tr>
<td class="row2"><b>{lang_user_comment_answer}</b></td>
<td class="row2">
<input type="radio" name="user_comment_answer" value="1"{user_comment_answer_yes}>
{lang_yes}
<input type="radio" name="user_comment_answer" value="0"{user_comment_answer_no}>
{lang_no}
</td>
</tr>
6.) suche in der details.php:
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
ersetze es mit:
//######################### Send email when an answer to your Image "i.image_sendmail"
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits,i.image_sendmail".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
6.1) suche:
$error = 0;
if ($action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
füge darüber ein:
//################## Start Send email when an answer to your Image #################################
if((empty($image_row['image_sendmail'])) && $is_image_owner){
$sql= "UPDATE ".IMAGES_TABLE." SET image_sendmail = '1' WHERE image_id = $image_id";$site_db->query($sql);
}
//################## End Send email when an answer to your Image ###################################
6.2) suche:
$sql = "SELECT cat_id, image_allow_comments
FROM ".IMAGES_TABLE."
WHERE image_id = $id";
$row = $site_db->query_firstrow($sql);
ersetze es mit:
//##### Send email when an answer to your Image "i.image_sendmail, u.user_comment_image,u.user_comment_answer"######
$sql = "SELECT i.cat_id,i.image_name,i.user_id, i.image_allow_comments,i.image_sendmail, u.user_comment_image,u.user_comment_answer".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
FROM ".IMAGES_TABLE." i
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE image_id = $id";
$result = $site_db->query($sql);
$row = $site_db->query_firstrow($sql);
$image_owner_id = $row['user_id'];//Send email when an answer to your Image ###########
6.3) suche:
update_comment_count($id, $user_info['user_id']);
füge darunter ein:
// #################### Start Send email when an answer to your Image #####################################
$search_array = array(
'/\[quote(.*?)](.*?)\[\/quote\]/msi',
'/\[\/quote\]/msi',
'/\[url(.*?)](.*?)\[\/url\]/msi'
);
$comment_text = preg_replace($search_array," ",$comment_text) ;
if(($is_image_owner == 0) && $row['user_comment_image'] && ($row['image_sendmail'] == 1)){
$email_to = ($row['user_email']);
$email_subject = $lang['user_comment_image'];
$site_mailtemplate->register_vars(array(
"lang_added_by" => $lang['added_by'],
"lang_comment" => $lang['comment'],
"lang_date" => $lang['date'],
"subject" => $email_subject,
"user_name" => $user_name,
"image_owner_name" => $row['user_name'],
"image_name" => $row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], time()),
"image_url" => $script_url."/details.php?".URL_IMAGE_ID."=".$id."#comment".$commentid,
"message" => format_text(trim(stripslashes($comment_text)), 1)
));
$email_template = "comment_image_html";
include(ROOT_PATH.'includes/email_bridge.php');
$sql= "UPDATE ".IMAGES_TABLE." SET image_sendmail = '0' WHERE image_id = $image_id";$site_db->query($sql);
}
unset($email_to);
// ################### End Send email when an answer to your Image #########################################
//################### Start send email when an answer to your comment #####################################
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name,c.comment_sendmail,u.user_id, u.user_comment_answer".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
FROM ".COMMENTS_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
WHERE c.image_id = $id AND c.comment_sendmail = 1 AND u.user_comment_answer = 1 AND u.user_id NOT IN ($image_owner_id,".$user_info['user_id'].")
";
$result = $site_db->query($sql);
$user_comment_answer = array();
while ($answer_row = $site_db->fetch_array($result)) {
$user_comment_answer[] = $answer_row['user_email'];
}
$site_db->free_result($result);
if(!empty($user_comment_answer)){
$user_comment_answer = array_unique($user_comment_answer);
$email_to = implode(",",$user_comment_answer);
}
$email_subject = $lang['user_comment_answer'];
$site_mailtemplate->register_vars(array(
"lang_added_by" => $lang['added_by'],
"lang_comment" => $lang['comment'],
"lang_date" => $lang['date'],
"subject" => $email_subject,
"user_name" => $user_info['user_name'],
"image_name" => $row['image_name'],
"comment_date" => format_date($config['date_format']." ".$config['time_format'], time()),
"image_url" => $script_url."/details.php?".URL_IMAGE_ID."=".$id."#comment".$commentid,
"message" => format_text(trim(stripslashes($comment_text)), 1)
));
$email_template = "comment_answer_html";
include(ROOT_PATH.'includes/email_bridge.php');
$sql= "UPDATE ".COMMENTS_TABLE." SET comment_sendmail = '0' WHERE image_id = $id AND user_id NOT IN (".$user_info['user_id'].")";$site_db->query($sql);
// #################### End Send email when an answer to your comment ############################################
6.4) suche:
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq")."
ersetze es mit:
//############# Send email when an answer to your comments in SQL Query "comment_sendmail"
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date,c.comment_sendmail".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq")."
6.5) suche:
$comments .= $site_template->parse_template("comment_bit");
} // end while
füge darunter ein:
//######################## Start Send email when an answer to your comment ############################
if($user_info['user_id']){
$sql= "UPDATE ".COMMENTS_TABLE." SET comment_sendmail = '1' WHERE image_id = $image_id AND user_id = ".$user_info['user_id']."";$site_db->query($sql);
}
//######################## End Send email when an answer to your comment ##############################
mfg Andi