summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/locale.inc2
-rw-r--r--modules/story.module51
-rw-r--r--modules/story/story.module51
3 files changed, 37 insertions, 67 deletions
diff --git a/includes/locale.inc b/includes/locale.inc
index 85b03eccb..50d07a7dd 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -2,7 +2,7 @@
function locale_load() {
global $languages, $user;
- return ($user->language) ? $user->language : key($languages);
+ return ($user->id && $user->language) ? $user->language : key($languages);
}
function t($string) {
diff --git a/modules/story.module b/modules/story.module
index 822f1a7d7..47671033e 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -69,44 +69,29 @@ function story_add() {
$output .= "<FORM ACTION=\"admin.php?mod=story\" METHOD=\"post\">\n";
- $output .= "<P>\n";
- $output .= " <B>Subject:</B><BR>\n";
- $output .= " <INPUT TYPE=\"text\" NAME=\"edit[subject]\" SIZE=\"50\" MAXLENGTH=\"60\"><BR>\n";
- $output .= "</P>\n";
+ $output .= "<B>Subject:</B><BR>\n";
+ $output .= "<INPUT TYPE=\"text\" NAME=\"edit[subject]\" SIZE=\"50\" MAXLENGTH=\"60\"><BR>\n";
- $output .= "<P><B>Section:</B><BR>\n";
- $output .= " <SELECT NAME=\"edit[section]\">\n";
- foreach ($sections = section_get() as $value) {
- $output .= " <OPTION VALUE=\"$value\">$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]\" MAXLENGTH=\"20\"></TEXTAREA><BR>\n";
- $output .= " <SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL>\n";
- $output .= "</P>\n";
+ $output .= "<B>Section:</B><BR>\n";
+ foreach ($sections = section_get() as $value) $options .= " <OPTION VALUE=\"$value\">$value</OPTION>\n";
+ $output .= "<SELECT NAME=\"edit[section]\">$options</SELECT><P>\n";
- $output .= "<P>\n";
- $output .= " <B>Extended story:</B><BR>\n";
- $output .= " <TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"15\" NAME=\"edit[article]\"></TEXTAREA><BR>\n";
- $output .= " <SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL>\n";
- $output .= "</P>\n";
+ $output .= "<B>Abstract:</B><BR>\n";
+ $output .= "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"10\" NAME=\"edit[abstract]\" MAXLENGTH=\"20\"></TEXTAREA><BR>\n";
+ $output .= "<SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL><P>\n";
- $output .= "<P>\n";
- $output .= " <B>Status:</B><BR>\n";
- $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"3\">scheduled story for <INPUT TYPE=\"text\" NAME=\"edit[date]\" SIZE=\"30\" VALUE=\"". date("j F Y G:i") ."\"><BR>\n";
- $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"2\">posted story<BR>\n";
- $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"1\" CHECKED>queued story<BR>\n";
- $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"0\">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 .= "<B>Extended story:</B><BR>\n";
+ $output .= "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"15\" NAME=\"edit[article]\"></TEXTAREA><BR>\n";
+ $output .= "<SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL><P>\n";
- $output .= "<P>\n";
- $output .= " <INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Add story\">\n";
- $output .= "</P>\n";
+ $output .= "<B>Status:</B><BR>\n";
+ $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"3\">scheduled story for <INPUT TYPE=\"text\" NAME=\"edit[date]\" SIZE=\"30\" VALUE=\"". date("j F Y G:i") ."\"><BR>\n";
+ $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"2\">posted story<BR>\n";
+ $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"1\" CHECKED>queued story<BR>\n";
+ $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"0\">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=\"Add story\">\n";
$output .= "</FORM>\n";
print $output;
diff --git a/modules/story/story.module b/modules/story/story.module
index 822f1a7d7..47671033e 100644
--- a/modules/story/story.module
+++ b/modules/story/story.module
@@ -69,44 +69,29 @@ function story_add() {
$output .= "<FORM ACTION=\"admin.php?mod=story\" METHOD=\"post\">\n";
- $output .= "<P>\n";
- $output .= " <B>Subject:</B><BR>\n";
- $output .= " <INPUT TYPE=\"text\" NAME=\"edit[subject]\" SIZE=\"50\" MAXLENGTH=\"60\"><BR>\n";
- $output .= "</P>\n";
+ $output .= "<B>Subject:</B><BR>\n";
+ $output .= "<INPUT TYPE=\"text\" NAME=\"edit[subject]\" SIZE=\"50\" MAXLENGTH=\"60\"><BR>\n";
- $output .= "<P><B>Section:</B><BR>\n";
- $output .= " <SELECT NAME=\"edit[section]\">\n";
- foreach ($sections = section_get() as $value) {
- $output .= " <OPTION VALUE=\"$value\">$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]\" MAXLENGTH=\"20\"></TEXTAREA><BR>\n";
- $output .= " <SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL>\n";
- $output .= "</P>\n";
+ $output .= "<B>Section:</B><BR>\n";
+ foreach ($sections = section_get() as $value) $options .= " <OPTION VALUE=\"$value\">$value</OPTION>\n";
+ $output .= "<SELECT NAME=\"edit[section]\">$options</SELECT><P>\n";
- $output .= "<P>\n";
- $output .= " <B>Extended story:</B><BR>\n";
- $output .= " <TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"15\" NAME=\"edit[article]\"></TEXTAREA><BR>\n";
- $output .= " <SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL>\n";
- $output .= "</P>\n";
+ $output .= "<B>Abstract:</B><BR>\n";
+ $output .= "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"10\" NAME=\"edit[abstract]\" MAXLENGTH=\"20\"></TEXTAREA><BR>\n";
+ $output .= "<SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL><P>\n";
- $output .= "<P>\n";
- $output .= " <B>Status:</B><BR>\n";
- $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"3\">scheduled story for <INPUT TYPE=\"text\" NAME=\"edit[date]\" SIZE=\"30\" VALUE=\"". date("j F Y G:i") ."\"><BR>\n";
- $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"2\">posted story<BR>\n";
- $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"1\" CHECKED>queued story<BR>\n";
- $output .= " <INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"0\">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 .= "<B>Extended story:</B><BR>\n";
+ $output .= "<TEXTAREA WRAP=\"virtual\" COLS=\"50\" ROWS=\"15\" NAME=\"edit[article]\"></TEXTAREA><BR>\n";
+ $output .= "<SMALL><I>Allowed HTML tags: ". htmlspecialchars($allowed_html) .".</I></SMALL><P>\n";
- $output .= "<P>\n";
- $output .= " <INPUT TYPE=\"submit\" NAME=\"op\" VALUE=\"Add story\">\n";
- $output .= "</P>\n";
+ $output .= "<B>Status:</B><BR>\n";
+ $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"3\">scheduled story for <INPUT TYPE=\"text\" NAME=\"edit[date]\" SIZE=\"30\" VALUE=\"". date("j F Y G:i") ."\"><BR>\n";
+ $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"2\">posted story<BR>\n";
+ $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"1\" CHECKED>queued story<BR>\n";
+ $output .= "<INPUT TYPE=\"radio\" NAME=\"edit[status]\" VALUE=\"0\">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=\"Add story\">\n";
$output .= "</FORM>\n";
print $output;