aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorToxyy <arr70017@uga.edu>2018-07-09 16:54:11 -0400
committerToxyy <arr70017@uga.edu>2018-07-09 16:54:11 -0400
commit5fbd4584be49e416642ca1593084bca15fc60d30 (patch)
tree53305587a80d7d09114c040e358b8c8a5f895107 /phpBB/viewtopic.php
parent911c46cc61cd64913283509602a2db9e7c86b914 (diff)
downloadforums-5fbd4584be49e416642ca1593084bca15fc60d30.tar
forums-5fbd4584be49e416642ca1593084bca15fc60d30.tar.gz
forums-5fbd4584be49e416642ca1593084bca15fc60d30.tar.bz2
forums-5fbd4584be49e416642ca1593084bca15fc60d30.tar.xz
forums-5fbd4584be49e416642ca1593084bca15fc60d30.zip
[ticket/15719] Add core events to viewtopic to edit the post_list sql query
Event added in viewtopic.php so you can modify post_list sql The query, sql limit, sql start, sort keys and days are editable PHPBB3-15719
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 3c25c3b037..20316afb32 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1148,6 +1148,29 @@ $sql = 'SELECT p.post_id
" . (($join_user_sql[$sort_key]) ? 'AND u.user_id = p.poster_id': '') . "
$limit_posts_time
ORDER BY $sql_sort_order";
+
+/**
+* Event to modify the SQL query that gets post_list
+*
+* @event core.viewtopic_modify_post_list_sql
+* @var string sql The SQL query to generate the post_list
+* @var int sql_limit The number of posts the query fetches
+* @var int sql_start The index the query starts to fetch from
+* @var string sort_key Key the posts are sorted by
+* @var string sort_days Display posts of previous x days
+* @var int forum_id Forum ID
+* @since 3.2.4-RC1
+*/
+$vars = array(
+ 'sql',
+ 'sql_limit',
+ 'sql_start',
+ 'sort_key',
+ 'sort_days',
+ 'forum_id',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_list_sql', compact($vars)));
+
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
$i = ($store_reverse) ? $sql_limit - 1 : 0;