1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Merge pull request #3363 from SimSync/fix_3337

fixes #3337 usage of old v1 table names
This commit is contained in:
Cameron 2018-08-13 11:27:27 -07:00 committed by GitHub
commit 2429f9058e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 3 deletions

View File

@ -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/',

View File

@ -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();