From a3dae1ecfdee099183dfdbaafccc280b1e4fd001 Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Wed, 8 Aug 2018 20:27:04 +0200 Subject: [PATCH 1/2] fixes #3337 usage of old v1 table names new route /forum/?new to display new posts --- e107_plugins/forum/e_url.php | 6 ++++++ e107_plugins/forum/forum_class.php | 18 +++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/e107_plugins/forum/e_url.php b/e107_plugins/forum/e_url.php index 9aaeb8ed7..7a1a1583c 100644 --- a/e107_plugins/forum/e_url.php +++ b/e107_plugins/forum/e_url.php @@ -50,6 +50,12 @@ class forum_url // plugin-folder + '_url' 'legacy' => '{e_PLUGIN}forum/forum.php?f=mfar&id={forum_id}' ); + $config['new'] = array( + 'regex' => '^forum/\?new?', + 'sef' => 'forum/?new', + 'redirect' => '{e_PLUGIN}forum/forum.php?new' + ); + $config['post'] = array( 'regex' => '^forum/post/?', 'sef' => 'forum/post/', diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php index 1ee6c4606..b8e1aad75 100644 --- a/e107_plugins/forum/forum_class.php +++ b/e107_plugins/forum/forum_class.php @@ -1376,7 +1376,9 @@ class e107forum $lp_user = 'NULL'; if($updateThreads == true) { - if ($sql2->select('forum_t', 'thread_id', "thread_forum_id = $id AND thread_parent = 0")) // forum_t used in forum_update + //if ($sql2->select('forum_t', 'thread_id', "thread_forum_id = $id AND thread_parent = 0")) // forum_t used in forum_update + // issue #3337 fixed usage of old v1 table names + if ($sql2->select('forum_thread', 'thread_id', "thread_forum_id = $id")) { while ($row = $sql2->fetch()) { @@ -2026,10 +2028,11 @@ class e107forum $viewed = implode(',', $this->threadGetUserViewed($uid)); if($viewed != '') { - $viewed = ' AND p.post_forum NOT IN ('.$viewed.')'; + //$viewed = ' AND p.post_forum NOT IN ('.$viewed.')'; + $viewed = " AND t.thread_forum_id NOT IN ({$viewed})"; } } - + /* $qry = " SELECT ft.*, fp.thread_name as post_subject, fp.thread_total_replies as replies, u.user_id, u.user_name, f.forum_class FROM #forum_t AS ft @@ -2047,8 +2050,17 @@ class e107forum WHERE t.thread_lastpost > ".USERLV. " {$viewed} ORDER BY t.thread_lastpost DESC LIMIT 0, ".(int)$count; + */ + // issue #3337 fixed usage of old v1 table names + $qry = "SELECT t.*, u.user_name + FROM `#forum_thread` AS t + LEFT JOIN `#user` AS u ON u.user_id = t.thread_lastuser + WHERE t.thread_lastpost > ".USERLV. " + {$viewed} + ORDER BY t.thread_lastpost DESC LIMIT 0, ".(int)$count; + $ret = array(); if($sql->gen($qry)) { $ret = $sql->db_getList(); From 7ff118921d6012473f36cd66ba7a31feb0a76559 Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Fri, 10 Aug 2018 18:11:41 +0200 Subject: [PATCH 2/2] fixes #3227 changed route to a "clean" sef route --- e107_plugins/forum/e_url.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e107_plugins/forum/e_url.php b/e107_plugins/forum/e_url.php index 7a1a1583c..99449fd76 100644 --- a/e107_plugins/forum/e_url.php +++ b/e107_plugins/forum/e_url.php @@ -51,8 +51,8 @@ class forum_url // plugin-folder + '_url' ); $config['new'] = array( - 'regex' => '^forum/\?new?', - 'sef' => 'forum/?new', + 'regex' => '^forum/new?', + 'sef' => 'forum/new', 'redirect' => '{e_PLUGIN}forum/forum.php?new' );