diff options
Diffstat (limited to 'forum/utils/view.php')
-rw-r--r-- | forum/utils/view.php | 18 |
1 files changed, 18 insertions, 0 deletions
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 "</div>\n"; echo "<h1>Forums</h1>"; 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) { +?> +<form method="post" action="?mode=forum&action=addforum"> +Add new forum: <input name="title" value=""><button type="submit">Add</button> +</form> +<?php + } + } ?>
\ No newline at end of file |