From dbb476d813ee45440e9ebddf7e3827a109186d4d Mon Sep 17 00:00:00 2001 From: 3D-I Date: Mon, 29 Oct 2018 01:02:02 +0100 Subject: [PATCH 1/3] [ticket/15859] Add core.viewforum_modify_topic_ordering PHPBB3-15859 --- phpBB/viewforum.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 416ffe3d90..5c68a39217 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -285,6 +285,20 @@ $limit_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']); $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_last_post_time', 't.topic_last_post_id'), 'r' => (($auth->acl_get('m_approve', $forum_id)) ? 't.topic_posts_approved + t.topic_posts_unapproved + t.topic_posts_softdeleted' : 't.topic_posts_approved'), 's' => 'LOWER(t.topic_title)', 'v' => 't.topic_views'); +/** + * Modify the topic ordering if needed + * + * @event core.viewforum_modify_topic_ordering + * @var array sort_by_text Topic ordering options + * @var array sort_by_sql Topic ordering options + * @since 3.2.4 + */ +$vars = array( + 'sort_by_text', + 'sort_by_sql', +); +extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_topic_ordering', compact($vars))); + $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param, $default_sort_days, $default_sort_key, $default_sort_dir); From b8f85325d86ca4478945fdd77da4e15b52d71a12 Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sun, 11 Nov 2018 21:49:34 +0100 Subject: [PATCH 2/3] [ticket/15859] Add core.viewforum_modify_topic_ordering PHPBB3-15859 --- phpBB/viewforum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 5c68a39217..8fc5217054 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -291,7 +291,7 @@ $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_l * @event core.viewforum_modify_topic_ordering * @var array sort_by_text Topic ordering options * @var array sort_by_sql Topic ordering options - * @since 3.2.4 + * @since 3.2.5-RC1 */ $vars = array( 'sort_by_text', From bf42eae114911548c0aef7123940d1f201cc7ddc Mon Sep 17 00:00:00 2001 From: 3D-I Date: Sun, 18 Nov 2018 19:51:29 +0100 Subject: [PATCH 3/3] [ticket/15859] Add core.viewforum_modify_topic_ordering PHPBB3-15859 --- phpBB/viewforum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 8fc5217054..6db4da2190 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -290,7 +290,7 @@ $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => array('t.topic_l * * @event core.viewforum_modify_topic_ordering * @var array sort_by_text Topic ordering options - * @var array sort_by_sql Topic ordering options + * @var array sort_by_sql Topic orderings options SQL equivalent * @since 3.2.5-RC1 */ $vars = array(