1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-02 23:12:46 +02:00

[ticket/15579] Add ucp_front events

PHPBB3-15579
This commit is contained in:
Jakub Senko 2018-03-06 18:28:14 +01:00
parent dc8ff9da28
commit 1a284ebe8d
No known key found for this signature in database
GPG Key ID: 6A7C328CD66EC21E

View File

@ -77,6 +77,22 @@ class ucp_main
// If the user can't see any forums, he can't read any posts because fid of 0 is invalid
if (!empty($forum_ary))
{
/**
* Modify sql variables before query is processed
*
* @event core.ucp_main_front_modify_sql
* @var string sql_select SQL select
* @var string sql_from SQL from
* @var array forum_ary Forum array
* @since 3.2.4-RC1
*/
$vars = array(
'sql_select',
'sql_from',
'forum_ary',
);
extract($phpbb_dispatcher->trigger_event('core.ucp_main_front_modify_sql', compact($vars)));
$sql = "SELECT t.* $sql_select
FROM $sql_from
WHERE t.topic_type = " . POST_GLOBAL . '
@ -144,7 +160,7 @@ class ucp_main
$folder_img .= '_mine';
}
$template->assign_block_vars('topicrow', array(
$topicrow = array(
'FORUM_ID' => $forum_id,
'TOPIC_ID' => $topic_id,
'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
@ -171,8 +187,30 @@ class ucp_main
'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread',
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"))
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"),
);
/**
* Add template variables to a front topics row.
*
* @event core.ucp_main_front_modify_template_vars
* @var array topicrow Array containing the template variables for the row
* @var array row Array containing the subscribed forum row data
* @var int forum_id Forum ID
* @var string folder_img Folder image
* @var string folder_alt Alt text for the folder image
* @since 3.2.4-RC1
*/
$vars = array(
'topicrow',
'row',
'forum_id',
'folder_img',
'folder_alt',
);
extract($phpbb_dispatcher->trigger_event('core.ucp_main_front_modify_template_vars', compact($vars)));
$template->assign_block_vars('topicrow', $topicrow);
}
if ($config['load_user_activity'])