aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index c00169af88..940484a0ea 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1681,6 +1681,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;
@@ -1724,6 +1725,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);