aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
authorNathaniel Guse <nathaniel.guse@gmail.com>2012-09-25 10:10:10 -0500
committerNathaniel Guse <nathaniel.guse@gmail.com>2012-09-25 10:10:10 -0500
commitaa3f6f4002094d29952d0383107af687bf7dcb15 (patch)
tree867186d5dea73bfc0e4ca237e82529995e43292a /phpBB/includes/functions_posting.php
parent3897a442f7fe0107cf71adc02af999b496bfebaf (diff)
downloadforums-aa3f6f4002094d29952d0383107af687bf7dcb15.tar
forums-aa3f6f4002094d29952d0383107af687bf7dcb15.tar.gz
forums-aa3f6f4002094d29952d0383107af687bf7dcb15.tar.bz2
forums-aa3f6f4002094d29952d0383107af687bf7dcb15.tar.xz
forums-aa3f6f4002094d29952d0383107af687bf7dcb15.zip
[ticket/11103] Fixing some bugs with the post/topic notifications
PHPBB3-11103
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php43
1 files changed, 13 insertions, 30 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 4ae5989fed..41bdd9f598 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -2221,41 +2221,32 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// Send Notifications
$phpbb_notifications = $phpbb_container->get('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,
+ ));
if ($post_approval)
{
switch ($mode)
{
case 'post' :
- $phpbb_notifications->add_notifications(array('topic', 'quote'), array_merge($data, array(
- 'post_username' => $username,
- 'poster_id' => (int) $user->data['user_id'],
- 'post_time' => $current_time,
- )));
+ $phpbb_notifications->add_notifications(array('topic', 'quote'), $notification_data);
break;
case 'reply' :
case 'quote' :
- $phpbb_notifications->add_notifications(array('quote', 'bookmark', 'post'), array_merge($data, array(
- 'post_username' => $username,
- 'poster_id' => (int) $user->data['user_id'],
- 'post_text' => $data['message'],
- 'post_time' => $current_time,
- )));
+ $phpbb_notifications->add_notifications(array('quote', 'bookmark', 'post'), $notification_data);
break;
case 'edit_topic' :
case 'edit_first_post' :
case 'edit' :
case 'edit_last_post' :
- $phpbb_notifications->update_notifications('topic', array_merge($data, array(
- 'post_username' => $username,
- 'topic_title' => $subject,
- )));
-
- $phpbb_notifications->update_notifications(array('quote', 'bookmark', 'post'), array_merge($data, array(
- 'post_username' => $username,
- 'post_text' => $data['message'],
- )));
+ $phpbb_notifications->update_notifications(array('quote', 'bookmark', 'topic', 'post'), $notification_data);
break;
}
}
@@ -2264,20 +2255,12 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
switch ($mode)
{
case 'post' :
- $phpbb_notifications->add_notifications(array('topic_in_queue'), array_merge($data, array(
- 'post_username' => $username,
- 'poster_id' => (int) $user->data['user_id'],
- 'post_time' => $current_time,
- )));
+ $phpbb_notifications->add_notifications(array('topic_in_queue'), $notification_data);
break;
case 'reply' :
case 'quote' :
- $phpbb_notifications->add_notifications(array('post_in_queue'), array_merge($data, array(
- 'post_username' => $username,
- 'poster_id' => (int) $user->data['user_id'],
- 'post_time' => $current_time,
- )));
+ $phpbb_notifications->add_notifications(array('post_in_queue'), $notification_data);
break;
case 'edit_topic' :