aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_queue.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2012-09-15 12:00:03 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2012-09-15 12:00:03 -0500
commit9c54465a1331216be1e3369346921dee9148e590 (patch)
tree2a24a84fa24c83f12f43717c494c3d86a0196412 /phpBB/includes/mcp/mcp_queue.php
parenta1e2fb93add6cf6ff0c83879b347d1780411a335 (diff)
downloadforums-9c54465a1331216be1e3369346921dee9148e590.tar
forums-9c54465a1331216be1e3369346921dee9148e590.tar.gz
forums-9c54465a1331216be1e3369346921dee9148e590.tar.bz2
forums-9c54465a1331216be1e3369346921dee9148e590.tar.xz
forums-9c54465a1331216be1e3369346921dee9148e590.zip
[ticket/11103] Starting approve_post type notification
PHPBB3-11103
Diffstat (limited to 'phpBB/includes/mcp/mcp_queue.php')
-rw-r--r--phpBB/includes/mcp/mcp_queue.php33
1 files changed, 8 insertions, 25 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 1373829ecf..df99e34576 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -597,45 +597,28 @@ function approve_post($post_id_list, $id, $mode)
sync('forum', 'forum_id', array_keys($forum_id_list), true, true);
unset($topic_id_list, $forum_id_list);
- $messenger = new messenger();
+ $phpbb_notifications = $phpbb_container->get('notifications');
// Notify Poster?
if ($notify_poster)
{
+ // Forum Notifications
foreach ($post_info as $post_id => $post_data)
{
- if ($post_data['poster_id'] == ANONYMOUS)
+ if ($post_data['post_id'] == $post_data['topic_first_post_id'] && $post_data['post_id'] == $post_data['topic_last_post_id'])
{
- continue;
+ $phpbb_notifications->add_notifications('approve_topic', $post_data);
+ }
+ else
+ {
+ $phpbb_notifications->add_notifications('approve_post', $post_data);
}
-
- $email_template = ($post_data['post_id'] == $post_data['topic_first_post_id'] && $post_data['post_id'] == $post_data['topic_last_post_id']) ? 'topic_approved' : 'post_approved';
-
- $messenger->template($email_template, $post_data['user_lang']);
-
- $messenger->to($post_data['user_email'], $post_data['username']);
- $messenger->im($post_data['user_jabber'], $post_data['username']);
-
- $messenger->assign_vars(array(
- 'USERNAME' => htmlspecialchars_decode($post_data['username']),
- 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])),
- 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title'])),
-
- 'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f={$post_data['forum_id']}&t={$post_data['topic_id']}&e=0",
- 'U_VIEW_POST' => generate_board_url() . "/viewtopic.$phpEx?f={$post_data['forum_id']}&t={$post_data['topic_id']}&p=$post_id&e=$post_id")
- );
-
- $messenger->send($post_data['user_notify_type']);
}
}
- $messenger->save_queue();
-
// Send out normal user notifications
$email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
- $phpbb_notifications = $phpbb_container->get('notifications');
-
foreach ($post_info as $post_id => $post_data)
{
if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id'])