From 485f127717b3b5eb94d36223ef164caecd0784fc Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 22 Dec 2002 16:01:16 +0000 Subject: [PATCH] Reintroduce setting of email subjects from source ... will only be used where an email template doesn't contain an appropriate subject line. Note this may lead to users having email subjects in a language other than that they selected. git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3238 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/groupcp.php | 6 +++--- phpBB/includes/emailer.php | 2 +- phpBB/includes/functions_post.php | 6 +++++- phpBB/includes/usercp_activate.php | 2 +- phpBB/includes/usercp_register.php | 6 +++--- phpBB/includes/usercp_sendpasswd.php | 2 +- phpBB/privmsg.php | 2 +- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/phpBB/groupcp.php b/phpBB/groupcp.php index d98638291a..1648219e44 100644 --- a/phpBB/groupcp.php +++ b/phpBB/groupcp.php @@ -288,7 +288,7 @@ else if ( isset($HTTP_POST_VARS['joingroup']) && $group_id ) $emailer->use_template('group_request', $moderator['user_lang']); $emailer->email_address($moderator['user_email']); - $emailer->set_subject();//$lang['Group_request'] + $emailer->set_subject($lang['Group_request']); $emailer->extra_headers($email_headers); $emailer->assign_vars(array( @@ -576,7 +576,7 @@ else if ( $group_id ) $emailer->use_template('group_added', $row['user_lang']); $emailer->email_address($row['user_email']); - $emailer->set_subject();//$lang['Group_added'] + $emailer->set_subject($lang['Group_added']); $emailer->extra_headers($email_headers); $emailer->assign_vars(array( @@ -731,7 +731,7 @@ else if ( $group_id ) $emailer->use_template('group_approved'); $emailer->email_address(' ');//$userdata['user_email'] - $emailer->set_subject();//$lang['Group_approved'] + $emailer->set_subject($lang['Group_approved']); $emailer->extra_headers($email_headers); $emailer->assign_vars(array( diff --git a/phpBB/includes/emailer.php b/phpBB/includes/emailer.php index 0a592aa85a..3e2c64ecd8 100755 --- a/phpBB/includes/emailer.php +++ b/phpBB/includes/emailer.php @@ -157,7 +157,7 @@ class emailer $match = array(); if (preg_match('#^(Subject:(.*?))$#m', $this->msg, $match)) { - $this->subject = ($this->subject != '') ? $this->subject : trim($match[2]); + $this->subject = (trim($match[2]) != '') ? trim($match[2]) : (($this->subject != '') ? $this->subject : 'No Subject'); $drop_header .= '[\r\n]*?' . $match[1]; } diff --git a/phpBB/includes/functions_post.php b/phpBB/includes/functions_post.php index 40548632fd..8ff2680ab3 100644 --- a/phpBB/includes/functions_post.php +++ b/phpBB/includes/functions_post.php @@ -670,7 +670,11 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi { $emailer->use_template('topic_notify', $user_lang); $emailer->email_address(' '); - $emailer->set_subject(); + // The Topic_reply_notification lang string below will be used + // if for some reason the mail template subject cannot be read + // ... note it will not necessarily be in the posters own language! + $emailer->set_subject($lang['Topic_reply_notification']); + $emailer->extra_headers($email_headers . "Bcc: $bcc_list\n"); // This is a nasty kludge to remove the username var ... till (if?) diff --git a/phpBB/includes/usercp_activate.php b/phpBB/includes/usercp_activate.php index d5d226ea8e..252bddbaa5 100644 --- a/phpBB/includes/usercp_activate.php +++ b/phpBB/includes/usercp_activate.php @@ -66,7 +66,7 @@ if ( $row = $db->sql_fetchrow($result) ) $emailer->use_template('admin_welcome_activated', $row['user_lang']); $emailer->email_address($row['user_email']); - $emailer->set_subject();//$lang['Account_activated_subject'] + $emailer->set_subject($lang['Account_activated_subject']); $emailer->extra_headers($email_headers); $emailer->assign_vars(array( diff --git a/phpBB/includes/usercp_register.php b/phpBB/includes/usercp_register.php index aa3aa086f3..cfcecd8c37 100644 --- a/phpBB/includes/usercp_register.php +++ b/phpBB/includes/usercp_register.php @@ -468,7 +468,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) $emailer->use_template('user_activate', stripslashes($user_lang)); $emailer->email_address($email); - $emailer->set_subject();//$lang['Reactivate'] + $emailer->set_subject($lang['Reactivate']); $emailer->extra_headers($email_headers); $emailer->assign_vars(array( @@ -576,7 +576,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) $emailer->use_template($email_template, stripslashes($user_lang)); $emailer->email_address($email); - $emailer->set_subject();//sprintf($lang['Welcome_subject'], $board_config['sitename']) + $emailer->set_subject(sprintf($lang['Welcome_subject'], $board_config['sitename'])); $emailer->extra_headers($email_headers); if( $coppa ) @@ -622,7 +622,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) //$emailer->use_template("admin_activate", stripslashes($user_lang)); $emailer->use_template("admin_activate", $board_config['default_lang']); $emailer->email_address($board_config['board_email']); - $emailer->set_subject(); //$lang['New_account_subject'] + $emailer->set_subject($lang['New_account_subject']); $emailer->extra_headers($email_headers); $emailer->assign_vars(array( diff --git a/phpBB/includes/usercp_sendpasswd.php b/phpBB/includes/usercp_sendpasswd.php index 21942b36e2..609907ede9 100644 --- a/phpBB/includes/usercp_sendpasswd.php +++ b/phpBB/includes/usercp_sendpasswd.php @@ -75,7 +75,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) $emailer->use_template('user_activate_passwd', $row['user_lang']); $emailer->email_address($row['user_email']); - $emailer->set_subject();//$lang['New_password_activation'] + $emailer->set_subject($lang['New_password_activation']); $emailer->extra_headers($email_headers); $emailer->assign_vars(array( diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php index 0434a39a38..4f5e6466f5 100644 --- a/phpBB/privmsg.php +++ b/phpBB/privmsg.php @@ -1324,7 +1324,7 @@ else if ( $submit || $refresh || $mode != '' ) $emailer->use_template('privmsg_notify', $to_userdata['user_lang']); $emailer->extra_headers($email_headers); $emailer->email_address($to_userdata['user_email']); - $emailer->set_subject(); //$lang['Notification_subject'] + $emailer->set_subject($lang['Notification_subject']); $emailer->assign_vars(array( 'USERNAME' => $to_username,