". t("Got some news or some thoughts you would like to share? Fill out this form and they will automatically get whisked away to our submission queue where our moderators will frown at it, poke at it and hopefully post it. Every registered user is automatically a moderator and can vote whether or not your sumbission should be carried to the front page for discussion.") ."

\n"; $output .= "

". t("Note that we do not revamp or extend your submission so it is up to you to make sure your submission is well-written: if you don't care enough to be clear and complete, your submission is likely to be moderated down by our army of moderators. Try to be complete, aim for clarity, organize and structure your text, and try to carry out your statements with examples. It is also encouraged to extend your submission with arguments that flow from your unique intellectual capability and experience: offer some insight or explanation as to why you think your submission is interesting. Make sure your submission has some meat on it!") ."

\n"; $output .= "

". t("However, if you have bugs to report, complaints, personal questions or anything besides a public submission, we would prefer you to mail us instead, or your message is likely to get lost.") ."

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

\n"; $output .= "". t("Subject") .":
\n"; $output .= "

\n"; $output .= "". t("Section") .":
\n"; foreach ($sections = section_get() as $value) $options .= " \n"; $output .= "

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

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

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

\n"; $output .= "

\n"; $theme->header(); $theme->box(t("New submission"), $output); $theme->footer(); } function submit_preview($subject, $abstract, $article, $section) { global $allowed_html, $theme, $user; include "includes/story.inc"; $output .= "
\n"; $output .= "". t("Your name") .":
\n"; $output .= format_username($user->userid) ."

"; $output .= "". t("Subject") .":
\n"; $output .= "

\n"; $output .= "". t("Section") .":
\n"; foreach ($sections = section_get() as $value) $options .= " \n"; $output .= "

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

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

\n"; $duplicate = db_result(db_query("SELECT COUNT(id) FROM stories WHERE subject = '". check_input($subject) ."'")); if (empty($subject)) { $output .= "". t("Warning: you did not supply a subject.") ."

\n"; $output .= "\n"; } else if (empty($abstract)) { $output .= "". t("Warning: you did not supply an abstract.") ."

\n"; $output .= "\n"; } else if ($duplicate) { $output .= "". t("Warning: there is already a story with that subject.") ."

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

\n"; $theme->header(); $theme->story(new Story($user->userid, $subject, $abstract, $article, $section, time()), "[ ". t("reply to this story") ." ]"); $theme->box(t("Submit a story"), $output); $theme->footer(); } function submit_submit($subject, $abstract, $article, $section) { global $user, $theme; // Add log entry: watchdog("story", "story: added '$subject'"); // Add submission to SQL table: db_query("INSERT INTO stories (author, subject, abstract, article, section, timestamp) VALUES ('$user->id', '$subject', '$abstract', '$article', '$section', '". time() ."')"); // Display confirmation message: $theme->header(); $theme->box(t("Submission completed"), t("Thank you for your submission. Your submission has been whisked away to our submission queue where our registered users will frown at it, poke at it and hopefully carry it to the front page for discussion.")); $theme->footer(); } switch($op) { case t("Preview submission"): submit_preview(($subject ? check_output($subject) : ""), ($abstract ? check_output($abstract) : ""), ($article ? check_output($article) : ""), check_output($section)); break; case t("Submit submission"): submit_submit(check_input($subject), check_input($abstract), check_input($article), check_input($section)); break; default: submit_enter(); break; } ?>