mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
fixes #3337 usage of old v1 table names
new route /forum/?new to display new posts
This commit is contained in:
@@ -50,6 +50,12 @@ class forum_url // plugin-folder + '_url'
|
|||||||
'legacy' => '{e_PLUGIN}forum/forum.php?f=mfar&id={forum_id}'
|
'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(
|
$config['post'] = array(
|
||||||
'regex' => '^forum/post/?',
|
'regex' => '^forum/post/?',
|
||||||
'sef' => 'forum/post/',
|
'sef' => 'forum/post/',
|
||||||
|
@@ -1376,7 +1376,9 @@ class e107forum
|
|||||||
$lp_user = 'NULL';
|
$lp_user = 'NULL';
|
||||||
if($updateThreads == true)
|
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())
|
while ($row = $sql2->fetch())
|
||||||
{
|
{
|
||||||
@@ -2026,10 +2028,11 @@ class e107forum
|
|||||||
$viewed = implode(',', $this->threadGetUserViewed($uid));
|
$viewed = implode(',', $this->threadGetUserViewed($uid));
|
||||||
if($viewed != '')
|
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 = "
|
$qry = "
|
||||||
SELECT ft.*, fp.thread_name as post_subject, fp.thread_total_replies as replies, u.user_id, u.user_name, f.forum_class
|
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
|
FROM #forum_t AS ft
|
||||||
@@ -2047,8 +2050,17 @@ class e107forum
|
|||||||
WHERE t.thread_lastpost > ".USERLV. "
|
WHERE t.thread_lastpost > ".USERLV. "
|
||||||
{$viewed}
|
{$viewed}
|
||||||
ORDER BY t.thread_lastpost DESC LIMIT 0, ".(int)$count;
|
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))
|
if($sql->gen($qry))
|
||||||
{
|
{
|
||||||
$ret = $sql->db_getList();
|
$ret = $sql->db_getList();
|
||||||
|
Reference in New Issue
Block a user