enforce_login(); if (!check_perms('admin_manage_news')) { error(403); } include(SERVER_ROOT.'/classes/class_text.php'); $Text = new TEXT; View::show_header('Manage news','bbcode'); switch ($_GET['action']) { case 'takeeditnews': if (!check_perms('admin_manage_news')) { error(403); } if (is_number($_POST['newsid'])) { authorize(); $DB->query("UPDATE news SET Title='".db_string($_POST['title'])."', Body='".db_string($_POST['body'])."' WHERE ID='".db_string($_POST['newsid'])."'"); $Cache->delete_value('news'); $Cache->delete_value('feed_news'); } header('Location: index.php'); break; case 'editnews': if (is_number($_GET['id'])) { $NewsID = $_GET['id']; $DB->query("SELECT Title, Body FROM news WHERE ID=$NewsID"); list($Title, $Body) = $DB->next_record(); } } ?>