diff --git a/phpBB/includes/emailer.php b/phpBB/includes/emailer.php
index 1934224648..a25735ca79 100755
--- a/phpBB/includes/emailer.php
+++ b/phpBB/includes/emailer.php
@@ -23,6 +23,7 @@ class emailer
{
var $msg, $subject, $extra_headers;
var $to_addres, $cc_address, $bcc_address;
+ var $reply_to, $from;
var $tpl_msg = array();
@@ -35,7 +36,7 @@ class emailer
function reset()
{
$this->addresses = array();
- $this->vars = $this->msg = $this->extra_headers = $this->replyto = '';
+ $this->vars = $this->msg = $this->extra_headers = $this->replyto = $this->from = '';
}
// Sets an email address to send to
@@ -65,6 +66,11 @@ class emailer
$this->replyto = trim($address);
}
+ function from($address)
+ {
+ $this->from = trim($address);
+ }
+
// set up subject for mail
function subject($subject = '')
{
@@ -169,12 +175,12 @@ class emailer
if (preg_match('#^(Charset:(.*?))$#m', $this->msg, $match))
{
- $this->encoding = (trim($match[2]) != '') ? trim($match[2]) : trim($lang['ENCODING']);
+ $this->encoding = (trim($match[2]) != '') ? trim($match[2]) : trim($user->lang['ENCODING']);
$drop_header .= '[\r\n]*?' . preg_quote($match[1], '#');
}
else
{
- $this->encoding = trim($lang['ENCODING']);
+ $this->encoding = trim($user->lang['ENCODING']);
}
if ($drop_header != '')
@@ -193,7 +199,7 @@ class emailer
}
// Build header
- $this->extra_headers = (($this->replyto !='') ? "Reply-to: <$this->replyto>\r\n" : '') . "From: <" . $config['board_email'] . ">\r\nReturn-Path: <" . $config['board_email'] . ">\r\nMessage-ID: <" . md5(uniqid(time())) . "@" . $config['server_name'] . ">\r\nMIME-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 Z', time()) . "\r\nX-Priority: 3\r\nX-MSMail-Priority: Normal\r\nX-Mailer: PHP\r\n" . (($cc != '') ? "Cc:$cc\r\n" : '') . (($bcc != '') ? "Bcc:$bcc\r\n" : '') . trim($this->extra_headers);
+ $this->extra_headers = (($this->replyto !='') ? "Reply-to: <$this->replyto>\r\n" : '') . (($this->from != '') ? "From: <$this->from>\r\n" : "From: <" . $config['board_email'] . ">\r\n") . "Return-Path: <" . $config['board_email'] . ">\r\nMessage-ID: <" . md5(uniqid(time())) . "@" . $config['server_name'] . ">\r\nMIME-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 Z', time()) . "\r\nX-Priority: 3\r\nX-MSMail-Priority: Normal\r\nX-Mailer: PHP\r\n" . (($cc != '') ? "Cc:$cc\r\n" : '') . (($bcc != '') ? "Bcc:$bcc\r\n" : '') . trim($this->extra_headers);
// Send message ... removed $this->encode() from subject for time being
$result = ($config['smtp_delivery']) ? smtpmail($to, $this->subject, $this->msg, $this->extra_headers) : mail($to, $this->subject, preg_replace("#(?msg), $this->extra_headers);
diff --git a/phpBB/templates/subSilver/viewtopic_attach_body.html b/phpBB/templates/subSilver/viewtopic_attach_body.html
index b1fa754d56..c2c8ec0298 100644
--- a/phpBB/templates/subSilver/viewtopic_attach_body.html
+++ b/phpBB/templates/subSilver/viewtopic_attach_body.html
@@ -59,7 +59,7 @@
{postrow.attachment.DOWNLOAD_NAME} - {postrow.attachment.L_DOWNLOADED_VIEWED} {postrow.attachment.L_DOWNLOAD_COUNT}
{postrow.attachment.COMMENT}
-
+
{postrow.attachment.DOWNLOAD_NAME} - {postrow.attachment.L_DOWNLOADED_VIEWED} {postrow.attachment.L_DOWNLOAD_COUNT}
{postrow.attachment.COMMENT}
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 75ec334c5b..1ad7c5091d 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1207,8 +1207,7 @@ foreach ($rowset as $key => $row)
{
case IMAGE_CAT:
// Images
- // NOTE: If you want to use the download.php everytime an image is displayed inlined, replace the
- // Section between BEGIN and END with (Without the // of course):
+ // NOTE: If you want to use the download.php everytime an image is displayed inlined, use this line:
// $img_source = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id'];
if (!empty($config['ftp_upload']) && trim($config['upload_dir']) == '')
{
@@ -1226,8 +1225,7 @@ foreach ($rowset as $key => $row)
case THUMB_CAT:
// Images, but display Thumbnail
- // NOTE: If you want to use the download.php everytime an thumnmail is displayed inlined, replace the
- // Section between BEGIN and END with (Without the // of course):
+ // NOTE: If you want to use the download.php everytime an thumnmail is displayed inlined, use this line:
// $thumb_source = $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $attachment['attach_id'] . '&thumb=1';
if (!empty($config['allow_ftp_upload']) && trim($config['upload_dir']) == '')
{
@@ -1242,7 +1240,7 @@ foreach ($rowset as $key => $row)
$download_link = $phpbb_root_path . "download.$phpEx$SID&id=" . $attachment['attach_id'];
$additional_array = array(
- 'IMG_THUMB_SRC' => $thumb_source // should be THUMB_IMG or similar
+ 'THUMB_IMG' => $thumb_source
);
break;
@@ -1282,10 +1280,7 @@ foreach ($rowset as $key => $row)
);
// Viewed/Heared File ... update the download count (download.php is not called here)
- if (!preg_match("#&t=$topic_id#", $user->data['session_page']))
- {
- $update_count[] = $attachment['attach_id'];
- }
+ $update_count[] = $attachment['attach_id'];
break;
*/
default: