I've recently been trying to mod my phpBB 3.1 forum, so that the post contents are also displayed in e-mail notifications. After some digging, I have made the following modifications:
Code: Select all
diff a/phpbb/notification/type/topic.php b/phpbb/notification/type/topic.php
index 5f57087..c12746f 100644
--- a/topic.php
+++ b/topic_mod.php
@@ -202,6 +202,7 @@ class topic extends \phpbb\notification\type\base
'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'))),
+ 'POST_TEXT' => htmlspecialchars_decode(censor_text($this->get_data('post_text'))),
'U_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->item_parent_id}&t={$this->item_id}",
'U_VIEW_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->item_parent_id}&t={$this->item_id}",
@@ -280,6 +281,8 @@ class topic extends \phpbb\notification\type\base
$this->set_data('post_username', (($post['poster_id'] == ANONYMOUS) ? $post['post_username'] : ''));
$this->set_data('forum_name', $post['forum_name']);
+
+ $this->set_data('post_text', $post['post_text']);
$this->notification_time = $post['post_time'];
Code: Select all
// Send Notifications
$notification_data = array_merge($data, array(
'topic_title' => (isset($data['topic_title'])) ? $data['topic_title'] : $subject,
'post_username' => $username,
'poster_id' => $poster_id,
'post_text' => $data['message'],
'post_time' => $current_time,
'post_subject' => $subject,
));
Thanks in advance!