|
From: Paul S. O. <ps...@us...> - 2002-05-17 13:31:59
|
Update of /cvsroot/phpbb/phpBB2/includes
In directory usw-pr-cvs1:/tmp/cvs-serv3880/includes
Modified Files:
Tag: phpBB-2_0_0
emailer.php functions_admin.php functions_post.php
usercp_email.php
Log Message:
More updates ... added Date and Content-type/encoding output for the emails, updated all email templates
Index: emailer.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/emailer.php,v
retrieving revision 1.15.2.1
retrieving revision 1.15.2.2
diff -C2 -r1.15.2.1 -r1.15.2.2
*** emailer.php 7 Apr 2002 00:52:41 -0000 1.15.2.1
--- emailer.php 17 May 2002 13:13:34 -0000 1.15.2.2
***************
*** 39,44 ****
$this->tpl_file = NULL;
$this->address = NULL;
! $this->msg = "";
! $this->mimeOut = "";
}
--- 39,44 ----
$this->tpl_file = NULL;
$this->address = NULL;
! $this->msg = '';
! $this->mimeOut = '';
}
***************
*** 48,56 ****
function reset()
{
! $this->tpl_file = "";
! $this->address = "";
! $this->msg = "";
! $this->memOut = "";
! $this->vars = "";
}
--- 48,56 ----
function reset()
{
! $this->tpl_file = '';
! $this->address = '';
! $this->msg = '';
! $this->memOut = '';
! $this->vars = '';
}
***************
*** 60,70 ****
function email_address($address)
{
-
- $success = true;
-
$this->address = '';
$this->address .= $address;
-
- return $success;
}
--- 60,65 ----
***************
*** 85,112 ****
}
! function use_template($template_file, $template_lang = "")
{
global $board_config, $phpbb_root_path;
! if( $template_lang == "" )
{
$template_lang = $board_config['default_lang'];
}
! $template_file = $phpbb_root_path . "language/lang_" . $template_lang . "/email/" . $template_file . ".tpl";
! if( !file_exists($template_file) )
{
! message_die(GENERAL_ERROR, "Couldn't find template file: $template_file", "", __LINE__, __FILE__);
}
! else
{
! $this->tpl_file = $template_file;
! if( !$this->load_msg() )
! {
! message_die(GENERAL_ERROR, "Couldn't load template file: $template_file", "", __LINE__, __FILE__);
! }
}
! return TRUE;
}
--- 80,104 ----
}
! function use_template($template_file, $template_lang = '')
{
global $board_config, $phpbb_root_path;
! if ( $template_lang == '' )
{
$template_lang = $board_config['default_lang'];
}
! $this->tpl_file = $phpbb_root_path . 'language/lang_' . $template_lang . '/email/' . $template_file . '.tpl';
! if ( !file_exists($this->tpl_file) )
{
! message_die(GENERAL_ERROR, 'Could not find email template file ' . $template_file, '', __LINE__, __FILE__);
}
!
! if ( !$this->load_msg() )
{
! message_die(GENERAL_ERROR, 'Could not load email template file ' . $template_file, '', __LINE__, __FILE__);
}
! return true;
}
***************
*** 116,148 ****
function load_msg()
{
! if ($this->tpl_file == NULL)
{
! message_die(GENERAL_ERROR, "No template file set", "", __LINE__, __FILE__);
}
! else
{
! if(!($fd = fopen($this->tpl_file, 'r')))
! {
! message_die(GENERAL_ERROR, "fopen failed opening template file", "", __LINE__, __FILE__);
! }
! else
! {
! $this->msg .= fread($fd, filesize($this->tpl_file));
! fclose($fd);
! }
}
! return TRUE;
}
function assign_vars($vars)
{
! if(empty($this->vars))
! {
! $this->vars = $vars;
! }
! else
! {
! $this->vars .= $vars;
! }
}
--- 108,130 ----
function load_msg()
{
! if ( $this->tpl_file == NULL )
{
! message_die(GENERAL_ERROR, 'No template file set', '', __LINE__, __FILE__);
}
!
! if ( !($fd = fopen($this->tpl_file, 'r')) )
{
! message_die(GENERAL_ERROR, 'Failed opening template file', '', __LINE__, __FILE__);
}
!
! $this->msg .= fread($fd, filesize($this->tpl_file));
! fclose($fd);
!
! return true;
}
function assign_vars($vars)
{
! $this->vars = ( empty($this->vars) ) ? $vars : $this->vars . $vars;
}
***************
*** 166,175 ****
//
$match = array();
! preg_match("/^(Subject:(.*?)[\r\n]+?)?(.*?)$/is", $this->msg, $match);
! $this->msg = ( isset($match[3]) ) ? trim($match[3]) : '';
$this->subject = ( $this->subject != '' ) ? $this->subject : trim($match[2]);
! return TRUE;
}
--- 148,158 ----
//
$match = array();
! preg_match("/^(Subject:(.*?)[\r\n]+?)?(Charset:(.*?)[\r\n]+?)?(.*?)$/is", $this->msg, $match);
! $this->msg = ( isset($match[5]) ) ? trim($match[5]) : '';
$this->subject = ( $this->subject != '' ) ? $this->subject : trim($match[2]);
+ $this->encoding = ( trim($match[4]) != '' ) ? trim($match[4]) : 'iso-8859-1';
! return true;
}
***************
*** 181,223 ****
global $phpEx, $phpbb_root_path;
! if ($this->address == NULL)
{
! message_die(GENERAL_ERROR, "No email address set", "", __LINE__, __FILE__);
}
! else
{
! if(!$this->parse_email())
! {
! return FALSE;
! }
! if($this->use_smtp)
! {
! if(!defined('SMTP_INCLUDED'))
! {
! include($phpbb_root_path . "includes/smtp.".$phpEx);
! }
! if(!smtpmail($this->address, $this->subject, $this->msg, $this->extra_headers))
! {
! message_die(GENERAL_ERROR, "Sending via SMTP failed", "", __LINE__, __FILE__);
! }
! }
! else
{
! @mail($this->address, $this->subject, $this->msg, $this->extra_headers);
}
}
! return TRUE;
}
//
! // Attach files via MIME.
//
! function attachFile($filename, $mimetype="application/octet-stream", $szFromAddress, $szFilenameToDisplay)
{
$mime_boundary = "--==================_846811060==_";
! $this->mailMsg = "--".$mime_boundary."\nContent-Type: text/plain;\n\tcharset=\"iso-8859-1\"\n\n".$this->mailMsg;
if ($mime_filename)
--- 164,214 ----
global $phpEx, $phpbb_root_path;
! if ( $this->address == NULL )
{
! message_die(GENERAL_ERROR, 'No email address set', '', __LINE__, __FILE__);
}
!
! if ( !$this->parse_email() )
{
! return false;
! }
!
! //
! // Add date and encoding type
! //
! $universal_extra = "MIME-Version: 1.0\r\nContent-type: text/plain; charset=" . $this->encoding . "\r\nContent-transfer-encoding: 8bit\r\nDate: " . gmdate('D, d M Y H:i:s', time()) . " UT\r\n";
! $this->extra_headers = $universal_extra . $this->extra_headers;
!
! if ( $this->use_smtp )
! {
! if ( !defined('SMTP_INCLUDED') )
{
! include($phpbb_root_path . 'includes/smtp.' . $phpEx);
}
+
+ $result = smtpmail($this->address, $this->subject, $this->msg, $this->extra_headers);
+ }
+ else
+ {
+ $result = @mail($this->address, $this->subject, $this->msg, $this->extra_headers);
+ }
+
+ if ( !$result )
+ {
+ message_die(GENERAL_ERROR, 'Failed sending email', '', __LINE__, __FILE__);
}
! return true;
}
//
! // Attach files via MIME.
//
! function attachFile($filename, $mimetype = "application/octet-stream", $szFromAddress, $szFilenameToDisplay)
{
$mime_boundary = "--==================_846811060==_";
! $this->mailMsg = '--' . $mime_boundary . "\nContent-Type: text/plain;\n\tcharset=\"iso-8859-1\"\n\n" . $this->mailMsg;
if ($mime_filename)
***************
*** 235,243 ****
$this->mimeOut .= "Content-Disposition: attachment;\n\tfilename=\"$szFilenameToDisplay\"\n\n";
! if ($mimetype == "message/rfc822")
{
$this->mimeOut .= "From: ".$szFromAddress."\n";
$this->mimeOut .= "To: ".$this->emailAddress."\n";
! $this->mimeOut .= "Date: ".date("D, d M Y G:i:s ").$this->getTimeZoneInEmailFormat()."\n";
$this->mimeOut .= "Reply-To:".$szFromAddress."\n";
$this->mimeOut .= "Subject: ".$this->mailSubject."\n";
--- 226,234 ----
$this->mimeOut .= "Content-Disposition: attachment;\n\tfilename=\"$szFilenameToDisplay\"\n\n";
! if ( $mimetype == "message/rfc822" )
{
$this->mimeOut .= "From: ".$szFromAddress."\n";
$this->mimeOut .= "To: ".$this->emailAddress."\n";
! $this->mimeOut .= "Date: ".date("D, d M Y H:i:s") . " UT\n";
$this->mimeOut .= "Reply-To:".$szFromAddress."\n";
$this->mimeOut .= "Subject: ".$this->mailSubject."\n";
Index: functions_admin.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions_admin.php,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -C2 -r1.5.2.1 -r1.5.2.2
*** functions_admin.php 14 May 2002 15:19:20 -0000 1.5.2.1
--- functions_admin.php 17 May 2002 13:13:35 -0000 1.5.2.2
***************
*** 56,60 ****
// Synchronise functions for forums/topics
//
! function sync($type, $id)
{
global $db;
--- 56,60 ----
// Synchronise functions for forums/topics
//
! function sync($type, $id = false)
{
global $db;
Index: functions_post.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/functions_post.php,v
retrieving revision 1.9.2.4
retrieving revision 1.9.2.5
diff -C2 -r1.9.2.4 -r1.9.2.5
*** functions_post.php 14 May 2002 15:19:20 -0000 1.9.2.4
--- functions_post.php 17 May 2002 13:13:35 -0000 1.9.2.5
***************
*** 268,272 ****
$topic_vote = ( !empty($poll_title) && count($poll_options) >= 2 ) ? 1 : 0;
$sql = ( $mode != "editpost" ) ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type, topic_vote = $topic_vote WHERE topic_id = $topic_id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
--- 268,272 ----
$topic_vote = ( !empty($poll_title) && count($poll_options) >= 2 ) ? 1 : 0;
$sql = ( $mode != "editpost" ) ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type, topic_vote = $topic_vote WHERE topic_id = $topic_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
***************
*** 281,285 ****
$edited_sql = ( $mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post'] ) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";
$sql = ( $mode != "editpost" ) ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id";
! if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
--- 281,285 ----
$edited_sql = ( $mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post'] ) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";
$sql = ( $mode != "editpost" ) ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id";
! if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
***************
*** 292,296 ****
$sql = ( $mode != 'editpost' ) ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$post_subject', '$bbcode_uid', '$post_message')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message', bbcode_uid = '$bbcode_uid', post_subject = '$post_subject' WHERE post_id = $post_id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
--- 292,296 ----
$sql = ( $mode != 'editpost' ) ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$post_subject', '$bbcode_uid', '$post_message')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message', bbcode_uid = '$bbcode_uid', post_subject = '$post_subject' WHERE post_id = $post_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
***************
*** 305,309 ****
{
$sql = ( !$post_data['has_poll'] ) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title', $current_time, " . ( $poll_length * 86400 ) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ( $poll_length * 86400 ) . " WHERE topic_id = $topic_id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
--- 305,309 ----
{
$sql = ( !$post_data['has_poll'] ) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title', $current_time, " . ( $poll_length * 86400 ) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ( $poll_length * 86400 ) . " WHERE topic_id = $topic_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
***************
*** 349,353 ****
$sql = ( $mode != "editpost" || !isset($old_poll_result[$option_id]) ) ? "INSERT INTO " . VOTE_RESULTS_TABLE . " (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)" : "UPDATE " . VOTE_RESULTS_TABLE . " SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
--- 349,353 ----
$sql = ( $mode != "editpost" || !isset($old_poll_result[$option_id]) ) ? "INSERT INTO " . VOTE_RESULTS_TABLE . " (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)" : "UPDATE " . VOTE_RESULTS_TABLE . " SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
***************
*** 360,365 ****
{
$sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "
! WHERE vote_option_id IN ($delete_option_sql)";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error deleting pruned poll options', '', __LINE__, __FILE__, $sql);
--- 360,366 ----
{
$sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "
! WHERE vote_option_id IN ($delete_option_sql)
! AND vote_id = $poll_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error deleting pruned poll options', '', __LINE__, __FILE__, $sql);
***************
*** 396,405 ****
{
! $topic_update_sql .= "topic_replies = topic_replies - 1";
$sql = "SELECT MAX(post_id) AS last_post_id
FROM " . POSTS_TABLE . "
WHERE topic_id = $topic_id";
! if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
--- 397,406 ----
{
! $topic_update_sql .= 'topic_replies = topic_replies - 1';
$sql = "SELECT MAX(post_id) AS last_post_id
FROM " . POSTS_TABLE . "
WHERE topic_id = $topic_id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
***************
*** 417,421 ****
FROM " . POSTS_TABLE . "
WHERE forum_id = $forum_id";
! if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
--- 418,422 ----
FROM " . POSTS_TABLE . "
WHERE forum_id = $forum_id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
***************
*** 433,437 ****
FROM " . POSTS_TABLE . "
WHERE topic_id = $topic_id";
! if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
--- 434,438 ----
FROM " . POSTS_TABLE . "
WHERE topic_id = $topic_id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
***************
*** 461,465 ****
$forum_update_sql
WHERE forum_id = $forum_id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
--- 462,466 ----
$forum_update_sql
WHERE forum_id = $forum_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
***************
*** 472,476 ****
WHERE topic_id = $topic_id
OR topic_moved_id = $topic_id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
--- 473,477 ----
WHERE topic_id = $topic_id
OR topic_moved_id = $topic_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
***************
*** 483,487 ****
SET user_posts = user_posts $sign
WHERE user_id = $user_id";
! if ( !($result = $db->sql_query($sql, END_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
--- 484,488 ----
SET user_posts = user_posts $sign
WHERE user_id = $user_id";
! if ( !$db->sql_query($sql, END_TRANSACTION) )
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
***************
*** 506,510 ****
$sql = "DELETE FROM " . POSTS_TABLE . "
WHERE post_id = $post_id";
! if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
--- 507,511 ----
$sql = "DELETE FROM " . POSTS_TABLE . "
WHERE post_id = $post_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
***************
*** 513,517 ****
$sql = "DELETE FROM " . POSTS_TEXT_TABLE . "
WHERE post_id = $post_id";
! if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
--- 514,518 ----
$sql = "DELETE FROM " . POSTS_TEXT_TABLE . "
WHERE post_id = $post_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
***************
*** 526,530 ****
WHERE topic_id = $topic_id
OR topic_moved_id = $topic_id";
! if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
--- 527,531 ----
WHERE topic_id = $topic_id
OR topic_moved_id = $topic_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
***************
*** 533,537 ****
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id";
! if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
--- 534,538 ----
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
***************
*** 547,551 ****
$sql = "DELETE FROM " . VOTE_DESC_TABLE . "
WHERE topic_id = $topic_id";
! if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);
--- 548,552 ----
$sql = "DELETE FROM " . VOTE_DESC_TABLE . "
WHERE topic_id = $topic_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);
***************
*** 554,558 ****
$sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "
WHERE vote_id = $poll_id";
! if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);
--- 555,559 ----
$sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "
WHERE vote_id = $poll_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);
***************
*** 561,565 ****
$sql = "DELETE FROM " . VOTE_USERS_TABLE . "
WHERE vote_id = $poll_id";
! if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);
--- 562,566 ----
$sql = "DELETE FROM " . VOTE_USERS_TABLE . "
WHERE vote_id = $poll_id";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);
***************
*** 597,601 ****
$delete_sql = ( !$post_data['first_post'] && !$post_data['last_post'] ) ? " AND user_id = " . $userdata['user_id'] : '';
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " WHERE topic_id = $topic_id" . $delete_sql;
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not change topic notify data', '', __LINE__, __FILE__, $sql);
--- 598,602 ----
$delete_sql = ( !$post_data['first_post'] && !$post_data['last_post'] ) ? " AND user_id = " . $userdata['user_id'] : '';
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " WHERE topic_id = $topic_id" . $delete_sql;
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not change topic notify data', '', __LINE__, __FILE__, $sql);
***************
*** 647,651 ****
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
! $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
$update_watched_sql = '';
--- 648,652 ----
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
! $email_headers = 'From: ' . $board_config['board_email'] . "\r\nReturn-Path: " . $board_config['board_email'] . "\r\n";
$update_watched_sql = '';
***************
*** 660,664 ****
$emailer->use_template('topic_notify', $row['user_lang']);
$emailer->email_address($row['user_email']);
! $emailer->set_subject();//$lang['Topic_reply_notification']
$emailer->extra_headers($email_headers);
--- 661,665 ----
$emailer->use_template('topic_notify', $row['user_lang']);
$emailer->email_address($row['user_email']);
! $emailer->set_subject();
$emailer->extra_headers($email_headers);
***************
*** 708,712 ****
WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id'];
! if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete topic watch information', '', __LINE__, __FILE__, $sql);
--- 709,713 ----
WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id'];
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete topic watch information', '', __LINE__, __FILE__, $sql);
***************
*** 717,721 ****
$sql = "INSERT INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status)
VALUES (" . $userdata['user_id'] . ", $topic_id, 0)";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not insert topic watch information', '', __LINE__, __FILE__, $sql);
--- 718,722 ----
$sql = "INSERT INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status)
VALUES (" . $userdata['user_id'] . ", $topic_id, 0)";
! if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert topic watch information', '', __LINE__, __FILE__, $sql);
Index: usercp_email.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/includes/usercp_email.php,v
retrieving revision 1.7.2.1
retrieving revision 1.7.2.2
diff -C2 -r1.7.2.1 -r1.7.2.2
*** usercp_email.php 5 Apr 2002 17:01:53 -0000 1.7.2.1
--- usercp_email.php 17 May 2002 13:13:35 -0000 1.7.2.2
***************
*** 95,107 ****
$emailer = new emailer($board_config['smtp_delivery']);
! $email_headers = 'From: ' . $userdata['user_email'] . "\n";
! if ( !empty($HTTP_POST_VARS['cc_email']) )
! {
! $email_headers .= "Cc: " . $userdata['user_email'] . "\n";
! }
! $email_headers .= 'Return-Path: ' . $userdata['user_email'] . "\n";
! $email_headers .= 'X-AntiAbuse: Board servername - ' . $server_name . "\n";
! $email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n";
! $email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n";
$email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\r\n";
--- 95,102 ----
$emailer = new emailer($board_config['smtp_delivery']);
! $email_headers = 'Return-Path: ' . $userdata['user_email'] . "\r\nFrom: " . $userdata['user_email'] . "\r\n";
! $email_headers .= 'X-AntiAbuse: Board servername - ' . $server_name . "\r\n";
! $email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\r\n";
! $email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\r\n";
$email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\r\n";
***************
*** 120,123 ****
--- 115,137 ----
$emailer->send();
$emailer->reset();
+
+ if ( !empty($HTTP_POST_VARS['cc_email']) )
+ {
+ $email_headers = 'Return-Path: ' . $userdata['user_email'] . "\r\nFrom: " . $userdata['user_email'] . "\r\n";
+ $emailer->use_template('profile_send_email');
+ $emailer->email_address($userdata['user_email']);
+ $emailer->set_subject($subject);
+ $emailer->extra_headers($email_headers);
+
+ $emailer->assign_vars(array(
+ 'SITENAME' => $board_config['sitename'],
+ 'BOARD_EMAIL' => $board_config['board_email'],
+ 'FROM_USERNAME' => $userdata['username'],
+ 'TO_USERNAME' => $username,
+ 'MESSAGE' => $message)
+ );
+ $emailer->send();
+ $emailer->reset();
+ }
$template->assign_vars(array(
|