From bd9e96a0c94d263b734720a9e3e35d4d1e872de3 Mon Sep 17 00:00:00 2001 From: deva Date: Sat, 11 Oct 2008 18:07:19 +0000 Subject: Added 'add forum' functionality when logged in as admin. --- forum/utils/view.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'forum/utils/view.php') diff --git a/forum/utils/view.php b/forum/utils/view.php index 0adb1a0..01e8b6a 100644 --- a/forum/utils/view.php +++ b/forum/utils/view.php @@ -23,6 +23,24 @@ echo "\n"; echo "

Forums

"; include_once("forums.php"); $forums = new Forums($FORUMS_DIR . "/forums.xml"); + + if($action == "addforum") { + $newfid = 0; + while($forums->getForum($newfid)) $newfid++; + + $forums->add(new Forum($newfid, $title)); + $forums->write(); + } + $forums->show(); + + if($current_user->uid == 0) { +?> +
+Add new forum: +
+ \ No newline at end of file -- cgit v1.2.3