1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-25 12:33:29 +01:00

[ticket/11103] Add author name output to post/topic email templates

For a recent merge:
https://github.com/phpbb/phpbb3/pull/624

PHPBB3-11103
This commit is contained in:
Nathan Guse 2012-10-16 23:27:49 -05:00
parent 0d098ae5e5
commit 77bc12d334
2 changed files with 24 additions and 0 deletions

View File

@ -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'))),

View File

@ -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'))),