posted 19 years ago
Changed
-------------------
TopicModel.selectAllByForumByLimit2 = t.topic_id \
FROM jforum_topics t, jforum_users u, jforum_posts p, jforum_posts p2, jforum_users u2 \
WHERE t.forum_id = ? \
AND t.user_id = u.user_id \
AND p.post_id = t.topic_first_post_id \
AND p2.post_id = t.topic_last_post_id \
AND u2.user_id = p2.user_id) \
ORDER BY t.topic_type DESC, t.topic_time ASC, t.topic_last_post_id ASC
-------------------
to
-------------------
TopicModel.selectAllByForumByLimit2 = t.topic_id \
FROM jforum_topics t, jforum_users u, jforum_posts p, jforum_posts p2, jforum_users u2 \
WHERE t.forum_id = ? \
AND t.user_id = u.user_id \
AND p.post_id = t.topic_first_post_id \
AND p2.post_id = t.topic_last_post_id \
AND u2.user_id = p2.user_id \
ORDER BY t.topic_type DESC, t.topic_time DESC, t.topic_last_post_id DESC \
) ORDER BY t.topic_type DESC, t.topic_last_post_id DESC, t.topic_time DESC \
-------------------
and now last created/replied message is topmost.
[originally posted on jforum.net by Anonymous]