summaryrefslogtreecommitdiff
path: root/submit.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2000-06-16 13:45:57 +0000
committerDries Buytaert <dries@buytaert.net>2000-06-16 13:45:57 +0000
commit17a008caa21cce683bc88258c79133632c57a039 (patch)
treec56891209d7f0b1f2016a79f53407790feb7b24d /submit.php
parent76f305571c1829d2d50df35075dcb0d3311836df (diff)
downloadbrdo-17a008caa21cce683bc88258c79133632c57a039.tar.gz
brdo-17a008caa21cce683bc88258c79133632c57a039.tar.bz2
* Boxed submit.php - whew, it's a pain to edit all those print statements.
* Fixed quite a lot of HTML-bugs in the HTML code generator and cleaned up the generated coded quite a lot. => much better now :)
Diffstat (limited to 'submit.php')
-rw-r--r--submit.php216
1 files changed, 104 insertions, 112 deletions
diff --git a/submit.php b/submit.php
index 7fa60488b..c00e196c1 100644
--- a/submit.php
+++ b/submit.php
@@ -1,132 +1,127 @@
<?PHP
-function defaultDisplay() {
+function submit_enter() {
include "functions.inc";
include "theme.inc";
- $theme->header();
-
+
global $user;
- print "<FORM ACTION=\"submit.php\" METHOD=\"post\">";
+ $output .= "<FORM ACTION=\"submit.php\" METHOD=\"post\">\n";
- print "<P>\n <B>Your name:</B><BR>";
- if ($user) {
- echo " <A HREF=\"account.php\">$user->userid</A> &nbsp; &nbsp; <FONT SIZE=\"2\">[ <A HREF=\"account.php?op=logout\">logout</A> ]</FONT>";
- } else {
- echo "$anonymous &nbsp; &nbsp; <FONT SIZE=\"2\">[ <A HREF=\"account.php\">login</A> | <A HREF=\"account.php\">create an account</A> ]</FONT>";
- }
- ?>
-
- <P>
- <B>Subject:</B><BR>
- <INPUT TYPE="text" NAME="subject" SIZE="50"><BR>
- <FONT SIZE="2"><I>Bad subjects are 'Check this out!' or 'An article'. Be descriptive, clear and simple!</I></FONT>
- </P>
-
- <P><B>Category:</B><BR>
- <SELECT NAME="category">
- <?PHP
- for ($i = 0; $i < sizeof($categories); $i++) {
- echo "<OPTION VALUE=\"$categories[$i]\">$categories[$i]\n";
- }
- ?>
- </SELECT>
- </P>
-
- <P>
- <B>Abstract:</B></I><BR>
- <TEXTAREA WRAP="virtual" COLS="50" ROWS="8" NAME="abstract"></TEXTAREA><BR>
- <FONT SIZE="2"><I>HTML is nice and dandy, but double check those URLs and HTML tags!</FONT>
- </P>
-
- <P>
- <B>Extended story:</B></I><BR>
- <TEXTAREA WRAP="virtual" COLS="50" ROWS="15" NAME="story"></TEXTAREA><BR>
- <FONT SIZE="2"><I>HTML is nice and dandy, but double check those URLs and HTML tags!</FONT>
- </P>
+ $output .= "<P>\n <B>Your name:</B><BR>\n";
+ if ($user) $output .= " <A HREF=\"account.php\">$user->userid</A> &nbsp; &nbsp; <SMALL>[ <A HREF=\"account.php?op=logout\">logout</A> ]</SMALL>\n";
+ else $output .= " $anonymous &nbsp; &nbsp; <SMALL>[ <A HREF=\"account.php\">login</A> | <A HREF=\"account.php\">create an account</A> ]</SMALL>\n";
+ $output .= "</P>\n";
+
+ $output .= "<P>\n";
+ $output .= " <B>Subject:</B><BR>\n";
+ $output .= " <INPUT TYPE=\"text\" NAME=\"subject\" SIZE=\"50\"><BR>\n";
+ $output .= " <SMALL><I>Bad subjects are 'Check this out!' or 'An article'. Be descriptive, clear and simple!</I></SMALL>\n";
+ $output .= "</P>\n";
+
+ $output .= "<P><B>Category:</B><BR>\n";
+ $output .= " <SELECT NAME=\"category\">\n";
+
+ for ($i = 0; $i < sizeof($categories); $i++) {
+ $output .= " <OPTION VALUE=\"$categories[$i]\">$categories[$i]</OPTION>\n";
+ }
+
+ $output .= " </SELECT>\n";
+ $output .= "</P>\n";
+
+ $output .= "<P>\n";
+ $output .= " <B>Abstract:</B><BR>\n";
+ $output .= " <TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"10\" NAME=\"abstract\"></TEXTAREA><BR>\n";
+ $output .= " <SMALL><I>HTML is nice and dandy, but double check those URLs and HTML tags!</I></SMALL>\n";
+ $output .= "</P>\n";
+
+ $output .= "<P>\n";
+ $output .= " <B>Extended story:</B><BR>\n";
+ $output .= " <TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"15\" NAME=\"story\"></TEXTAREA><BR>\n";
+ $output .= " <SMALL><I>HTML is nice and dandy, but double check those URLs and HTML tags!</I></SMALL>\n";
+ $output .= "</P>\n";
- <P>
- <INPUT TYPE="submit" NAME="op" VALUE="Preview story"> (You must preview at least once before you can submit.)
- </P>
+ $output .= "<P>\n";
+ $output .= " <INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Preview submission\"> (You must preview at least once before you can submit.)\n";
+ $output .= "</P>\n";
- <P>
- <FONT SIZE="2"><B>Important:</B> remember to include the exact URL of your <U>source</U> in case you refer to a story found on another website or your submission might be rejected!</FONT>
- </P>
+ $output .= "<P>\n";
+ $output .= " <SMALL><B>Important:</B> remember to include the exact URL of your <U>source</U> in case you refer to a story found on another website or your submission might be rejected!</SMALL>\n";
+ $output .= "</P>\n";
- </FORM>
- <?PHP
- $theme->footer();
+ $output .= "</FORM>\n";
+
+ $theme->header();
+ $theme->box("Submit a story", $output);
+ $theme->footer();
}
-function PreviewStory($name, $address, $subject, $abstract, $story, $category) {
+function submit_preview($name, $address, $subject, $abstract, $story, $category) {
global $user;
+
include "functions.inc";
include "theme.inc";
- $theme->header();
-
- print "<B>Preview:</B><BR>";
- $theme->preview("", $user->userid, date("l, F d, Y - H:i A", time()), stripslashes($subject), "we-hate-typoes", stripslashes($abstract), "", stripslashes($story));
-
- print "<FORM ACTION=\"submit.php\" METHOD=\"post\">";
-
- print "<P>\n <B>Your name:</B><BR>";
- if ($user) {
- echo " <A HREF=\"account.php\">$user->userid</A> &nbsp; &nbsp; <FONT SIZE=\"2\"> [ <A HREF=\"account.php?op=logout\">logout</A> ]</FONT>";
- } else {
- echo "$anonymous &nbsp; &nbsp; <FONT SIZE=\"2\">[ <A HREF=\"$account.php\">login</A> | <A HREF=\"account.php\">create an account</A> ]</FONT>";
- }
- ?>
-
- <P>
- <B>Subject:</B><BR>
- <INPUT TYPE="text" NAME="subject" SIZE="50" VALUE="<? print stripslashes($subject); ?>"><BR>
- <FONT SIZE="2"><I>Bad subjects are 'Check this out!' or 'An article'. Be descriptive, clear and simple!</I></FONT>
- </P>
-
- <P><B>Category:</B><BR>
- <SELECT NAME="category">
- <?PHP
- for ($i = 0; $i < sizeof($categories); $i++) {
- print "<OPTION VALUE=\"$categories[$i]\" ";
- if ($category == $categories[$i]) print "SELECTED";
- print ">$categories[$i]\n";
- }
- ?>
- </SELECT>
- </P>
-
- <P>
- <B>Abstract:</B></I><BR>
- <TEXTAREA WRAP="virtual" COLS="50" ROWS="8" NAME="abstract"><? print stripslashes($abstract); ?></TEXTAREA><BR>
- <FONT SIZE="2"><I>HTML is nice and dandy, but double check those URLs and HTML tags!</FONT>
- </P>
-
- <P>
- <B>Extended story:</B></I><BR>
- <TEXTAREA WRAP="virtual" COLS="50" ROWS="15" NAME="story"><? print stripslashes($story); ?></TEXTAREA><BR>
- <FONT SIZE="2"><I>HTML is nice and dandy, but double check those URLs and HTML tags!</FONT>
- </P>
+ $output .= "<FORM ACTION=\"submit.php\" METHOD=\"post\">\n";
+
+ $output .= "<P>\n";
+ $output .= " <B>Your name:</B><BR>\n";
+ if ($user) $output .= " <A HREF=\"account.php\">$user->userid</A> &nbsp; &nbsp; <SMALL> [ <A HREF=\"account.php?op=logout\">logout</A> ]</SMALL>\n";
+ else $output .= " $anonymous &nbsp; &nbsp; <SMALL>[ <A HREF=\"$account.php\">login</A> | <A HREF=\"account.php\">create an account</A> ]</SMALL>\n";
+ $output .= "</P>\n";
+
+ $output .= "<P>\n";
+ $output .= " <B>Subject:</B><BR>\n";
+ $output .= " <INPUT TYPE=\"text\" NAME=\"subject\" SIZE=\"50\" VALUE=\"". stripslashes($subject) ."\"><BR>\n";
+ $output .= " <SMALL><I>Bad subjects are 'Check this out!' or 'An article'. Be descriptive, clear and simple!</I></SMALL>\n";
+ $output .= "</P>\n";
+
+ $output .= "<P><B>Category:</B><BR>\n";
+ $output .= " <SELECT NAME=\"category\">\n";
+ for ($i = 0; $i < sizeof($categories); $i++) {
+ $output .= " <OPTION VALUE=\"$categories[$i]\" ";
+ if ($category == $categories[$i]) $output .= "SELECTED";
+ $output .= ">$categories[$i]</OPTION>\n";
+ }
+ $output .= "</SELECT>\n";
+ $output .= "</P>\n";
+
+ $output .= "<P>\n";
+ $output .= "<B>Abstract:</B><BR>\n";
+ $output .= " <TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"10\" NAME=\"abstract\">". stripslashes($abstract) ."</TEXTAREA><BR>\n";
+ $output .= " <SMALL><I>HTML is nice and dandy, but double check those URLs and HTML tags!</I></SMALL>\n";
+ $output .= "</P>\n";
+
+ $output .= "<P>\n";
+ $output .= " <B>Extended story:</B><BR>\n";
+ $output .= " <TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"15\" NAME=\"story\">". stripslashes($story) ."</TEXTAREA><BR>\n";
+ $output .= " <SMALL><I>HTML is nice and dandy, but double check those URLs and HTML tags!</I></SMALL>\n";
+ $output .= "</P>\n";
- <P>
- <INPUT TYPE="submit" NAME="op" VALUE="Preview again"> <INPUT TYPE="submit" NAME="op" VALUE="Submit story">
- </P>
+ $output .= "<P>\n";
+ $output .= " <INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Preview submission\"> <INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Submit submission\">\n";
+ $output .= "</P>\n";
- <P>
- <FONT SIZE="2"><B>Important:</B> remember to include the exact URL of your <U>source</U> in case you refer to a story found on another website or your submission might be rejected!</FONT>
- </P>
+ $output .= "<P>\n";
+ $output .= " <SMALL><B>Important:</B> remember to include the exact URL of your <U>source</U> in case you refer to a story found on another website or your submission might be rejected!</SMALL>\n";
+ $output .= "</P>\n";
- </FORM>
- <?PHP
- $theme->footer();
+ $output .= "</FORM>\n";
+
+ $theme->header();
+ $theme->preview("", $user->userid, date("l, F d, Y - H:i A", time()), stripslashes($subject), "we-hate-typoes", stripslashes($abstract), "", stripslashes($story));
+ $theme->box("Submit a story", $output);
+ $theme->footer();
}
-function submitStory($name, $address, $subject, $abstract, $article, $category) {
+function submit_submit($name, $address, $subject, $abstract, $article, $category) {
global $user;
+
include "functions.inc";
+ include "theme.inc";
### Display confirmation message:
- include "theme.inc";
+
$theme->header();
$theme->box("Thanks for your submission.", "Thanks for your submission. The submission moderators in our basement will frown at it, poke at it, and vote for it!");
$theme->footer();
@@ -151,17 +146,14 @@ function submitStory($name, $address, $subject, $abstract, $article, $category)
}
switch($op) {
- case "Preview story":
- PreviewStory($name, $address, $subject, $abstract, $story, $category);
- break;
- case "Preview again":
- PreviewStory($name, $address, $subject, $abstract, $story, $category);
+ case "Preview submission":
+ submit_preview($name, $address, $subject, $abstract, $story, $category);
break;
- case "Submit story":
- SubmitStory($name, $address, $subject, $abstract, $story, $category);
+ case "Submit submission":
+ submit_submit($name, $address, $subject, $abstract, $story, $category);
break;
default:
- defaultDisplay();
+ submit_enter();
break;
}