header();
global $user, $cookie;
if (isset($user)) getusrinfo($user);
print "
footer();
}
function PreviewStory($name, $address, $subject, $abstract, $story, $category) {
global $user, $cookie;
include "functions.inc";
include "theme.inc";
$theme->header();
print "Preview:
";
$theme->preview("", $cookie[1], date("l, F d, Y - H:i A", time()), stripslashes($subject), "we-hate-typoes", stripslashes($abstract), "", stripslashes($story));
print "
footer();
}
function submitStory($name, $address, $subject, $abstract, $article, $category) {
global $user, $cookie;
include "functions.inc";
### Display confirmation message:
include "theme.inc";
$theme->header();
$theme->box("Thanks for your submission.", "Thanks for your submission. The gnomes in our basement will frown at it, poke at it, and - if you are lucky - even post it!");
$theme->footer();
### Add submission to queue:
dbconnect();
if ($user) {
cookiedecode($user);
$uid = $cookie[0];
$name = $cookie[1];
}
else {
$uid = -1;
$name = $anonymous;
}
$subject = stripslashes(FixQuotes(check_html($subject, "nohtml")));
$abstract = stripslashes(FixQuotes(check_html($abstract)));
$article = stripslashes(FixQuotes(check_html($article)));
$result = mysql_query("INSERT INTO queue VALUES (NULL, '$uid', '$name', '$subject', '$article', '". time() ."', '$category', '$abstract', 0, 0)");
### Send notification mail (if required):
if ($notify) {
$message = "New submission:\n\nsubject...: $subject\nauthor....: $name\ncategory..: $category\nabstract..:\n$abstract\n\narticle...:\n$article";
mail($notify_email, "$notify_subject $subject", $message, "From: $notify_from\nX-Mailer: PHP/" . phpversion());
}
}
switch($op) {
case "Preview story":
PreviewStory($name, $address, $subject, $abstract, $story, $category);
break;
case "Preview again":
PreviewStory($name, $address, $subject, $abstract, $story, $category);
break;
case "Submit story":
SubmitStory($name, $address, $subject, $abstract, $story, $category);
break;
default:
defaultDisplay();
break;
}
?>