Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 08:20 pm EST
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?
9
5
Quote
Status: offline
Tony
Site Admin
Admin
Registered: 12/17/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.
The reason people blame things on previous generations is that there's only one other choice.
8
7
Quote
Anonymous
Anonymous
Good idea I suppose. I just didn't want to dump stuff from my private forums for the world to see.
7
7
Quote
All times are EST. The time is now 08:20 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