Welcome to Geeklog Sunday, October 24 2021 @ 03:28 pm EDT

Geeklog Forums

phpbb recent posts block


Anonymous

Anonymous
There was an example of displaying 10 recent posts, but what everyone needs is 10 recent posts in all forums, not just the one you specify. $sql = "SELECT t.topic_title, t.topic_id, f.forum_id FROM forum_topics t, forum_forums f, forum_posts p WHERE t.topic_id = p.topic_id AND f.forum_id = t.forum_id ORDER BY post_id DESC LIMIT 10"; this does the thing, but shows only 1 most recent post. Any hints?
 Quote

Status: offline

Tony

Site Admin
Admin
Registered: 17/12/01
Posts: 405
Location:Urbandale, Iowa
You need a GROUP BY clause. Specifically you need to GROUP BY the ID fo the main thread. That will collapse all posts from the same thread an you should get 10 unique threads.---The reason people blame things on previous generations is that there's only one other choice.
The reason people blame things on previous generations is that there's only one other choice.
 Quote

Anonymous

Anonymous
Good idea I suppose. I just didn't want to dump stuff from my private forums for the world to see. Razz
 Quote

All times are EDT. The time is now 03:28 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content