{$_POST['board-categoryid']}, {$_POST['board-styleid']}, {$_POST['board-disabled']}, MAX(boardorder) + 1 FROM {$pref}board WHERE categoryid = {$_POST['board-categoryid']} SQL ); echo "Board saved."; } } } else { $board = (object) ['ID' => 0, 'name' => '', 'description' => '', 'categoryID' => 0, 'styleID' => 0, 'disabled' => 0]; BoardForm($board, 'boards.php?action=board-new&session=' . $session); } } /* * ######################################################################################## * Delete a category * ######################################################################################## */ if ('category-delete' == $action) { NavigationBar($action); print "<h3>Delete Category</h3>"; $r_board = query(<<<SQL SELECT COUNT(boardid) AS boardcount FROM {$pref}board
$data['work'] .= 'Klick <a href="boards.php?action=delete&forumid=' . $_GET['forumid'] . '&confirm=1">hier</a> um weiter zu machen'; } } elseif ($action == 'newboard') { if (isset($_POST['send'])) { if ($_POST['board_name'] == '') { $data['work'] = 'Bitte gib einen Namen für das Board an.'; } else { $result = db_query("SELECT\n max(board_order)\n FROM " . $pref . "board WHERE category='" . $_POST['category'] . "'"); list($maxorder) = mysql_fetch_row($result); $maxorder++; db_query("INSERT INTO " . $pref . "board SET\n board_name='" . addslashes($_POST['board_name']) . "',\n board_under='" . addslashes($_POST['under']) . "',\n category='" . $_POST['category'] . "',\n board_order='{$maxorder}',\n styleid='" . $_POST['styleid'] . "',\n disabled='" . $_POST['disabled'] . "'"); $data['work'] = 'Forum wurde angelegt, bitte überprüffe die Rechte.'; } } else { $data['work'] = '<b>Board hinzufügen</b><br><br>'; $data['work'] .= BoardForm(array(), 'newboard'); } } elseif ($action == 'newcat') { if (isset($_POST['send'])) { if ($_POST['name'] == '') { $data['work'] = 'Bitte gib einen Namen für die Kategorie an.'; } else { $result = db_query("SELECT\n max(category_order)\n FROM " . $pref . "category"); list($maxorder) = mysql_fetch_row($result); $maxorder++; if (!isset($_POST['open'])) { $_POST['open'] = 0; } db_query("INSERT INTO " . $pref . "category SET\n category_name='" . addslashes($_POST['name']) . "',\n category_order='{$maxorder}',\n category_is_open='{$_POST['open']}'"); $data['work'] = 'Kategorie wurde angelegt.'; }