|
@@ -39,20 +39,20 @@ class ActionT extends Method
|
|
|
case 'latest_active_topics':
|
|
|
$sql = 'SELECT t.id
|
|
|
FROM ::topics AS t
|
|
|
- WHERE t.forum_id IN (?ai:forums) AND t.moved_to IS NULL
|
|
|
+ WHERE t.forum_id IN (?ai:forums) AND t.moved_to=0
|
|
|
ORDER BY t.last_post DESC';
|
|
|
break;
|
|
|
case 'unanswered_topics':
|
|
|
$sql = 'SELECT t.id
|
|
|
FROM ::topics AS t
|
|
|
- WHERE t.forum_id IN (?ai:forums) AND t.moved_to IS NULL AND t.num_replies=0
|
|
|
+ WHERE t.forum_id IN (?ai:forums) AND t.moved_to=0 AND t.num_replies=0
|
|
|
ORDER BY t.last_post DESC';
|
|
|
break;
|
|
|
case 'topics_with_your_posts':
|
|
|
$sql = 'SELECT t.id
|
|
|
FROM ::topics AS t
|
|
|
INNER JOIN ::posts AS p ON t.id=p.topic_id
|
|
|
- WHERE t.forum_id IN (?ai:forums) AND t.moved_to IS NULL AND p.poster_id=?i:uid
|
|
|
+ WHERE t.forum_id IN (?ai:forums) AND t.moved_to=0 AND p.poster_id=?i:uid
|
|
|
GROUP BY t.id
|
|
|
ORDER BY t.last_post DESC';
|
|
|
break;
|
|
@@ -60,7 +60,7 @@ class ActionT extends Method
|
|
|
$sql = 'SELECT t.id
|
|
|
FROM ::topics AS t
|
|
|
INNER JOIN ::posts AS p ON t.first_post_id=p.id
|
|
|
- WHERE t.forum_id IN (?ai:forums) AND t.moved_to IS NULL AND p.poster_id=?i:uid
|
|
|
+ WHERE t.forum_id IN (?ai:forums) AND t.moved_to=0 AND p.poster_id=?i:uid
|
|
|
ORDER BY t.last_post DESC';
|
|
|
break;
|
|
|
case 'new':
|
|
@@ -70,7 +70,7 @@ class ActionT extends Method
|
|
|
LEFT JOIN ::mark_of_forum AS mof ON (mof.uid=?i:uid AND mof.fid=t.forum_id)
|
|
|
WHERE t.forum_id IN (?ai:forums)
|
|
|
AND t.last_post>?i:max
|
|
|
- AND t.moved_to IS NULL
|
|
|
+ AND t.moved_to=0
|
|
|
AND (mot.mt_last_visit IS NULL OR t.last_post>mot.mt_last_visit)
|
|
|
AND (mof.mf_mark_all_read IS NULL OR t.last_post>mof.mf_mark_all_read)
|
|
|
ORDER BY t.last_post DESC';
|