PHP Recent Forums Don't Display Certain Forums

surf4ads

New Member
I have set up a way for the last 5 posts to display on the home page of my site. I would like to hide 3 specific forums (I looked up the id's and they are 24, 25, 35. Just in case that means anything). I can get them to hide, however, it will not show 5 posts. So I want to be able to show the 5 most recent skipping those 3 forums, while still displaying the next 5. This is also a phpBB forum in that means anything either.Below is my php code.
\[code\] $recent = mysql_query("SELECT * FROM forum_posts ORDER BY post_time DESC LIMIT 5"); while ($recent_row = mysql_fetch_assoc($recent)){ //Get Data $post_id = $recent_row['post_id']; $topic_id = $recent_row['topic_id']; $forum_id = $recent_row['forum_id']; $poster_id = $recent_row['poster_id']; $post_time = $recent_row['post_time']; if ($forum_id != 24 && $forum_id != 25 && $forum_id != 35){ //Get Topic Name $topic_name = mysql_query("SELECT topic_title FROM forum_topics WHERE topic_id='$topic_id'"); $topic_name = mysql_fetch_assoc($topic_name); $topic_name = $topic_name['topic_title']; //Get Username $username = mysql_query("SELECT username FROM forum_users WHERE user_id='$poster_id'"); $username = mysql_fetch_assoc($username); $username = $username['username']; echo "<a href = 'http://www.ravenwolfguild.net/forum/memberlist.php?mode=viewprofile&u=$poster_id' class = 'LinkStyle'>$username</a> posted in \"". "<a href = 'http://www.ravenwolfguild.net/forum/viewtopic.php?f=$forum_id&t=$topic_id&p=$post_id#p$post_id' class = 'LinkStyle'>$topic_name</a>\"<br>"; } }?>\[/code\]
 
Back
Top