From 5b927b016203cf0eb73bc33a787b778b9f614578 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 3 May 2003 23:33:04 +0000 Subject: [PATCH] only very small things. git-svn-id: file:///svn/phpbb/trunk@3967 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/emailer.php | 14 ++++++++++---- .../templates/subSilver/viewtopic_attach_body.html | 2 +- phpBB/viewtopic.php | 13 ++++--------- 3 files changed, 15 insertions(+), 14 deletions(-) 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.DOWNLOAD_NAME}
{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: