\n"; $output .= "

\n Your name:
\n"; $output .= format_username($user->userid); $output .= "

\n"; $output .= "

\n"; $output .= " Subject:
\n"; $output .= "
\n"; $output .= " Bad subjects are 'Check this out!' or 'An article'. Be descriptive, clear and simple!\n"; $output .= "

\n"; $output .= "

Category:
\n"; $output .= " \n"; $output .= "

\n"; $output .= "

\n"; $output .= " Abstract:
\n"; $output .= "
\n"; $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; $output .= "

\n"; $output .= "

\n"; $output .= " Extended story:
\n"; $output .= "
\n"; $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; $output .= "

\n"; $output .= "

\n"; $output .= " You must preview at least once before you can submit:
\n"; $output .= " \n"; $output .= "

\n"; $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"; $output .= "

\n"; $output .= " Your name:
\n"; $output .= format_username($user->userid); $output .= "

\n"; $output .= "

\n"; $output .= " Subject:
\n"; $output .= "
\n"; $output .= " Bad subjects are 'Check this out!' or 'An article'. Be descriptive, clear and simple!\n"; $output .= "

\n"; $output .= "

Category:
\n"; $output .= "
\n"; $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; $output .= "

\n"; if (empty($subject)) { $output .= "

\n"; $output .= " Warning: you did not supply a subject.\n"; $outout .= "

\n"; $output .= "

\n"; $output .= " \n"; $output .= "

\n"; } else if (empty($abstract)) { $output .= "

\n"; $output .= " Warning: you did not supply an abstract.\n"; $outout .= "

\n"; $output .= "

\n"; $output .= " \n"; $output .= "

\n"; } else { $output .= "

\n"; $output .= " \n"; $output .= " \n"; $output .= "

\n"; } $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; } ?>