Latest Post Staff Forums

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dwfait
Forum Contributor
Posts: 113
Joined: Sun Aug 01, 2004 10:36 pm

Latest Post Staff Forums

Post by dwfait »

We have an invision boar don our site, and from our main site were calling this query to get the latest posts:

Code: Select all

SELECT last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics ORDER BY last_post DESC LIMIT 0,3
However, is there a way to choose to not include them if they have a forum_id value of 5 or 15? as these are staff forums.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

simply add this

Code: Select all

WHERE forum_id != 5 AND forum_id != 15
before ORDER BY clause ;)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'd suggest using an authorization check against the user instead. So staff see the forum posts they have access to, and regular users see only the posts they have access to.
Post Reply