".$locale['401']." |
".$locale['402']." |
".$locale['403']." |
".$locale['404']." |
\n";
$forum_list = ""; $current_cat = "";
$result = dbquery(
"SELECT f.*, COUNT(t.thread_id) AS thread_count, MAX(t.thread_lastpost) AS last_post, f2.forum_name AS forum_cat_name, u.user_id, u.user_name FROM ".$db_prefix."forums f
LEFT JOIN ".$db_prefix."threads t USING(forum_id)
LEFT JOIN ".$db_prefix."forums f2 ON f.forum_cat = f2.forum_id
LEFT JOIN ".$db_prefix."users u ON f.forum_lastuser = u.user_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' GROUP BY forum_id ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
if (dbrows($result) != 0) {
while ($data = dbarray($result)) {
if ($data['forum_cat_name'] != $current_cat) {
$current_cat = $data['forum_cat_name'];
echo "\n".$data['forum_cat_name']." | \n \n";
}
$moderators = "";
if ($data['forum_moderators']) {
$res = "user_id='".str_replace(".", "' OR user_id='", $data['forum_moderators'])."'";
$result2 = dbquery("SELECT user_id,user_name FROM ".$db_prefix."users WHERE (".$res.")");
while ($data2 = dbarray($result2)) {
if ($moderators) $moderators .= ", ";
$moderators .= "".$data2['user_name']."";
}
}
if ($data['last_post'] > $lastvisited) {
$fim = "";
} else {
$fim = "";
}
echo "
$fim |
".$data['forum_name']."
".$data['forum_description'].($moderators ? " \n".$locale['411'].$moderators." | \n" : "\n")."
".$data['thread_count']." |
".dbcount("(post_id)", "posts", "forum_id='".$data['forum_id']."'")." |
";
if ($data['forum_lastpost'] == 0) {
echo $locale['405']." | \n \n";
} else {
echo showdate("forumdate", $data['forum_lastpost'])."
".$locale['406']."".$data['user_name']."
\n";
}
}
} else {
echo "\n".$locale['407']." | \n \n";
}
echo "
|