ob_start("ob_gzhandler"); require "include/bittorrent.php"; dbconn(); loggedinorreturn(); stdhead("Forum Management Tools"); begin_main_frame(); if( get_user_class() < UC_MODERATOR) stderr( _("Error"), _("Permission denied.")); // DELETE FORUM ACTION if ($_GET['action'] == "del") { if (!$_GET['id']) { header("Location: forummanage.php"); die();} $result = do_mysql_query ("SELECT * FROM topics where forumid = '".$_GET['id']."'"); if ($row = mysql_fetch_array($result)) { do { do_mysql_query ("DELETE FROM posts where topicid = '".$row["id"]."'") or sqlerr(__FILE__, __LINE__); } while($row = mysql_fetch_array($result)); } do_mysql_query ("DELETE FROM topics where forumid = '".$_GET['id']."'") or sqlerr(__FILE__, __LINE__); do_mysql_query ("DELETE FROM forums where id = '".$_GET['id']."'") or sqlerr(__FILE__, __LINE__); header("Location: forummanage.php"); die(); } //EDIT FORUM ACTION if ($_POST['action'] == "editforum") { if (!$name && !$desc && !$id) { header("Location: forummanage.php"); die();} do_mysql_query("UPDATE forums SET sort = '" . mysql_escape_string($_POST['sort']) . "', name = " . sqlesc($_POST['name']). ", description = " . sqlesc($_POST['desc']). ", minclassread = '" . mysql_escape_string($_POST['readclass']) . "', minclasswrite = '" . mysql_escape_string($_POST['writeclass']) . "', minclasscreate = '" . mysql_escape_string($_POST['createclass']) . "' where id = '".mysql_escape_string($_POST['id'])."'") or sqlerr(__FILE__, __LINE__); header("Location: forummanage.php"); die(); } //ADD FORUM ACTION if ($_POST['action'] == "addforum") { if (!$_POST['name'] && !$_POST['desc']) { header("Location: forummanage.php"); die();} do_mysql_query("INSERT INTO forums (sort, name, description, minclassread, minclasswrite, minclasscreate) VALUES(" . mysql_escape_string($_POST['sort']) . ", " . sqlesc($_POST['name']). ", " . sqlesc($_POST['desc']). ", " . mysql_escape_string($_POST['readclass']) . ", " . mysql_escape_string($_POST['writeclass']) . ", " . mysql_escape_string($_POST['createclass']) . ")") or sqlerr(__FILE__, __LINE__); header("Location: forummanage.php"); die(); } // SHOW FORUMS WITH FORUM MANAGMENT TOOLS begin_frame("Forums"); ?> echo '
"._('Name')." | "._('Topics')." | "._('Posts')." | "._('Read')." | "._('Write')." | "._('Create Topic')." | "._('Modify')." |
".$row["name"]." ".$row["description"]." | ";
//echo "".$row["topiccount"]." | ".$row["postcount"]." | minimaal " . get_user_class_name($row["minclassread"]) . " | minimaal " . get_user_class_name($row["minclasswrite"]) . " | minimaal " . get_user_class_name($row["minclasscreate"]) . " | Bewerk | Verwijder |
".$row["name"]." ".$row["description"]." | ";
echo "".$row["topiccount"]." | ".$row["postcount"]." | minimal " . get_user_class_name($row["minclassread"]) . " | minimal " . get_user_class_name($row["minclasswrite"]) . " | minimal " . get_user_class_name($row["minclasscreate"]) . " | EDIT | DELETE |
Sorry, no records were found! |