aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2018-06-17 15:35:37 +0200
committerMarc Alexander <admin@m-a-styles.de>2018-06-17 15:38:08 +0200
commitecf19b13c81c4db3aea7f5daa5e4e35994b3e689 (patch)
treecdf1317a0f4350402ba00f98bde2eec1efd1df87 /phpBB/includes/mcp
parentaea56fcf579f60c7215b68d0d745984a56596ac1 (diff)
parent04574c75a3236172061063692d6d8720263e71ce (diff)
downloadforums-ecf19b13c81c4db3aea7f5daa5e4e35994b3e689.tar
forums-ecf19b13c81c4db3aea7f5daa5e4e35994b3e689.tar.gz
forums-ecf19b13c81c4db3aea7f5daa5e4e35994b3e689.tar.bz2
forums-ecf19b13c81c4db3aea7f5daa5e4e35994b3e689.tar.xz
forums-ecf19b13c81c4db3aea7f5daa5e4e35994b3e689.zip
Merge pull request #5218 from senky/ticket/15657
[ticket/15657] Add MCP queue events
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/mcp_queue.php45
1 files changed, 43 insertions, 2 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 2e0a1cf9e6..4f1f9bb990 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -501,6 +501,29 @@ class mcp_queue
AND t.topic_id = p.topic_id
AND u.user_id = p.poster_id
ORDER BY ' . $sort_order_sql;
+
+ /**
+ * Alter sql query to get information on all posts in queue
+ *
+ * @event core.mcp_queue_get_posts_for_posts_query_before
+ * @var string sql String with the query to be executed
+ * @var array forum_list List of forums that contain the posts
+ * @var int visibility_const Integer with one of the possible ITEM_* constant values
+ * @var int topic_id topic_id in the page request
+ * @var string limit_time_sql String with the SQL code to limit the time interval of the post (Note: May be empty string)
+ * @var string sort_order_sql String with the ORDER BY SQL code used in this query
+ * @since 3.2.3-RC2
+ */
+ $vars = array(
+ 'sql',
+ 'forum_list',
+ 'visibility_const',
+ 'topic_id',
+ 'limit_time_sql',
+ 'sort_order_sql',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_queue_get_posts_for_posts_query_before', compact($vars)));
+
$result = $db->sql_query($sql);
$post_data = $rowset = array();
@@ -588,7 +611,7 @@ class mcp_queue
$row['post_username'] = $row['username'] ?: $user->lang['GUEST'];
}
- $template->assign_block_vars('postrow', array(
+ $post_row = array(
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),
@@ -606,7 +629,25 @@ class mcp_queue
'TOPIC_TITLE' => $row['topic_title'],
'POST_TIME' => $user->format_date($row['post_time']),
'S_HAS_ATTACHMENTS' => $auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment'],
- ));
+ );
+
+ /**
+ * Alter sql query to get information on all topics in the list of forums provided.
+ *
+ * @event core.mcp_queue_get_posts_modify_post_row
+ * @var array post_row Template variables for current post
+ * @var array row Post data
+ * @var array forum_names Forum names
+ * @since 3.2.3-RC2
+ */
+ $vars = array(
+ 'post_row',
+ 'row',
+ 'forum_names',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_queue_get_posts_modify_post_row', compact($vars)));
+
+ $template->assign_block_vars('postrow', $post_row);
}
unset($rowset, $forum_names);