From 77bc12d334167ec5d1c7e3bc7c2b582218df32f6 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Tue, 16 Oct 2012 23:27:49 -0500 Subject: [PATCH] [ticket/11103] Add author name output to post/topic email templates For a recent merge: https://github.com/phpbb/phpbb3/pull/624 PHPBB3-11103 --- phpBB/includes/notification/type/post.php | 12 ++++++++++++ phpBB/includes/notification/type/topic.php | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/phpBB/includes/notification/type/post.php b/phpBB/includes/notification/type/post.php index ee26a8c33e..0681b4418c 100644 --- a/phpBB/includes/notification/type/post.php +++ b/phpBB/includes/notification/type/post.php @@ -223,7 +223,19 @@ class phpbb_notification_type_post extends phpbb_notification_type_base */ public function get_email_template_variables() { + if ($this->get_data('post_username')) + { + $username = $this->get_data('post_username'); + } + else + { + $user_data = $this->notification_manager->get_user($this->get_data('poster_id')); + + $username = get_username_string('username', $user_data['user_id'], $user_data['username'], $user_data['user_colour']); + } + return array( + 'AUTHOR_NAME' => htmlspecialchars_decode($username), 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject'))), 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))), diff --git a/phpBB/includes/notification/type/topic.php b/phpBB/includes/notification/type/topic.php index 237f430003..a9beb469c3 100644 --- a/phpBB/includes/notification/type/topic.php +++ b/phpBB/includes/notification/type/topic.php @@ -186,7 +186,19 @@ class phpbb_notification_type_topic extends phpbb_notification_type_base */ public function get_email_template_variables() { + if ($this->get_data('post_username')) + { + $username = $this->get_data('post_username'); + } + else + { + $user_data = $this->notification_manager->get_user($this->get_data('poster_id')); + + $username = get_username_string('username', $user_data['user_id'], $user_data['username'], $user_data['user_colour']); + } + return array( + 'AUTHOR_NAME' => htmlspecialchars_decode($username), 'FORUM_NAME' => htmlspecialchars_decode($this->get_data('forum_name')), 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),