Go to admin";} else $main_content .= "Wrong password or login."; } $action = (int) $_REQUEST['action']; if(!empty($action)){ if(!empty($_SESSION['admin'])){ $main_content .= "Create new board.
"; if($action == 2){ $id = (int)$_GET['id']; deleteBoard($id); $main_content .= "Board has been deleted.
"; } else if($action == 3){ if(isset($_POST['new_board'])){ $name = $_POST['name']; $desc = $_POST['desc']; $closed = $_POST['closed']; $access = $_POST['access']; mysql_query("INSERT INTO `forums` VALUES('', '$name', '$desc', '$closed', '$access');"); $main_content .= "$name has been made."; } $main_content .= "
"; $main_content .= "Board name:
"; $main_content .= "Description:
"; $main_content .= "Closed:
"; $main_content .= "Min. access to enter:
"; $main_content .= ""; $main_content .= "
"; } } else { $main_content .= "
Login:
Password:
"; } } if(!$logged) $main_content .= "You are not logged in. Log in to post on the forum.
"; $main_content .= "
Current time: $date
"; $main_content .= ""; $sql = mysql_query("SELECT * FROM `forums`"); $row = mysql_num_rows($sql); if($row == 0) $main_content .= "No specified forums yet."; else { while($cmd = mysql_fetch_array($sql)){ $name = $cmd['name']; $desc = $cmd['description']; $access = $cmd['access']; $closed = $cmd['closed']; $id = $cmd['id']; if($closed == 1)$close = ""; if(!$logged) $user_access = 0; else { $user = loadAccountById($account_logged); $user_access = $user['page_access']; } if($access > $user_access) continue; $posts = mysql_num_rows(mysql_query("SELECT * FROM `posts` WHERE `board` = '$id'")); $threads = mysql_num_rows(mysql_query("SELECT * FROM `threads` WHERE `board` = '$id'")); $last = mysql_query("SELECT * FROM `posts` WHERE `board` = '$id' ORDER BY `id` DESC LIMIT 1"); $row = mysql_num_rows($last); if($row == 0) $last = "None"; else { $cmd1 = mysql_fetch_array($last); $author = $cmd1['author']; $thread = $cmd1['thread']; $date = $cmd1['date']; $last = " $date
by $author"; } if(!empty($_SESSION['admin'])) $admin = "Delete this board"; $main_content .= ""; } } $main_content .= "