[PHP] core.get_unread_topics_modify_sql

Request hook events and what data needs to be sent for the new hook system.
Post Reply
User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 13
Joined: Thu May 24, 2012 1:54 pm

[PHP] core.get_unread_topics_modify_sql

Post by kasimi » Tue Jan 20, 2015 9:15 pm

I've ported parts of asinshesq's MOD View or mark unread posts. The extension needs to modify the SQL query which fetches the unread topics data in the function get_unread_topics() in /includes/functions.php, right after the $sql_array variable is assembled (in 3.1.2 after line 1692).

Code: Select all

/**
 * 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.3
 */
$vars = array(
    'sql_array',
    'last_mark',
    'sql_extra',
    'sql_sort',
);
global $phpbb_dispatcher;
extract($phpbb_dispatcher->trigger_event('core.get_unread_topics_modify_sql', compact($vars)));

User avatar
Wolfsblvt
Registered User
Posts: 5
Joined: Tue Oct 28, 2014 8:35 am

Re: [PHP] core.get_unread_topics_modify_sql

Post by Wolfsblvt » Wed Jan 21, 2015 11:42 am

I have created a ticket and a pull request for that.
Lesser, greater, middling, it's all the same. Proportions are negotiated, boundaries blurred.
I'm not a pious hermit, I haven't done only good in my life. But if I'm to choose between one evil and another,
then I prefer not to choose at all.

― Andrzej Sapkowski, The Last Wish

Post Reply