diff options
author | Marc Alexander <admin@m-a-styles.de> | 2019-08-11 17:36:24 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2019-08-11 17:36:24 +0200 |
commit | 08ee5a608b93f1605f293d034bafd43a4035cb2d (patch) | |
tree | 0500139e7641f7ded5ebffd0595efc4cee363b7c | |
parent | 0cbf06780e501f9e7ad0e26f363945edce30b392 (diff) | |
parent | 48522fd93882cb67fd3f55091273bae186d5094c (diff) | |
download | forums-08ee5a608b93f1605f293d034bafd43a4035cb2d.tar forums-08ee5a608b93f1605f293d034bafd43a4035cb2d.tar.gz forums-08ee5a608b93f1605f293d034bafd43a4035cb2d.tar.bz2 forums-08ee5a608b93f1605f293d034bafd43a4035cb2d.tar.xz forums-08ee5a608b93f1605f293d034bafd43a4035cb2d.zip |
Merge branch '3.2.x' into 3.3.x
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 68a65aafdd..83ad56f3e4 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -142,14 +142,36 @@ function mcp_topic_view($id, $mode, $action) } $start = $pagination->validate_start($start, $posts_per_page, $total); - $sql = 'SELECT u.username, u.username_clean, u.user_colour, p.* - FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u - WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . ' + $sql_where = (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . ' p.topic_id = ' . $topic_id . ' AND ' . $phpbb_content_visibility->get_visibility_sql('post', $topic_info['forum_id'], 'p.') . ' AND p.poster_id = u.user_id ' . - $limit_time_sql . ' - ORDER BY ' . $sort_order_sql; + $limit_time_sql; + + $sql_ary = array( + 'SELECT' => 'u.username, u.username_clean, u.user_colour, p.*', + 'FROM' => array( + POSTS_TABLE => 'p', + USERS_TABLE => 'u' + ), + 'LEFT_JOIN' => array(), + 'WHERE' => $sql_where, + 'ORDER_BY' => $sort_order_sql, + ); + + /** + * Event to modify the SQL query before the MCP topic review posts is queried + * + * @event core.mcp_topic_modify_sql_ary + * @var array sql_ary The SQL array to get the data of the MCP topic review posts + * @since 3.2.8-RC1 + */ + $vars = array('sql_ary'); + extract($phpbb_dispatcher->trigger_event('core.mcp_topic_modify_sql_ary', compact($vars))); + + $sql = $db->sql_build_query('SELECT', $sql_ary); + unset($sql_ary); + $result = $db->sql_query_limit($sql, $posts_per_page, $start); $rowset = $post_id_list = array(); |