aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/mcp_forum.php1
-rw-r--r--phpBB/includes/mcp/mcp_logs.php1
-rw-r--r--phpBB/includes/mcp/mcp_main.php11
-rw-r--r--phpBB/includes/mcp/mcp_notes.php1
-rw-r--r--phpBB/includes/mcp/mcp_pm_reports.php1
-rw-r--r--phpBB/includes/mcp/mcp_queue.php39
-rw-r--r--phpBB/includes/mcp/mcp_reports.php11
-rw-r--r--phpBB/includes/mcp/mcp_topic.php1
-rw-r--r--phpBB/includes/mcp/mcp_warn.php1
9 files changed, 48 insertions, 19 deletions
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index a3b2184d48..7c1c61dae7 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -135,7 +135,6 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'S_MCP_ACTION' => $url . "&i=$id&forum_action=$action&mode=$mode&start=$start" . (($merge_select) ? $selected_ids : ''),
- 'PAGE_NUMBER' => $pagination->on_page($base_url, $forum_topics, $topics_per_page, $start),
'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $forum_topics),
));
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index ac7896606a..7bcb0fc477 100644
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -177,7 +177,6 @@ class mcp_logs
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $log_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
- 'PAGE_NUMBER' => $pagination->on_page($base_url, $log_count, $config['topics_per_page'], $start),
'TOTAL' => $user->lang('TOTAL_LOGS', (int) $log_count),
'L_TITLE' => $user->lang['MCP_LOGS'],
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index d9197da07e..016094c5d4 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -34,6 +34,7 @@ class mcp_main
{
global $auth, $db, $user, $template, $action;
global $config, $phpbb_root_path, $phpEx, $request;
+ global $phpbb_dispatcher;
$quickmod = ($mode == 'quickmod') ? true : false;
@@ -151,6 +152,16 @@ class mcp_main
mcp_restore_topic($topic_ids);
break;
+
+ default:
+ /**
+ * This event allows you to handle custom quickmod options
+ *
+ * @event core.modify_quickmod_actions
+ * @since 3.1.0-a4
+ */
+ $phpbb_dispatcher->dispatch('core.modify_quickmod_actions');
+ break;
}
switch ($mode)
diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php
index 055ca0e882..28de8724be 100644
--- a/phpBB/includes/mcp/mcp_notes.php
+++ b/phpBB/includes/mcp/mcp_notes.php
@@ -229,7 +229,6 @@ class mcp_notes
'L_TITLE' => $user->lang['MCP_NOTES_USER'],
- 'PAGE_NUMBER' => $pagination->on_page($base_url, $log_count, $config['topics_per_page'], $start),
'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $log_count),
'RANK_TITLE' => $rank_title,
diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php
index d0801a2b47..008984b1c3 100644
--- a/phpBB/includes/mcp/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/mcp_pm_reports.php
@@ -309,7 +309,6 @@ class mcp_pm_reports
'S_MCP_ACTION' => $this->u_action,
'S_CLOSED' => ($mode == 'pm_reports_closed') ? true : false,
- 'PAGE_NUMBER' => $pagination->on_page($base_url, $total, $config['topics_per_page'], $start),
'TOTAL' => $total,
'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total),
)
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 3b6897f4e1..a46c4bd499 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -547,7 +547,6 @@ class mcp_queue
'S_TOPICS' => $is_topics,
'S_RESTORE' => $is_restore,
- 'PAGE_NUMBER' => $pagination->on_page($base_url, $total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $user->lang(((!$is_topics) ? 'VIEW_TOPIC_POSTS' : 'VIEW_FORUM_TOPICS'), (int) $total),
));
@@ -654,6 +653,11 @@ class mcp_queue
// Handle notifications
foreach ($post_info as $post_id => $post_data)
{
+ // A single topic approval may also happen here, so handle deleting the respective notification.
+ if (!$post_data['topic_posts_approved'])
+ {
+ $phpbb_notifications->delete_notifications('topic_in_queue', $post_data['topic_id']);
+ }
$phpbb_notifications->delete_notifications('post_in_queue', $post_id);
$phpbb_notifications->add_notifications(array(
@@ -773,9 +777,12 @@ class mcp_queue
$notify_poster = ($action == 'approve' && isset($_REQUEST['notify_poster'])) ? true : false;
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
+ $first_post_ids = array();
+
foreach ($topic_info as $topic_id => $topic_data)
{
$phpbb_content_visibility->set_topic_visibility(ITEM_APPROVED, $topic_id, $topic_data['forum_id'], $user->data['user_id'], time(), '');
+ $first_post_ids[$topic_id] = (int) $topic_data['topic_first_post_id'];
$topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$topic_data['forum_id']}&t={$topic_id}");
@@ -799,23 +806,43 @@ class mcp_queue
// Only send out the mails, when the posts are being approved
if ($action == 'approve')
{
+ // Grab the first post text as it's needed for the quote notification.
+ $sql = 'SELECT topic_id, post_text
+ FROM ' . POSTS_TABLE . '
+ WHERE ' . $db->sql_in_set('post_id', $first_post_ids);
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $topic_info[$row['topic_id']]['post_text'] = $row['post_text'];
+ }
+ $db->sql_freeresult($result);
+
// Handle notifications
$phpbb_notifications = $phpbb_container->get('notification_manager');
foreach ($topic_info as $topic_id => $topic_data)
{
- $phpbb_notifications->delete_notifications('topic_in_queue', $post_data['topic_id']);
+ $topic_data = array_merge($topic_data, array(
+ 'post_id' => $topic_data['topic_first_post_id'],
+ 'post_subject' => $topic_data['topic_title'],
+ 'post_time' => $topic_data['topic_time'],
+ 'poster_id' => $topic_data['topic_poster'],
+ 'username' => $topic_data['topic_first_poster_name'],
+ ));
+
+ $phpbb_notifications->delete_notifications('topic_in_queue', $topic_id);
$phpbb_notifications->add_notifications(array(
'quote',
'topic',
- ), $post_data);
+ ), $topic_data);
- $phpbb_notifications->mark_notifications_read('quote', $post_data['post_id'], $user->data['user_id']);
- $phpbb_notifications->mark_notifications_read('topic', $post_data['topic_id'], $user->data['user_id']);
+ $phpbb_notifications->mark_notifications_read('quote', $topic_data['post_id'], $user->data['user_id']);
+ $phpbb_notifications->mark_notifications_read('topic', $topic_id, $user->data['user_id']);
if ($notify_poster)
{
- $phpbb_notifications->add_notifications('approve_topic', $post_data);
+ $phpbb_notifications->add_notifications('approve_topic', $topic_data);
}
}
}
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 02892964f1..8026e071cd 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -423,7 +423,6 @@ class mcp_reports
'S_FORUM_OPTIONS' => $forum_options,
'S_CLOSED' => ($mode == 'reports_closed') ? true : false,
- 'PAGE_NUMBER' => $pagination->on_page($base_url, $total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $total,
'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total),
@@ -616,23 +615,25 @@ function close_report($report_id_list, $mode, $action, $pm = false)
}
unset($close_report_posts, $close_report_topics);
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+
foreach ($reports as $report)
{
if ($pm)
{
add_log('mod', 0, 0, 'LOG_PM_REPORT_' . strtoupper($action) . 'D', $post_info[$report['pm_id']]['message_subject']);
+ $phpbb_notifications->delete_notifications('report_pm', $report['pm_id']);
}
else
{
add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' . strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']);
+ $phpbb_notifications->delete_notifications('report_post', $report['post_id']);
}
}
// Notify reporters
if (sizeof($notify_reporters))
{
- $phpbb_notifications = $phpbb_container->get('notification_manager');
-
foreach ($notify_reporters as $report_id => $reporter)
{
if ($reporter['user_id'] == ANONYMOUS)
@@ -649,8 +650,6 @@ function close_report($report_id_list, $mode, $action, $pm = false)
'closer_id' => $user->data['user_id'],
'from_user_id' => $post_info[$post_id]['author_id'],
)));
-
- $phpbb_notifications->delete_notifications('report_pm', $post_id);
}
else
{
@@ -658,8 +657,6 @@ function close_report($report_id_list, $mode, $action, $pm = false)
'reporter' => $reporter['user_id'],
'closer_id' => $user->data['user_id'],
)));
-
- $phpbb_notifications->delete_notifications('report_post', $post_id);
}
}
}
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index a4c561a3bf..cdb88bf2bf 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -343,7 +343,6 @@ function mcp_topic_view($id, $mode, $action)
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$topic_info['forum_id']}&amp;t={$topic_info['topic_id']}&amp;start=$start") . '">', '</a>'),
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$topic_info['forum_id']}&amp;start=$start") . '">', '</a>'),
- 'PAGE_NUMBER' => $pagination->on_page($base_url, $total, $posts_per_page, $start),
'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total),
));
}
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index e39bddec5b..d396d004dc 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -186,7 +186,6 @@ class mcp_warn
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days,
- 'PAGE_NUMBER' => $pagination->on_page($base_url, $user_count, $config['topics_per_page'], $start),
'TOTAL_USERS' => $user->lang('LIST_USERS', (int) $user_count),
));
}