function submit_enter() { global $anonymous, $categories, $allowed_html, $theme, $user; ### Guidlines: $output .= droplet_get("submit_information"); ### Submission form: $output .= "
\n"; $theme->header(); $theme->box("Submit a story", $output); $theme->footer(); } function submit_preview($subject, $abstract, $article, $category) { global $categories, $allowed_html, $theme, $user; include "includes/story.inc"; $output .= "\n"; $theme->header(); $theme->article(new Story($user->userid, $subject, $abstract, $article, $category, time())); $theme->box("Submit a story", $output); $theme->footer(); } function submit_submit($subject, $abstract, $article, $category) { global $user, $theme; ### Add log entry: watchdog("story", "added new story with subject `$subject'"); ### Add submission to SQL table: db_query("INSERT INTO stories (author, subject, abstract, article, category, timestamp) VALUES ('$user->id', '". check_input($subject) ."', '". check_input($abstract) ."', '". check_input($article) ."', '". check_input($category) ."', '". time() ."')"); ### Display confirmation message: $theme->header(); $theme->box("Thank you for your submission.", droplet_get("submit_confirmation")); $theme->footer(); } include "includes/theme.inc"; switch($op) { case "Preview submission": submit_preview($subject, $abstract, $article, $category); break; case "Submit submission": submit_submit($subject, $abstract, $article, $category); break; default: submit_enter(); break; } ?>