submit
/* Authenticated admin user allowed to: check the queue
edit article on the queue
optionally preview
post article to database
--------------------------
choose existing article
edit existing article
optionally preview
update article in database
--------------------------
write new article
preview (required)
post article to database
--------------------------
Ordinary web users can: write article
preview (required)
submit to the queue
*/
if (isset($_POST['action']))
$action = strtolower($_POST['action']);
else
$action = NULL;
switch ($action) {
case 'post': // post to database
case 'save': // post to queue
case 'submit': // post to queue
if (validate_data() && count($validate) === 0) {
$id = save_data();
echo display_stories($id);
} else {
$action = 'preview';
include('./preview.inc.php');
}
break;
case 'preview': // preview before posting
validate_data();
include('./preview.inc.php');
break;
default: // write a new article
include('./write.inc.php');
break;
}
?>
include_once("../sidebar.inc.php"); ?>
include_once("../bottombar.inc.php"); ?>