diff options
author | Wolfsblvt <clemenshusung@gmx.de> | 2015-01-21 12:38:15 +0100 |
---|---|---|
committer | Wolfsblvt <clemenshusung@gmx.de> | 2015-01-23 12:48:57 +0100 |
commit | 1dce9576e99d114c482ea79f5c17fb0380e13eba (patch) | |
tree | e62512d6c1ffa60d3cc18ac2bd5f79cd3a63b5b9 /phpBB/includes | |
parent | 61df1ac2b394d8bc9c28a2f8e16672cb9221b63e (diff) | |
download | forums-1dce9576e99d114c482ea79f5c17fb0380e13eba.tar forums-1dce9576e99d114c482ea79f5c17fb0380e13eba.tar.gz forums-1dce9576e99d114c482ea79f5c17fb0380e13eba.tar.bz2 forums-1dce9576e99d114c482ea79f5c17fb0380e13eba.tar.xz forums-1dce9576e99d114c482ea79f5c17fb0380e13eba.zip |
[ticket/13532] Add core event to get_unread_topics() in functions.php
Adding core event core.get_unread_topics_modify_sql to to funtion
get_unread_topics() in functions.php, so that you now are able to modify
the sql query that retrieves the unread topics.
PHPBB3-13532
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 1a3560dbb1..5408f7e281 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1648,6 +1648,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001, $sql_limit_offset = 0) { global $config, $db, $user; + global $phpbb_dispatcher; $user_id = ($user_id === false) ? (int) $user->data['user_id'] : (int) $user_id; @@ -1691,6 +1692,24 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s $sql_sort", ); + /** + * Change SQL query for fetching unread topics data + * + * @event core.get_unread_topics_modify_sql + * @var array sql_array Fully assembled SQL query with keys SELECT, FROM, LEFT_JOIN, WHERE + * @var int last_mark User's last_mark time + * @var string sql_extra Extra WHERE SQL statement + * @var string sql_sort ORDER BY SQL sorting statement + * @since 3.1.4-RC1 + */ + $vars = array( + 'sql_array', + 'last_mark', + 'sql_extra', + 'sql_sort', + ); + extract($phpbb_dispatcher->trigger_event('core.get_unread_topics_modify_sql', compact($vars))); + $sql = $db->sql_build_query('SELECT', $sql_array); $result = $db->sql_query_limit($sql, $sql_limit, $sql_limit_offset); |