diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-03-03 15:31:01 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-03-03 15:31:01 +0000 |
commit | dba73421831e3cf848b2ce9732a2fef666e5566e (patch) | |
tree | a4c0df6faaf6ae983d5102ebb725428dbbc77243 | |
parent | 16e6b6f137b728f7b3dda2457e0682acb5ff2e4a (diff) | |
download | brdo-dba73421831e3cf848b2ce9732a2fef666e5566e.tar.gz brdo-dba73421831e3cf848b2ce9732a2fef666e5566e.tar.bz2 |
code revision:
- shortened and improved the code
-rw-r--r-- | modules/story.module | 79 | ||||
-rw-r--r-- | modules/story/story.module | 79 |
2 files changed, 60 insertions, 98 deletions
diff --git a/modules/story.module b/modules/story.module index 535821ccd..641c1ed3b 100644 --- a/modules/story.module +++ b/modules/story.module @@ -112,55 +112,36 @@ function story_edit($id) { $output .= "<FORM ACTION=\"admin.php?mod=story&id=$id\" METHOD=\"post\">\n"; - $output .= "<P>\n"; - $output .= " <B>Author:</B><BR>\n"; - $output .= " ". format_username($story->userid) ."\n"; - $output .= "</P>\n"; - - $output .= "<P>\n"; - $output .= " <B>Subject:</B><BR>\n"; - $output .= " <INPUT TYPE=\"text\" NAME=\"edit[subject]\" SIZE=\"50\" VALUE=\"". check_textfield($story->subject) ."\"><BR>\n"; - $output .= "</P>\n"; - - $output .= "<P>\n"; - $output .= " <B>Section:</B><BR>\n"; - $output .= " <SELECT NAME=\"edit[section]\">\n"; - foreach ($sections = section_get() as $value) { - $output .= " <OPTION VALUE=\"$value\"". ($story->section == $value ? " SELECTED" : "") .">$value</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=\"edit[abstract]\">". check_textarea($story->abstract) ."</TEXTAREA><BR>\n"; - $output .= " <SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL>\n"; - $output .= "</P>\n"; - - $output .= "<P>\n"; - $output .= " <B>Editor's note/updates:</B><BR>\n"; - $output .= " <TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"10\" NAME=\"edit[updates]\">". check_textarea($story->updates) ."</TEXTAREA><BR>\n"; - $output .= " <SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</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=\"edit[article]\">". check_textarea($story->article) ."</TEXTAREA><BR>\n"; - $output .= " <SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL>\n"; - $output .= "</P>\n"; - - $output .= "<P>\n"; - $output .= " <B>Status:</B><BR>\n"; - $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"3\"". ($story->status == 3 ? " CHECKED" : "") .">scheduled story for <INPUT TYPE=\"text\" NAME=\"edit[date]\" SIZE=\"30\" VALUE=\"". date("j F Y G:i", $story->timestamp) ."\"><BR>\n"; - $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"2\"". ($story->status == 2 ? " CHECKED" : "") .">posted story<BR>\n"; - $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"1\"". ($story->status == 1 ? " CHECKED" : "") .">queued story<BR>\n"; - $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"0\"". ($story->status == 0 ? " CHECKED" : "") .">dumped story<BR>\n"; - $output .= " <SMALL><I>The textfield for scheduled stories expects a string containing an English date format of when you want to have your story automatically published.<BR>Example input: '". date("j F Y G:i") ."', '". date("m/d/y H:i") ."', '". date("F j, Y H:i") ."', ...</I></SMALL>\n"; - $output .= "</P>\n"; - - $output .= "<P>\n"; - $output .= " <INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save story\">\n"; - $output .= "</P>\n"; + $output .= "<B>Author:</B><BR>\n"; + $output .= format_username($story->userid) ."<P>\n"; + + $output .= "<B>Subject:</B><BR>\n"; + $output .= "<INPUT TYPE=\"text\" NAME=\"edit[subject]\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"". check_textfield($story->subject) ."\"><P>\n"; + + $output .= "<B>Section:</B><BR>\n"; + foreach ($sections = section_get() as $value) $options .= " <OPTION VALUE=\"$value\"". ($story->section == $value ? " SELECTED" : "") .">$value</OPTION>\n"; + $output .= "<SELECT NAME=\"edit[section]\">$options</SELECT><P>\n"; + + $output .= "<B>Abstract:</B><BR>\n"; + $output .= "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"10\" NAME=\"edit[abstract]\">". check_textarea($story->abstract) ."</TEXTAREA><BR>\n"; + $output .= "<SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL><P>\n"; + + $output .= "<B>Editor's note/updates:</B><BR>\n"; + $output .= "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"10\" NAME=\"edit[updates]\">". check_textarea($story->updates) ."</TEXTAREA><BR>\n"; + $output .= "<SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL><P>\n"; + + $output .= "<B>Extended story:</B><BR>\n"; + $output .= "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"15\" NAME=\"edit[article]\">". check_textarea($story->article) ."</TEXTAREA><BR>\n"; + $output .= "<SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL><P>\n"; + + $output .= "<B>Status:</B><BR>\n"; + $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"3\"". ($story->status == 3 ? " CHECKED" : "") .">scheduled story for <INPUT TYPE=\"text\" NAME=\"edit[date]\" SIZE=\"30\" VALUE=\"". date("j F Y G:i", $story->timestamp) ."\"><BR>\n"; + $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"2\"". ($story->status == 2 ? " CHECKED" : "") .">posted story<BR>\n"; + $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"1\"". ($story->status == 1 ? " CHECKED" : "") .">queued story<BR>\n"; + $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"0\"". ($story->status == 0 ? " CHECKED" : "") .">dumped story<BR>\n"; + $output .= "<SMALL><I>The textfield for scheduled stories expects a string containing an English date format of when you want to have your story automatically published.<BR>Example input: '". date("j F Y G:i") ."', '". date("m/d/y H:i") ."', '". date("F j, Y H:i") ."', ...</I></SMALL><P>\n"; + + $output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save story\">\n"; $output .= "</FORM>\n"; print $output; diff --git a/modules/story/story.module b/modules/story/story.module index 535821ccd..641c1ed3b 100644 --- a/modules/story/story.module +++ b/modules/story/story.module @@ -112,55 +112,36 @@ function story_edit($id) { $output .= "<FORM ACTION=\"admin.php?mod=story&id=$id\" METHOD=\"post\">\n"; - $output .= "<P>\n"; - $output .= " <B>Author:</B><BR>\n"; - $output .= " ". format_username($story->userid) ."\n"; - $output .= "</P>\n"; - - $output .= "<P>\n"; - $output .= " <B>Subject:</B><BR>\n"; - $output .= " <INPUT TYPE=\"text\" NAME=\"edit[subject]\" SIZE=\"50\" VALUE=\"". check_textfield($story->subject) ."\"><BR>\n"; - $output .= "</P>\n"; - - $output .= "<P>\n"; - $output .= " <B>Section:</B><BR>\n"; - $output .= " <SELECT NAME=\"edit[section]\">\n"; - foreach ($sections = section_get() as $value) { - $output .= " <OPTION VALUE=\"$value\"". ($story->section == $value ? " SELECTED" : "") .">$value</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=\"edit[abstract]\">". check_textarea($story->abstract) ."</TEXTAREA><BR>\n"; - $output .= " <SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL>\n"; - $output .= "</P>\n"; - - $output .= "<P>\n"; - $output .= " <B>Editor's note/updates:</B><BR>\n"; - $output .= " <TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"10\" NAME=\"edit[updates]\">". check_textarea($story->updates) ."</TEXTAREA><BR>\n"; - $output .= " <SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</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=\"edit[article]\">". check_textarea($story->article) ."</TEXTAREA><BR>\n"; - $output .= " <SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL>\n"; - $output .= "</P>\n"; - - $output .= "<P>\n"; - $output .= " <B>Status:</B><BR>\n"; - $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"3\"". ($story->status == 3 ? " CHECKED" : "") .">scheduled story for <INPUT TYPE=\"text\" NAME=\"edit[date]\" SIZE=\"30\" VALUE=\"". date("j F Y G:i", $story->timestamp) ."\"><BR>\n"; - $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"2\"". ($story->status == 2 ? " CHECKED" : "") .">posted story<BR>\n"; - $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"1\"". ($story->status == 1 ? " CHECKED" : "") .">queued story<BR>\n"; - $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"0\"". ($story->status == 0 ? " CHECKED" : "") .">dumped story<BR>\n"; - $output .= " <SMALL><I>The textfield for scheduled stories expects a string containing an English date format of when you want to have your story automatically published.<BR>Example input: '". date("j F Y G:i") ."', '". date("m/d/y H:i") ."', '". date("F j, Y H:i") ."', ...</I></SMALL>\n"; - $output .= "</P>\n"; - - $output .= "<P>\n"; - $output .= " <INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save story\">\n"; - $output .= "</P>\n"; + $output .= "<B>Author:</B><BR>\n"; + $output .= format_username($story->userid) ."<P>\n"; + + $output .= "<B>Subject:</B><BR>\n"; + $output .= "<INPUT TYPE=\"text\" NAME=\"edit[subject]\" SIZE=\"50\" MAXLENGTH=\"60\" VALUE=\"". check_textfield($story->subject) ."\"><P>\n"; + + $output .= "<B>Section:</B><BR>\n"; + foreach ($sections = section_get() as $value) $options .= " <OPTION VALUE=\"$value\"". ($story->section == $value ? " SELECTED" : "") .">$value</OPTION>\n"; + $output .= "<SELECT NAME=\"edit[section]\">$options</SELECT><P>\n"; + + $output .= "<B>Abstract:</B><BR>\n"; + $output .= "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"10\" NAME=\"edit[abstract]\">". check_textarea($story->abstract) ."</TEXTAREA><BR>\n"; + $output .= "<SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL><P>\n"; + + $output .= "<B>Editor's note/updates:</B><BR>\n"; + $output .= "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"10\" NAME=\"edit[updates]\">". check_textarea($story->updates) ."</TEXTAREA><BR>\n"; + $output .= "<SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL><P>\n"; + + $output .= "<B>Extended story:</B><BR>\n"; + $output .= "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"15\" NAME=\"edit[article]\">". check_textarea($story->article) ."</TEXTAREA><BR>\n"; + $output .= "<SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL><P>\n"; + + $output .= "<B>Status:</B><BR>\n"; + $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"3\"". ($story->status == 3 ? " CHECKED" : "") .">scheduled story for <INPUT TYPE=\"text\" NAME=\"edit[date]\" SIZE=\"30\" VALUE=\"". date("j F Y G:i", $story->timestamp) ."\"><BR>\n"; + $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"2\"". ($story->status == 2 ? " CHECKED" : "") .">posted story<BR>\n"; + $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"1\"". ($story->status == 1 ? " CHECKED" : "") .">queued story<BR>\n"; + $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"0\"". ($story->status == 0 ? " CHECKED" : "") .">dumped story<BR>\n"; + $output .= "<SMALL><I>The textfield for scheduled stories expects a string containing an English date format of when you want to have your story automatically published.<BR>Example input: '". date("j F Y G:i") ."', '". date("m/d/y H:i") ."', '". date("F j, Y H:i") ."', ...</I></SMALL><P>\n"; + + $output .= "<INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Save story\">\n"; $output .= "</FORM>\n"; print $output; |