From b934617a3b6ae7a47085ce84975ff0650bddb07f Mon Sep 17 00:00:00 2001 From: brunoais Date: Mon, 16 Feb 2015 11:31:05 +0000 Subject: [PATCH 1/2] [ticket/13625] Adding multiple variables to core.viewforum_get_topic_data Added topics_count, sort_days, sort_key and sort_dir to core.viewforum_get_topic_data and adjusted the event's comment explaining it's possible extended purpose now that it has more variables. PHPBB3-13625 --- phpBB/viewforum.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 92ac9171cb..5e42ec8c76 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -391,15 +391,27 @@ $sql_array = array( /** * Event to modify the SQL query before the topic data is retrieved * +* It may also be used to override the above assigned template vars +* * @event core.viewforum_get_topic_data * @var array forum_data Array with forum data * @var array sql_array The SQL array to get the data of all topics +* @var array topics_count The total number of topics for display +* @var array sort_days The oldest topic displayable in elapsed days +* @var array sort_key The sorting by. It is one of the first character of (in low case): +* Author, Post time, Replies, Subject, Views +* @var array sort_dir Either "a" for ascending or "d" for descending * @since 3.1.0-a1 * @change 3.1.0-RC4 Added forum_data var +* @change 3.1.4-RC1 Added topics_count, sort_days, sort_key and sort_dir vars */ $vars = array( 'forum_data', 'sql_array', + 'topics_count', + 'sort_days', + 'sort_key', + 'sort_dir', ); extract($phpbb_dispatcher->trigger_event('core.viewforum_get_topic_data', compact($vars))); From 52b83bd5e92cd26461f721942028a39d5983ba7d Mon Sep 17 00:00:00 2001 From: brunoais Date: Mon, 16 Feb 2015 11:33:39 +0000 Subject: [PATCH 2/2] [ticket/13625] Added forum_id to allow more flexibility and possibilities. PHPBB3-13625 --- phpBB/viewforum.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 5e42ec8c76..cd55114bad 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -396,6 +396,7 @@ $sql_array = array( * @event core.viewforum_get_topic_data * @var array forum_data Array with forum data * @var array sql_array The SQL array to get the data of all topics +* @var array forum_id The forum_id whose topics are being listed * @var array topics_count The total number of topics for display * @var array sort_days The oldest topic displayable in elapsed days * @var array sort_key The sorting by. It is one of the first character of (in low case): @@ -403,11 +404,12 @@ $sql_array = array( * @var array sort_dir Either "a" for ascending or "d" for descending * @since 3.1.0-a1 * @change 3.1.0-RC4 Added forum_data var -* @change 3.1.4-RC1 Added topics_count, sort_days, sort_key and sort_dir vars +* @change 3.1.4-RC1 Added forum_id, topics_count, sort_days, sort_key and sort_dir vars */ $vars = array( 'forum_data', 'sql_array', + 'forum_id', 'topics_count', 'sort_days', 'sort_key',