x
 
Create New Page
 View Previous Changes    ( Last updated by Lisa Wess )

Displaying the latest posts from a specific forum

Q: Is there a way to show the most recent topics from just one forum?

A: Use this query:

{exp:query sql="SELECT t.topic_id, t.author_id, t.last_post_author_id, t.title, t.topic_date, t.last_post_date, t.thread_total, t.thread_views, f.forum_status, f.forum_permissions, m.screen_name author, l.screen_name last_author FROM exp_forum_topics t, exp_forums f, exp_members m, exp_members l WHERE t.forum_id = 2 AND t.forum_id = f.forum_id AND t.author_id = m.member_id AND t.last_post_author_id = l.member_id ORDER BY t.topic_date desc LIMIT 5"}
{title}
- {author}
{
/exp:query}

Change t.forum_id = 2 to whatever forum id you want shown and tweak as needed.

Related forum discussion

Category:Forums Category:Queries

Categories: