";
$f_str = "";
if($fid) {
$legend .= "Legend: Forums";
if($tid) {
include_once($UTIL_DIR . "/forums.php");
$forums = new Forums($FORUMS_DIR . "/forums.xml");
$forum = $forums->getForum($fid);
$legend .= " :: ".$forum->name."";
include_once($UTIL_DIR . "/posts.php");
$posts = new Posts($FORUMS_DIR . "/" . $fid . "/" . $tid . ".xml");
$legend .= " :: ".$posts->thread->name;
$f_str .= $posts->show();
} else {
include_once($UTIL_DIR . "/forums.php");
$forums = new Forums($FORUMS_DIR . "/forums.xml");
$forum = $forums->getForum($fid);
$legend .= " :: ".$forum->name;
$f_str .= "
Threads in '".$forum->name."'
\n";
$f_str .= " New thread\n";
include_once($UTIL_DIR . "/threads.php");
$threads = new Threads($FORUMS_DIR . "/" . $fid);
$f_str .= $threads->show();
}
} else {
$legend .= "Legend: Forums";
$f_str .= " Forums
\n";
include_once("forums.php");
$forums = new Forums($FORUMS_DIR . "/forums.xml");
if($action == "addforum") {
$newfid = 1;
while($forums->getForum($newfid)) $newfid++;
$forums->add(new Forum($newfid, $title));
$forums->write();
}
$f_str .= $forums->show();
if($current_user->uid == 0) {
$f_str .= "\n";
}
}
$legend .= "\n";
return $legend . $f_str;
}
?>