Here we go, sorry about the delay :
SELECT t.id, t.subject, p.message, p.poster_id, p.poster, p.posted
FROM punbb_topics AS t, punbb_posts AS p
WHERE t.forum_id = 1
AND t.id = p.topic_id
AND t.posted = p.posted
ORDER BY t.posted DESC
LIMIT 5
- Replace the 1 in t.forum_id = 1 by the ID of the forum you are using for publishing the news displayed on the front page.
- LIMIT 5 is limiting the number of news to get to 5, increase, decrease or remove it as you like.
You then get a nice result set with:
- id: the ID of the post so you can link to it (for comments)
- subject: the title of the post
- message: the content of the post
- poster_id: the ID of the author of the post, so you can link to his profile
- poster: the name of the author
- posted: the date of the post, use date() to format it.
I still miss the number of comments, shouldn't be hard to get, I'll update this post when I'll find some time to work on it
For the memberlist, it's even easier:
SELECT u.id, u.username, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.use_avatar
FROM punbb_users as u
WHERE u.group_id=1
OR u.group_id=2
OR u.group_id=5
ORDER BY u.username ASC
The group_id WHERE clauses are the groups you want the users from. The result set is self_explanatory.
Check the PunBB Developer Information for information about the tables, it's easy as 1.2.3