diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-02-17 15:38:37 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-02-17 15:38:37 +0000 |
commit | a60edc750826432facb57759b8d9e205f672ed8d (patch) | |
tree | 5a687d2fa165ece2dd92417614266c242c5f41b5 /submit.php | |
parent | 52a1d1bbe80422ca7a8c79dde6fd92db542b9b2d (diff) | |
download | brdo-a60edc750826432facb57759b8d9e205f672ed8d.tar.gz brdo-a60edc750826432facb57759b8d9e205f672ed8d.tar.bz2 |
- improved the "menu" hook
- replaced the "open submission queue" (submission.php and submission.inc)
with an optional module (submission.module).
- tidied up the HTML code of some files
Diffstat (limited to 'submit.php')
-rw-r--r-- | submit.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/submit.php b/submit.php index 337aa69a2..b4fee5668 100644 --- a/submit.php +++ b/submit.php @@ -52,7 +52,7 @@ function submit_preview($subject, $abstract, $article, $section) { $output .= format_username($user->userid) ."<P>"; $output .= "<B>". t("Subject") .":</B><BR>\n"; - $output .= "<INPUT TYPE=\"text\" NAME=\"subject\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"". check_textfield($subject) ."\"><BR><P>\n"; + $output .= "<INPUT TYPE=\"text\" NAME=\"subject\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"". check_textfield($subject) ."\"><P>\n"; $output .= "<B>". t("Section") .":</B><BR>\n"; foreach ($sections = section_get() as $value) $options .= " <OPTION VALUE=\"$value\"". ($section == $value ? " SELECTED" : "") .">$value</OPTION>\n"; @@ -66,6 +66,8 @@ function submit_preview($subject, $abstract, $article, $section) { $output .= "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"15\" NAME=\"article\">". check_textarea($article) ."</TEXTAREA><BR>\n"; $output .= "<SMALL><I>". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".</I></SMALL><P>\n"; + $duplicate = db_result(db_query("SELECT COUNT(id) FROM stories WHERE subject = '$subject'")); + if (empty($subject)) { $output .= "<FONT COLOR=\"red\">". t("Warning: you did not supply a subject.") ."</FONT><P>\n"; $output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"". t("Preview submission") ."\">\n"; @@ -74,6 +76,10 @@ function submit_preview($subject, $abstract, $article, $section) { $output .= "<FONT COLOR=\"red\">". t("Warning: you did not supply an abstract.") ."</FONT><P>\n"; $output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"". t("Preview submission") ."\">\n"; } + else if ($duplicate) { + $output .= "<FONT COLOR=\"red\">". t("Warning: there is already a story with that subject.") ."</FONT><P>\n"; + $output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"". t("Preview submission") ."\">\n"; + } else { $output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"". t("Preview submission") ."\">\n"; $output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"". t("Submit submission") ."\">\n"; |