aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-10-16 23:27:49 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2012-10-16 23:27:49 -0500
commit77bc12d334167ec5d1c7e3bc7c2b582218df32f6 (patch)
treea6a63803f7f1e4029bc078adfebd9b5b72e650f2
parent0d098ae5e5768e6ceb21a65f350f521ebe3c1908 (diff)
downloadforums-77bc12d334167ec5d1c7e3bc7c2b582218df32f6.tar
forums-77bc12d334167ec5d1c7e3bc7c2b582218df32f6.tar.gz
forums-77bc12d334167ec5d1c7e3bc7c2b582218df32f6.tar.bz2
forums-77bc12d334167ec5d1c7e3bc7c2b582218df32f6.tar.xz
forums-77bc12d334167ec5d1c7e3bc7c2b582218df32f6.zip
[ticket/11103] Add author name output to post/topic email templates
For a recent merge: https://github.com/phpbb/phpbb3/pull/624 PHPBB3-11103
-rw-r--r--phpBB/includes/notification/type/post.php12
-rw-r--r--phpBB/includes/notification/type/topic.php12
2 files changed, 24 insertions, 0 deletions
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'))),