2007-04-10, 12:25 AM
Hello, Im am using this code to show the latest 5 threads on a page:
Is there a way I can make it not show the posts in a certain forum, like the staff forum?
<?php
//Connect to mybb db
mysql_connect("localhost", "", "") or die("Could not connect to MySQL");
mysql_select_db("freencom_forum") or die("Could not connect to MySQL");
//query to get latest 5 threads
$query = mysql_query("
SELECT t.*, u.username
FROM thefrumthreads t
LEFT JOIN thefrumusers u ON (u.uid=t.uid)
WHERE 1=1 AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
ORDER BY t.lastpost DESC
LIMIT 0, 5"
);
$list = '';
while($fetch = mysql_fetch_array($query))
{
$list .= "<strong><a href=\"forums/showthread.php?tid={$fetch['tid']}\">".htmlspecialchars_uni($fetch['subject'])."</a></strong><br />";
}
//output
echo $list;
?>
Is there a way I can make it not show the posts in a certain forum, like the staff forum?