WITH SUB CATEGORIES
PHP Code:
<?
require("/home/dforums/public_html/forum/global.php");
//Forum info
$forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
while ($forum=$DB_site->fetch_array($forums)) {
if ($forum[parentid] == -1) {
echo ("<font face=\"Arial, Helvetica, sans-serif\" size=\"2\"><b><a href=\"http://www.yourdomain.com/forum/forumdisplay.php?forumid=".$forum[forumid]."\">".$forum[title]."</a></b></font><br>");
if ($forum[allowposting] == 0) {
$parent=$forum[forumid];
$subforums=$DB_site->query("SELECT * FROM forum WHERE displayorder<>0 AND active=1 AND parentid=".$parent." ORDER BY displayorder");
while ($subforum=$DB_site->fetch_array($subforums)) {
echo (" <font face=\"Arial, Helvetica, sans-serif\" size=\"-3\"><a href=\"http://www.yourdomain.com/forum/forumdisplay.php?forumid=".$subforum[forumid]."\">".$subforum[title]."</a></font><br>");
}
}
}
}
$DB_site->free_result($forums);
unset($forum);
?>
WITHOUT SUB CATEGORIES
PHP Code:
<?
require("/home/dforums/public_html/forum/global.php");
//Forum info
$forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
while ($forum=$DB_site->fetch_array($forums)) {
if ($forum[parentid] == -1) {
echo ("<font face=\"Arial, Helvetica, sans-serif\" size=\"2\"><b><a href=\"http://www.yourdomain.com/forum/forumdisplay.php?forumid=".$forum[forumid]."\">".$forum[title]."</a></b></font><br>");
}
}
$DB_site->free_result($forums);
unset($forum);
?>