diff --git a/account.php b/account.php index e886b2c2b5f..65085f1f6ff 100644 --- a/account.php +++ b/account.php @@ -8,18 +8,18 @@ function account_get_user($uname) { } function account_email() { - $output .= "

Lost your password? Fill out your username and e-mail address, and your password will be mailed to you.

\n"; + $output .= "

". t("Lost your password? Fill out your username and e-mail address, and your password will be mailed to you.") ."

\n"; $output .= "
\n"; $output .= "

\n"; - $output .= " Username:
\n"; + $output .= " ". t("Username") .":
\n"; $output .= "
\n"; $output .= "

\n"; $output .= "

\n"; - $output .= " E-mail address:
\n"; + $output .= " ". t("E-mail address") .":
\n"; $output .= "
\n"; $output .= "

\n"; $output .= "

\n"; - $output .= " \n"; + $output .= " \n"; $output .= "

\n"; $output .= "
\n"; @@ -30,22 +30,16 @@ function account_create($user = "", $error = "") { global $theme; if ($error) $output .= "Failed to create account:$error\n"; - else $output .= "

Registering allows you to comment on stories, to moderate comments and pending stories, to customize the look and feel of the site and generally helps you interact with the site more efficiently.

To create an account, simply fill out this form an click the `Create account' button below. An e-mail will then be sent to you with instructions on how to validate your account.

\n"; + else $output .= "

". t("Registering allows you to comment on stories, to moderate comments and pending stories, to customize the look and feel of the site and generally helps you interact with the site more efficiently.") ."

". t("To create an account, simply fill out this form an click the 'Create account' button below. An e-mail will then be sent to you with instructions on how to validate your account.") ."

\n"; $output .= "
\n"; - $output .= "

\n"; - $output .= " Username:
\n"; - $output .= "
\n"; - $output .= " Enter your desired username: only letters, numbers and common special characters are allowed.
\n"; - $output .= "

\n"; - $output .= "

\n"; - $output .= " E-mail address:
\n"; - $output .= "
\n"; - $output .= " You will be sent instructions on how to validate your account via this e-mail address - please make sure it is accurate.
\n"; - $output .= "

\n"; - $output .= "

\n"; - $output .= " \n"; - $output .= "

\n"; + $output .= "". t("Username") .":
\n"; + $output .= "
\n"; + $output .= "". t("Enter your desired username: only letters, numbers and common special characters are allowed.") ."

\n"; + $output .= "". t("E-mail address") .":
\n"; + $output .= "
\n"; + $output .= "". t("You will be sent instructions on how to validate your account via this e-mail address - please make sure it is accurate.") ."

\n"; + $output .= "\n"; $output .= "

\n"; return $output; @@ -78,42 +72,42 @@ function account_user_edit() { if ($user->id) { // Generate output/content: $output .= "
\n"; - $output .= "Username:
\n"; + $output .= "". t("Username") .":
\n"; $output .= "  $user->userid

\n"; - $output .= "Required, unique, and can not be changed.

\n"; - $output .= "Real name:
\n"; + $output .= "". t("Required, unique, and can not be changed.") ."

\n"; + $output .= "". t("Real name") .":
\n"; $output .= "name\">
\n"; - $output .= "Optional.

\n"; - $output .= "Real e-mail address:
\n"; + $output .= "". t("Optional.") ."

\n"; + $output .= "". t("Real e-mail address") .":
\n"; $output .= "  $user->real_email

\n"; - $output .= "Required, unique, can not be changed and is never displayed publicly: only needed in case you lose your password.

\n"; - $output .= "Fake e-mail address:
\n"; + $output .= "". t("Required, unique, can not be changed.") ." ". t("Your real e-mail address is never displayed publicly: only needed in case you lose your password.") ."

\n"; + $output .= "". t("Fake e-mail address") .":
\n"; $output .= "fake_email\">
\n"; - $output .= "Optional, and displayed publicly. You may spam proof your real e-mail address if you want.

\n"; - $output .= "URL of homepage:
\n"; + $output .= "". t("Optional.") ." ". t("Displayed publicly so you may spam proof your real e-mail address if you want.") ."

\n"; + $output .= "". t("Homepage") .":
\n"; $output .= "url\">
\n"; - $output .= "Optional, but make sure you enter fully qualified URLs only. That is, remember to include \"http://\".

\n"; - $output .= "Bio: (255 char. limit)
\n"; + $output .= "". t("Optional.") ." ". t("Make sure you enter fully qualified URLs only. That is, remember to include \"http://\".") ."

\n"; + $output .= "". t("Bio") .": (". t("maximal 255 characters") .")
\n"; $output .= "
\n"; - $output .= "Optional. This biographical information is publicly displayed on your user page.
Allowed HTML tags: ". htmlspecialchars($allowed_html) .".

\n"; - $output .= "Signature: (255 char. limit)
\n"; + $output .= "". t("Optional.") ." ". t("This biographical information is publicly displayed on your user page.") ."
". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".

\n"; + $output .= "". t("Signature") .": (". t("maximal 255 characters") .")
\n"; $output .= "
\n"; - $output .= "Optional. This information will be publicly displayed at the end of your comments.
Allowed HTML tags: ". htmlspecialchars($allowed_html) .".

\n"; - $output .= "Password:
\n"; + $output .= "". t("Optional.") ." ". t("This information will be publicly displayed at the end of your comments.") ."
". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".

\n"; + $output .= "". t("Password") .":
\n"; $output .= "
\n"; - $output .= "Enter your new password twice if you want to change your current password or leave it blank if you are happy with your current password.

\n"; + $output .= "". t("Enter your new password twice if you want to change your current password or leave it blank if you are happy with your current password.") ."

\n"; $output .= "
\n"; $output .= "

\n"; // Display output/content: $theme->header(); - $theme->box("Edit user information", $output); + $theme->box(t("Edit user information"), $output); $theme->footer(); } else { $theme->header(); - $theme->box("Create user account", account_create()); - $theme->box("E-mail password", account_email()); + $theme->box(t("Create user account"), account_create()); + $theme->box(t("E-mail new password"), account_email()); $theme->footer(); } } @@ -139,52 +133,40 @@ function account_site_edit() { if ($user->id) { $output .= "
\n"; - $output .= "Theme:
\n"; - foreach ($themes as $key=>$value) { - $options1 .= " \n"; - } + $output .= "". t("Theme" ) .":
\n"; + foreach ($themes as $key=>$value) $options1 .= " \n"; $output .= "
\n"; - $output .= "Selecting a different theme will change the look and feel of the site.

\n"; - $output .= "Timezone:
\n"; + $output .= "". t("Selecting a different theme will change the look and feel of the site.") ."

\n"; + $output .= "". t("Timezone") .":
\n"; $date = time() - date("Z"); - for ($zone = -43200; $zone <= 46800; $zone += 3600) { - $options2 .= " \n"; - } + for ($zone = -43200; $zone <= 46800; $zone += 3600) $options2 .= " \n"; $output .= "
\n"; - $output .= "Select what time you currently have and your timezone settings will be set appropriate.

\n"; - $output .= "Maximum number of stories:
\n"; - for ($stories = 10; $stories <= 30; $stories += 5) { - $options3 .= "\n"; - } + $output .= "". t("Select what time you currently have and your timezone settings will be set appropriate.") ."

\n"; + $output .= "". t("Maximum number of stories to display") .":
\n"; + for ($stories = 10; $stories <= 30; $stories += 5) $options3 .= "\n"; $output .= "
\n"; - $output .= "The maximum number of stories that will be displayed on the main page.

\n"; - foreach ($cmodes as $key=>$value) { - $options4 .= "\n"; - } - $output .= "Comment display mode:
\n"; + $output .= "". t("The maximum number of stories that will be displayed on the main page.") ."

\n"; + foreach ($cmodes as $key=>$value) $options4 .= "\n"; + $output .= "". t("Comment display mode") .":
\n"; $output .= "

\n"; - foreach ($corder as $key=>$value) { - $options5 .= "\n"; - } - $output .= "Comment sort order:
\n"; + foreach ($corder as $key=>$value) $options5 .= "\n"; + $output .= "". t("Comment sort order") .":
\n"; $output .= "

\n"; - for ($i = -1; $i < 6; $i++) { - $options6 .= " "; - } - $output .= "Comment filter:
\n"; + for ($i = -1; $i < 6; $i++) $options6 .= " "; + $output .= "". t("Comment filter") .":
\n"; $output .= "
\n"; - $output .= "Comments that scored less than this threshold setting will be ignored. Anonymous comments start at 0, comments of people logged on start at 1 and moderators can add and subtract points.

\n"; + $output .= "". t("Comments that scored less than this threshold setting will be ignored. Anonymous comments start at 0, comments of people logged on start at 1 and moderators can add and subtract points.") ."

\n"; $output .= "
\n"; $output .= "

\n"; $theme->header(); - $theme->box("Edit your preferences", $output); + $theme->box(t("Edit your preferences"), $output); $theme->footer(); } else { $theme->header(); - $theme->box("Create user account", account_create()); - $theme->box("E-mail password", account_email()); + $theme->box(t("Create user account"), account_create()); + $theme->box(t("E-mail new password"), account_email()); $theme->footer(); } } @@ -208,27 +190,24 @@ function account_content_edit() { if ($user->id) { $output .= "
\n"; - - $output .= "Blocks in side bars:
\n"; - + $output .= "". t("Blocks in side bars") .":
\n"; $result = db_query("SELECT * FROM blocks WHERE status = 1 ORDER BY module"); while ($block = db_fetch_object($result)) { $entry = db_fetch_object(db_query("SELECT * FROM layout WHERE block = '$block->name' AND user = '$user->id'")); - $output .= "name]\"". ($entry->user ? " CHECKED" : "") ."> $block->name
\n"; + $output .= "name]\"". ($entry->user ? " CHECKED" : "") ."> ". t($block->name) ."
\n"; } - - $output .= "

Enable the blocks you would like to see displayed in the side bars.

\n"; + $output .= "

". t("Enable the blocks you would like to see displayed in the side bars.") ."

\n"; $output .= "

\n"; $output .= "
\n"; $theme->header(); - $theme->box("Edit your content", $output); + $theme->box(t("Edit your content"), $output); $theme->footer(); } else { $theme->header(); - $theme->box("Create user account", account_create()); - $theme->box("E-mail password", account_email()); + $theme->box(t("Create user account"), account_create()); + $theme->box(t("E-mail new password"), account_email()); $theme->footer(); } } @@ -255,11 +234,11 @@ function account_user($uname) { if ($user->id && $user->userid == $uname) { $output .= "\n"; - $output .= " \n"; - $output .= " \n"; - $output .= " \n"; - $output .= " \n"; - $output .= " \n"; + $output .= " \n"; + $output .= " \n"; + $output .= " \n"; + $output .= " \n"; + $output .= " \n"; $output .= "
Username:$user->userid
E-mail:". format_email($user->fake_email) ."
Homepage:". format_url($user->url) ."
Bio:". format_data($user->bio) ."
Signature:". format_data($user->signature) ."
". t("Username") .":$user->userid
". t("E-mail") .":". format_email($user->fake_email) ."
". t("Homepage") .":". format_url($user->url) ."
". t("Bio") .":". check_output($user->bio) ."
". t("Signature") .":". check_output($user->signature) ."
\n"; // Display account information: @@ -269,18 +248,18 @@ function account_user($uname) { } elseif ($uname && $account = account_get_user($uname)) { $block1 .= "\n"; - $block1 .= " \n"; - $block1 .= " \n"; - $block1 .= " \n"; - $block1 .= " \n"; + $block1 .= " \n"; + $block1 .= " \n"; + $block1 .= " \n"; + $block1 .= " \n"; $block1 .= "
Username:$account->userid
E-mail:". format_email($account->fake_email) ."
URL:". format_url($account->url) ."
Bio:". format_data($account->bio) ."
". t("Username") .":$account->userid
". t("E-mail") .":". format_email($account->fake_email) ."
". t("Homepage") .":". format_url($account->url) ."
". t("Bio") .":". check_output($account->bio) ."
\n"; $result = db_query("SELECT c.cid, c.pid, c.lid, c.subject, c.timestamp, s.subject AS story FROM comments c LEFT JOIN users u ON u.id = c.author LEFT JOIN stories s ON s.id = c.lid WHERE u.userid = '$uname' AND s.status = 2 AND c.link = 'story' AND s.timestamp > ". (time() - 1209600) ." ORDER BY cid DESC LIMIT 10"); while ($comment = db_fetch_object($result)) { $block2 .= "\n"; - $block2 .= " \n"; - $block2 .= " \n"; - $block2 .= " \n"; + $block2 .= " \n"; + $block2 .= " \n"; + $block2 .= " \n"; $block2 .= "
Comment:lid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">". check_output($comment->subject) ."
Date:". format_date($comment->timestamp) ."
Story:lid\">". check_output($comment->story) ."
". t("Comment") .":lid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">". check_output($comment->subject) ."
". t("Date") .":". format_date($comment->timestamp) ."
". t("Story") .":lid\">". check_output($comment->story) ."
\n"; $block2 .= "

\n"; $comments++; @@ -288,16 +267,16 @@ function account_user($uname) { // Display account information: $theme->header(); - if ($block1) $theme->box("User information for $uname", $block1); - if ($block2) $theme->box("$uname has posted ". format_plural($comments, "comment", "comments") ." recently", $block2); + if ($block1) $theme->box(strtr(t("%s's user information"), array("%s" => $uname)), $block1); + if ($block2) $theme->box(strtr(t("%a has posted %b recently"), array("%a" => $uname, "%b" => format_plural($comments, "comment", "comments"))), $block2); module_iterate("module", $uname); $theme->footer(); } else { // Display login form: $theme->header(); - $theme->box("Create user account", account_create()); - $theme->box("E-mail password", account_email()); + $theme->box(t("Create user account"), account_create()); + $theme->box(t("E-mail new password"), account_email()); $theme->footer(); } } @@ -306,17 +285,17 @@ function account_validate($user) { global $type2index; // Verify username and e-mail address: - if (empty($user[real_email]) || (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $user[real_email]))) $error .= "

  • the specified e-mail address is not valid.
  • \n"; - if (empty($user[userid]) || (ereg("[^a-zA-Z0-9_-]", $user[userid]))) $error .= "
  • the specified username is not valid.
  • \n"; - if (strlen($user[userid]) > 15) $error .= "
  • the specified username is too long: it must be less than 15 characters.
  • \n"; + if (empty($user[real_email]) || (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $user[real_email]))) $error .= "
  • ". t("the specified e-mail address is not valid") .".
  • \n"; + if (empty($user[userid]) || (ereg("[^a-zA-Z0-9_-]", $user[userid]))) $error .= "
  • ". t("the specified username is not valid") .".
  • \n"; + if (strlen($user[userid]) > 15) $error .= "
  • ". t("the specified username is too long: it must be less than 15 characters") .".
  • \n"; // Check to see whether the username or e-mail address are banned: - if ($ban = ban_match($user[userid], $type2index[usernames])) $error .= "
  • the specified username is banned for the following reason: $ban->reason.
  • \n"; - if ($ban = ban_match($user[real_email], $type2index[addresses])) $error .= "
  • the specified e-mail address is banned for the following reason: $ban->reason.
  • \n"; + if ($ban = ban_match($user[userid], $type2index[usernames])) $error .= "
  • ". t("the specified username is banned for the following reason") .": $ban->reason.
  • \n"; + if ($ban = ban_match($user[real_email], $type2index[addresses])) $error .= "
  • ". t("the specified e-mail address is banned for the following reason") .": $ban->reason.
  • \n"; // Verify whether username and e-mail address are unique: - if (db_num_rows(db_query("SELECT userid FROM users WHERE LOWER(userid) = LOWER('$user[userid]')")) > 0) $error .= "
  • the specified username is already taken.
  • \n"; - if (db_num_rows(db_query("SELECT real_email FROM users WHERE LOWER(real_email)=LOWER('$user[real_email]')")) > 0) $error .= "
  • the specified e-mail address is already registered.
  • \n"; + if (db_num_rows(db_query("SELECT userid FROM users WHERE LOWER(userid) = LOWER('$user[userid]')")) > 0) $error .= "
  • ". t("the specified username is already taken") .".
  • \n"; + if (db_num_rows(db_query("SELECT real_email FROM users WHERE LOWER(real_email)=LOWER('$user[real_email]')")) > 0) $error .= "
  • ". t("the specified e-mail address is already registered") .".
  • \n"; return $error; } @@ -328,8 +307,8 @@ function account_email_submit($userid, $email) { if ($account = db_fetch_object($result)) { $passwd = account_password(); - $status = 1; $hash = substr(md5("$userid. ". time() .""), 0, 12); + $status = 1; db_query("UPDATE users SET passwd = PASSWORD('$passwd'), hash = '$hash', status = '$status' WHERE userid = '$userid'"); @@ -344,11 +323,11 @@ function account_email_submit($userid, $email) { } else { watchdog("warning", "new password: '$userid' and <$email> do not match"); - $output = "Could not sent password: no match for the specified username and e-mail address."; + $output = t("Could not sent password: no match for the specified username and e-mail address."); } $theme->header(); - $theme->box("E-mail password", $output); + $theme->box(t("E-mail new password"), $output); $theme->footer(); } @@ -360,7 +339,7 @@ function account_create_submit($userid, $email) { if ($error = account_validate($new)) { $theme->header(); - $theme->box("Create user account", account_create($new, $error)); + $theme->box(t("Create user account"), account_create($new, $error)); $theme->footer(); } else { @@ -378,7 +357,7 @@ function account_create_submit($userid, $email) { mail($new[real_email], "Account details for $site_name", $message, "From: noreply"); $theme->header(); - $theme->box("Create user account", "Congratulations! Your member account has been successfully created and further instructions on how to activate your account have been sent to your e-mail address."); + $theme->box(t("Create user account"), t("Congratulations! Your member account has been successfully created and further instructions on how to activate your account have been sent to your e-mail address.")); $theme->footer(); } } @@ -411,7 +390,7 @@ function account_create_confirm($name, $hash) { } $theme->header(); - $theme->box("Account confirmation", $output); + $theme->box(t("Create user account"), $output); $theme->footer(); } @@ -428,20 +407,18 @@ function account_track_comments() { $sresult = db_query("SELECT s.id, s.subject, COUNT(s.id) as count FROM comments c LEFT JOIN stories s ON c.lid = s.id WHERE c.author = $user->id GROUP BY s.id DESC LIMIT 5"); while ($story = db_fetch_object($sresult)) { - $output .= "
  • ". format_plural($story->count, comment, comments) ." attached to story `id\">". check_output($story->subject) ."`:
  • \n"; + $output .= "
  • ". format_plural($story->count, "comment", "comments") ." ". t("attached to story") ." `id\">". check_output($story->subject) ."`:
  • \n"; $output .= " \n"; } - $output = ($output) ? "$output" : "$info
    You have not posted any comments recently.
    \n"; - $theme->header(); - $theme->box("Track your comments", $output); + $theme->box(t("Track your comments"), ($output ? $output : t("You have not posted any comments recently."))); $theme->footer(); } @@ -452,15 +429,15 @@ function account_track_stories() { while ($story = db_fetch_object($result)) { $output .= "\n"; - $output .= " \n"; - $output .= " \n"; - $output .= " \n"; + $output .= " \n"; + $output .= " \n"; + $output .= " \n"; $output .= "
    Subject:id\">". check_output($story->subject) ." (". format_plural($story->count, "comment", "comments") .")
    Section:section) ."\">". check_output($story->section) ."
    Date:". format_date($story->timestamp) ."
    ". t("Subject") .":id\">". check_output($story->subject) ." (". format_plural($story->count, "comment", "comments") .")
    ". t("Section") .":section) ."\">". check_output($story->section) ."
    ". t("Date") .":". format_date($story->timestamp) ."
    \n"; $output .= "

    \n"; } $theme->header(); - $theme->box("Track your stories", ($output ? "$output" : "You have not posted any stories.\n")); + $theme->box(t("Track your stories"), ($output ? $output : t("You have not posted any stories."))); $theme->footer(); } @@ -471,18 +448,18 @@ function account_track_site() { $sresult = db_query("SELECT s.subject, s.id, COUNT(c.lid) AS count FROM comments c LEFT JOIN stories s ON c.lid = s.id WHERE s.status = 2 AND c.link = 'story' AND ". time() ." - c.timestamp < $period GROUP BY c.lid ORDER BY count DESC LIMIT 10"); while ($story = db_fetch_object($sresult)) { - $output .= "

  • ". format_plural($story->count, "new comment", "new comments") ." attached to story 'id\">". check_output($story->subject) ."':
  • "; + $output .= "
  • ". format_plural($story->count, "comment", "comments") ." ". t("attached to story") ." 'id\">". check_output($story->subject) ."':
  • "; $cresult = db_query("SELECT c.subject, c.cid, c.pid, u.userid FROM comments c LEFT JOIN users u ON u.id = c.author WHERE c.lid = $story->id AND c.link = 'story' ORDER BY timestamp DESC LIMIT $story->count"); $output .= "\n"; } $theme->header(); - $theme->box("Track $site_name", $output); + $theme->box(t("Track $site_name"), $output); $theme->footer(); } @@ -497,7 +474,7 @@ switch ($op) { account_session_start($userid, $passwd); header("Location: account.php?op=info"); break; - case "E-mail password": + case "E-mail new password": account_email_submit($userid, $email); break; case "Create account": diff --git a/database/database.mysql b/database/database.mysql index 5379879007e..e90fa0109cd 100644 --- a/database/database.mysql +++ b/database/database.mysql @@ -108,6 +108,12 @@ CREATE TABLE layout ( block varchar(64) DEFAULT '' NOT NULL ); +CREATE TABLE locales ( + id int(11) DEFAULT '0' NOT NULL auto_increment, + english TEXT DEFAULT '' NOT NULL, + PRIMARY KEY (id) +); + CREATE TABLE modules ( name varchar(64) DEFAULT '' NOT NULL, PRIMARY KEY (name) diff --git a/includes/comment.inc b/includes/comment.inc index 4f9ee3ac501..dcd4557eb32 100644 --- a/includes/comment.inc +++ b/includes/comment.inc @@ -205,7 +205,7 @@ function comment_moderation($comment) { $output .= "\n"; } else { - $output .= "
    score:". format_data($comment->score) ."
    votes:". format_data($comment->votes) ."
    \n"; + $output .= "
    score:". check_output($comment->score) ."
    votes:". check_output($comment->votes) ."
    \n"; } return $output; diff --git a/includes/function.inc b/includes/function.inc index c8b027934fe..1305d4b96c4 100644 --- a/includes/function.inc +++ b/includes/function.inc @@ -1,5 +1,7 @@ na"; + function check_textfield($message) { global $allowed_html; return strip_tags(str_replace("\"", """, stripslashes($message)), $allowed_html); @@ -20,13 +22,16 @@ function check_code($message) { } function check_output($message, $nl2br = 0) { - global $allowed_html; - if ($nl2br == 1) return nl2br(strip_tags(stripslashes($message), $allowed_html)); - else return strip_tags(stripslashes($message), $allowed_html); + global $allowed_html, $na; + if ($message) { + if ($nl2br == 1) return nl2br(strip_tags(stripslashes($message), $allowed_html)); + else return strip_tags(stripslashes($message), $allowed_html); + } + else return $na; } function format_plural($count, $singular, $plural) { - return ($count == 1) ? "$count $singular" : "$count $plural"; + return ($count == 1) ? "$count ". t($singular) : "$count ". t($plural); } function format_interval($timestamp) { @@ -72,9 +77,6 @@ function format_date($timestamp, $type = "medium") { return $date; } -function format_data($field, $replacement = "na") { - return ($field) ? $field : $replacement; -} function format_username($username) { global $user; @@ -83,16 +85,14 @@ function format_username($username) { } function format_email($address) { - return ($address) ? "$address" : format_data($address); + global $na; + return ($address) ? "$address" : $na; } function format_url($address, $description = "") { - // POSSIBLE EXTENSIONS: - // 1. add `http://' in case it's missing. - // 2. add a trailing `/' in case it's missing. - // 3. remove any parameters in the URI. + global $na; $description = ($description) ? $description : $address; - return ($address) ? "$description" : format_data($address); + return ($address) ? "$description" : $na; } ?> diff --git a/includes/locale.inc b/includes/locale.inc index 6fd51a5a636..ab0a49eb5da 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -1,6 +1,8 @@ Your search yielded no results:

    \n"; + $output .= t("Your search yielded no results."); } return $output; diff --git a/includes/theme.inc b/includes/theme.inc index 35573ecb8de..57b2f7d29ad 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -30,15 +30,13 @@ function theme_account($theme) { module_iterate("menu"); // Display account settings: - $content .= "
  • track your comments
  • \n"; - $content .= "
  • track your stories
  • \n"; - $content .= "
  • track $site_name
  • \n"; + $content .= "
  • ". t("track your comments") ."
  • \n"; + $content .= "
  • ". t("track your stories") ."
  • \n"; + $content .= "
  • ". t("track") ." $site_name
  • \n"; $content .= "

    \n"; - $content .= "

  • submission queue (". submission_number() .")
  • \n"; - $content .= "

    \n"; - $content .= "

  • edit your information
  • \n"; - $content .= "
  • edit your preferences
  • \n"; - $content .= "
  • edit your content
  • \n"; + $content .= "
  • ". t("edit your information") ."
  • \n"; + $content .= "
  • ". t("edit your preferences") ."
  • \n"; + $content .= "
  • ". t("edit your content") ."
  • \n"; $content .= "

    \n"; if (user_permission($user)) { @@ -46,26 +44,29 @@ function theme_account($theme) { $content .= "

    \n"; } + $content .= "

  • ". t("submission queue") ." (". submission_number() .")
  • \n"; + $content .= "

    \n"; + if ($menu && ksort($menu)) { - foreach ($menu as $link=>$url) $content .= "

  • $link
  • \n"; + foreach ($menu as $link=>$url) $content .= "
  • ". t($link) ."
  • \n"; $content .= "

    \n"; } - $content .= "

  • logout
  • \n"; + $content .= "
  • ". t("logout") ."
  • \n"; - $theme->box("$user->userid's configuration", "$content"); + $theme->box(strtr(t("%s's configuration"), array("%s" => $user->userid)), "$content"); } else { $output .= "
    \n"; $output .= "
    \n"; - $output .= "

    Username:

    \n"; - $output .= "

    Password:

    \n"; + $output .= "

    ". t("Username") .":

    \n"; + $output .= "

    ". t("Password") .":

    \n"; $output .= "

    \n"; - $output .= "

    REGISTER

    \n"; + $output .= "

    ". t("REGISTER") ."

    \n"; $output .= "
    \n"; $output .= "
    \n"; - $theme->box("Login", $output); + $theme->box(t("Login"), $output); } } @@ -84,7 +85,7 @@ function theme_blocks($region, $theme) { else $result = db_query("SELECT * FROM blocks WHERE status = 2 ORDER BY weight"); while ($block = db_fetch_object($result)) { $blocks = module_execute($block->module, "block"); - $theme->box($blocks[$block->offset]["subject"], $blocks[$block->offset]["content"]); + $theme->box(t($blocks[$block->offset]["subject"]), $blocks[$block->offset]["content"]); } break; } diff --git a/includes/timer.inc b/includes/timer.inc new file mode 100644 index 00000000000..39034a297df --- /dev/null +++ b/includes/timer.inc @@ -0,0 +1,17 @@ +execution time: $diff ms"; +} + +function timer_start() { + global $timer; + $timer = explode(" ", microtime()); +} + +?> \ No newline at end of file diff --git a/modules/account.module b/modules/account.module index 84c537f6d8b..26466e6b54b 100644 --- a/modules/account.module +++ b/modules/account.module @@ -10,6 +10,7 @@ $module = array("cron" => "account_cron", function account_cron_ratings() { $period = 5184000; // 60 days $number = 30; // 30 comments + $offset = 5; // 5 comments $r1 = db_query("SELECT id, userid FROM users"); while ($account = db_fetch_object($r1)) { @@ -27,7 +28,7 @@ function account_cron_ratings() { $votes += $weight * $comment->votes; } - if ($weight > 5 && $votes > 0) { + if ($weight >= $offset && $votes > 0) { $value = ($score + $weight) / $votes + $bonus; db_query("UPDATE users SET rating = '$value' WHERE id = $account->id"); } @@ -121,7 +122,7 @@ function account_display($order = "username") { $output .= " ". $perm[$account[$value]] ."\n"; break; case "timezone": - $output .= " ". format_data($account[$value] / 3600) ."\n"; + $output .= " ". check_output($account[$value] / 3600) ."\n"; break; case "url": $output .= " ". format_url($account[$value]) ."\n"; @@ -130,7 +131,7 @@ function account_display($order = "username") { $output .= " ". format_username($account[$value]) ."\n"; break; default: - $output .= " ". format_data($account[$value]) ."\n"; + $output .= " ". check_output($account[$value]) ."\n"; } } $output .= " viewedit\n"; @@ -144,7 +145,7 @@ function account_display($order = "username") { function account_blocks($id) { $result = db_query("SELECT * FROM layout WHERE user = $id"); while ($layout = db_fetch_object($result)) { - $output .= "
  • ". check_output($layout->block) ."
  • \n"; + $output .= "
  • $layout->block
  • \n"; } return $output; } @@ -152,7 +153,7 @@ function account_blocks($id) { function account_stories($id) { $result = db_query("SELECT * FROM stories WHERE author = $id ORDER BY timestamp DESC"); while ($story = db_fetch_object($result)) { - $output .= "
  • id\">". check_output($story->subject) ."
  • \n"; + $output .= "
  • id\">$story->subject
  • \n"; } return $output; } @@ -160,7 +161,7 @@ function account_stories($id) { function account_comments($id) { $result = db_query("SELECT * FROM comments WHERE link = 'story' AND author = $id ORDER BY timestamp DESC"); while ($comment = db_fetch_object($result)) { - $output .= "
  • lid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">". check_output($comment->subject) ."
  • \n"; + $output .= "
  • lid&cid=$comment->cid&pid=$comment->pid#$comment->cid\">$comment->subject
  • \n"; } return $output; } @@ -196,20 +197,20 @@ function account_edit($name) { $output .= " ID:$account->id\n"; $output .= " Status:$stat\n"; $output .= " Username:$account->userid\n"; - $output .= " Real name:". format_data($account->name) ."\n"; + $output .= " Real name:". check_output($account->name) ."\n"; $output .= " Real e-mail address:". format_email($account->real_email) ."\n"; $output .= " Fake e-mail address:fake_email\">\n"; $output .= " URL of homepage:url\">\n"; $output .= " Permissions:$perm\n"; - $output .= " Last access:". format_date($account->last_access) ." from ". format_data($account->last_host) ."\n"; - $output .= " User rating:". format_data($account->rating) ."\n"; + $output .= " Last access:". format_date($account->last_access) ." from ". check_output($account->last_host) ."\n"; + $output .= " User rating:". check_output($account->rating) ."\n"; $output .= " Bio information:\n"; $output .= " Signature:\n"; - $output .= " Theme:". format_data($account->theme) ."\n"; - $output .= " Timezone:". format_data($account->timezone / 3600) ."\n"; - $output .= " Selected blocks:". format_data(account_blocks($account->id)) ."\n"; - $output .= " Submitted stories:". format_data(account_stories($account->id)) ."\n"; - $output .= " Submitted comments:". format_data(account_comments($account->id)) ."\n"; + $output .= " Theme:". check_output($account->theme) ."\n"; + $output .= " Timezone:". check_output($account->timezone / 3600) ."\n"; + $output .= " Selected blocks:". check_output(account_blocks($account->id)) ."\n"; + $output .= " Submitted stories:". check_output(account_stories($account->id)) ."\n"; + $output .= " Submitted comments:". check_output(account_comments($account->id)) ."\n"; $output .= "\n"; $output .= "userid\">\n"; $output .= "\n"; @@ -229,20 +230,20 @@ function account_view($name) { $output .= " ID:userid\">$account->id\n"; $output .= " Status:". $status[$account->status] ."\n"; $output .= " Username:$account->userid\n"; - $output .= " Real name:". format_data($account->name) ."\n"; + $output .= " Real name:". check_output($account->name) ."\n"; $output .= " Real e-mail address:". format_email($account->real_email) ."\n"; - $output .= " Fake e-mail address:". format_data($account->fake_email) ."\n"; + $output .= " Fake e-mail address:". check_output($account->fake_email) ."\n"; $output .= " URL of homepage:". format_url($account->url) ."\n"; $output .= " Permissions:". $permissions[$account->permissions] ."\n"; - $output .= " Last access:". format_date($account->last_access) ." from ". format_data($account->last_host) ."\n"; - $output .= " User rating:". format_data($account->rating) ."\n"; - $output .= " Bio information:". format_data($account->bio) ."\n"; - $output .= " Signature:". format_data($account->signature) ."\n"; - $output .= " Theme:". format_data($account->theme) ."\n"; - $output .= " Timezone:". format_data($account->timezone / 3600) ."\n"; - $output .= " Selected blocks:". format_data(account_blocks($account->id)) ."\n"; - $output .= " Submitted stories:". format_data(account_stories($account->id)) ."\n"; - $output .= " Submitted comments:". format_data(account_comments($account->id)) ."\n"; + $output .= " Last access:". format_date($account->last_access) ." from ". check_output($account->last_host) ."\n"; + $output .= " User rating:". check_output($account->rating) ."\n"; + $output .= " Bio information:". check_output($account->bio) ."\n"; + $output .= " Signature:". check_output($account->signature) ."\n"; + $output .= " Theme:". check_output($account->theme) ."\n"; + $output .= " Timezone:". check_output($account->timezone / 3600) ."\n"; + $output .= " Selected blocks:". check_output(account_blocks($account->id)) ."\n"; + $output .= " Submitted stories:". check_output(account_stories($account->id)) ."\n"; + $output .= " Submitted comments:". check_output(account_comments($account->id)) ."\n"; $output .= "\n"; print "$output"; } @@ -254,7 +255,7 @@ function account_block() { $content .= "\n"; $content .= "\n"; while ($account = db_fetch_object($result)) { - $content .= ""; + $content .= ""; } $content .= "
    UsernameRating
    ". format_username($account->userid) ."". format_data($account->rating) ."
    ". format_username($account->userid) ."". check_output($account->rating) ."
    \n"; diff --git a/modules/affiliate-site.module b/modules/affiliate-site.module index 73fc01c836e..7b018107521 100644 --- a/modules/affiliate-site.module +++ b/modules/affiliate-site.module @@ -71,7 +71,7 @@ function affiliate_admin_display() { $output .= " namelinkcontactoperations\n"; while ($affiliate = db_fetch_object($result)) { - $output .= " $affiliate->name". format_url($affiliate->link) ."". format_email($affiliate->contact) ."id\">delete\n"; + $output .= " ". check_output($affiliate->name) ."". format_url($affiliate->link) ."". format_email($affiliate->contact) ."id\">delete\n"; } $output .= " \n"; diff --git a/modules/box.module b/modules/box.module index d516b686345..54d2e0b1cd8 100644 --- a/modules/box.module +++ b/modules/box.module @@ -55,10 +55,10 @@ function box_admin_display() { while ($block = db_fetch_object($result)) { $output .= "\n"; - $output .= " \n"; + $output .= " \n"; $output .= " \n"; $output .= " \n"; - $output .= " \n"; + $output .= " \n"; $output .= " \n"; $output .= " \n"; $output .= "
    Subject:". format_data($block->subject) ."
    Subject:". check_output($block->subject) ."
    Content:". nl2br(htmlentities($block->content)) ."
    Type:". $type[$block->type] ."
    Description:". format_data($block->info) ."
    Description:". check_output($block->info) ."
    Link:". format_url($block->link) ."
    Operations:id\">edit, id\">delete
    \n"; diff --git a/modules/diary.module b/modules/diary.module index 9eeeadae824..c4939bdcac5 100644 --- a/modules/diary.module +++ b/modules/diary.module @@ -33,23 +33,21 @@ function diary_page_overview($num = 20) { $result = db_query("SELECT d.*, u.userid FROM diaries d LEFT JOIN users u ON d.author = u.id ORDER BY d.timestamp DESC LIMIT $num"); - $output .= "

    This part of the website is dedicated to provide easy-to-write and easy-to-read online diaries or journals filled with daily thoughts, poetry, boneless blabber, spiritual theories, intimate details, valuable experiences, cynical rants, semi-coherent comments, writing experiments, artistic babblings, critics on current facts, fresh insights, diverse dreams, chronicles and mumbling madness available for public consumption.

    "; - while ($diary = db_fetch_object($result)) { if ($time != date("F jS", $diary->timestamp)) { $output .= "". date("l, F jS", $diary->timestamp) ."\n"; $time = date("F jS", $diary->timestamp); } $output .= "
    \n"; - $output .= "

    $diary->userid wrote:

    \n"; + $output .= "

    $diary->userid ". t("wrote") .":

    \n"; $output .= "
    \n"; - $output .= "

    ". check_output($diary->text, 1) ."

    [ userid\">more ]

    \n"; + $output .= "

    ". check_output($diary->text, 1) ."

    [ userid\">". t("more") ." ]

    \n"; $output .= "
    \n"; $output .= "
    \n"; } $theme->header(); - $theme->box("Online diary", $output); + $theme->box(t("Online diary"), $output); $theme->footer(); } @@ -58,7 +56,7 @@ function diary_page_entry($timestamp, $text, $id = 0) { if ($id) { $output .= "
    \n"; $output .= "
    ". date("l, F jS", $timestamp) .":
    \n"; - $output .= "

    [ edit ]

    ". check_output($text, 1) ."

    \n"; + $output .= "

    [ ". t("edit") ." ]

    ". check_output($text, 1) ."

    \n"; $output .= "
    \n"; } else { @@ -82,12 +80,12 @@ function diary_page_display($username) { while ($diary = db_fetch_object($result)) $output .= diary_page_entry($diary->timestamp, $diary->text, $diary->id); } else { - $output .= "

    ". format_username($username) ."'s diary:

    \n"; + $output .= "". t("Username") .": ". format_username($username); while ($diary = db_fetch_object($result)) $output .= diary_page_entry($diary->timestamp, $diary->text); } $theme->header(); - $theme->box("$username's online diary", $output); + $theme->box(t("Online diary"), $output); $theme->footer(); } @@ -97,9 +95,8 @@ function diary_page_add() { $output .= "
    \n"; $output .= "

    \n"; - $output .= " Enter new diary entry:
    \n"; - $output .= "
    \n"; - $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; + $output .= "
    \n"; + $output .= " ". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".\n"; $output .= "

    \n"; $output .= "

    \n"; @@ -109,7 +106,7 @@ function diary_page_add() { $output .= "

    \n"; $theme->header(); - $theme->box("Edit your diary", $output); + $theme->box(t("Edit your diary"), $output); $theme->footer(); } @@ -122,23 +119,19 @@ function diary_page_edit($id) { $output .= diary_page_entry($diary->timestamp, $diary->text); $output .= "
    \n"; - $output .= "

    \n"; - $output .= " Edit diary entry:
    \n"; $output .= "
    \n"; - $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; + $output .= " ". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".\n"; $output .= "

    \n"; - $output .= "

    \n"; $output .= " id\">\n"; $output .= " timestamp\">\n"; $output .= " \n"; $output .= "

    \n"; - $output .= "
    \n"; $theme->header(); - $theme->box("Edit your diary", $output); + $theme->box(t("Edit your diary"), $output); $theme->footer(); } @@ -148,13 +141,10 @@ function diary_page_preview($text, $timestamp, $id = 0) { $output .= diary_page_entry($timestamp, $text); $output .= "
    \n"; - $output .= "

    \n"; - $output .= " Preview diary entry:
    \n"; $output .= "
    \n"; - $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; + $output .= " ". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".\n"; $output .= "

    \n"; - $output .= "

    \n"; $output .= " \n"; $output .= " \n"; @@ -164,7 +154,7 @@ function diary_page_preview($text, $timestamp, $id = 0) { $output .= "

    \n"; $theme->header(); - $theme->box("Edit your diary", $output); + $theme->box(t("Edit your diary"), $output); $theme->footer(); } @@ -229,7 +219,7 @@ function diary_user($username, $section, $operation) { $diaries++; } - $block["subject"] = "$username has posted ". format_plural($diaries, "diary entry", "diary entries") ." recently"; + $block["subject"] = strtr(t("%a has posted %b recently"), array("%a" => $username, "%b" => format_plural($diaries, "diary entry", "diary entries"))); $block["content"] = $content; return $block; diff --git a/modules/faq.module b/modules/faq.module index 811282a6113..f0182543088 100644 --- a/modules/faq.module +++ b/modules/faq.module @@ -83,7 +83,7 @@ function faq_page() { "; $theme->header(); - $theme->box("Frequently Asked Questions", $output); + $theme->box(t("Frequently Asked Questions"), $output); $theme->footer(); } diff --git a/modules/locale.module b/modules/locale.module new file mode 100644 index 00000000000..645769cd2ea --- /dev/null +++ b/modules/locale.module @@ -0,0 +1,13 @@ + "locale", + "admin" => "locale"); + +function locale() { + $result = db_query("SELECT * FROM locales ORDER BY english"); + while ($locale = db_fetch_object($result)) { + print "
  • ". check_output($locale->english) ."
  • "; + } +} + +?> diff --git a/modules/locale/locale.module b/modules/locale/locale.module new file mode 100644 index 00000000000..645769cd2ea --- /dev/null +++ b/modules/locale/locale.module @@ -0,0 +1,13 @@ + "locale", + "admin" => "locale"); + +function locale() { + $result = db_query("SELECT * FROM locales ORDER BY english"); + while ($locale = db_fetch_object($result)) { + print "
  • ". check_output($locale->english) ."
  • "; + } +} + +?> diff --git a/modules/section.module b/modules/section.module index 2ee5869d94b..af07100f58d 100644 --- a/modules/section.module +++ b/modules/section.module @@ -20,7 +20,7 @@ function section_help() { function section_block() { $result = db_query("SELECT se.name, COUNT(st.id) AS stories FROM sections se LEFT JOIN stories st ON se.name = st.section GROUP BY se.name"); while ($_section = db_fetch_object($result)) { - $content .= "
  • name) ."\">$_section->name (". format_data($_section->stories, 0) .")
  • \n"; + $content .= "
  • name) ."\">$_section->name (". check_output($_section->stories, 0) .")
  • \n"; } $block[0]["subject"] = "Sections"; diff --git a/scripts/php-clean b/scripts/php-clean index 39209cf9751..fe5c589d3bb 100644 --- a/scripts/php-clean +++ b/scripts/php-clean @@ -1,5 +1,5 @@ #!/bin/sh find . -name "*~" -type f | xargs rm -f find . -name "DEADJOE" -type f | xargs rm -f -find . -name "*" -type f | grep -v ".gif" | grep -v ".jpg" | xargs perl -wi -pe 's/\s+$/\n/' -find . -name "*" -type f | grep -v ".gif" | grep -v ".jpg" | xargs perl -wi -pe 's/\t/ /g' +find . -name "*" -type f | grep -v ".gif" | grep -v ".jpg" | grep -v ".tgz" | xargs perl -wi -pe 's/\s+$/\n/' +find . -name "*" -type f | grep -v ".gif" | grep -v ".jpg" | grep -v ".tgz" | xargs perl -wi -pe 's/\t/ /g' diff --git a/search.php b/search.php index 323d1b3e263..77d2ff50ae0 100644 --- a/search.php +++ b/search.php @@ -18,8 +18,8 @@ $search .= "\n"; $output = search_data($keys, $type); $theme->header(); -$theme->box("Search", $search); -$theme->box("Result", $output); +$theme->box(t("Search"), $search); +$theme->box(t("Result"), $output); $theme->footer(); ?> \ No newline at end of file diff --git a/submission.php b/submission.php index 935bc9c0cc2..a00f4abf677 100644 --- a/submission.php +++ b/submission.php @@ -9,17 +9,18 @@ function submission_display_main() { // Perform query: $result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON s.author = u.id WHERE s.status = 1 ORDER BY s.id"); - $content .= "

    Anyone who happens by, and has some news or some thoughts they'd like to share, can submit new content for consideration. After someone has submitted something, their story is added to a queue. All registered users can access this list of pending stories, that is, stories that have been submitted, but do not yet appear on the public front page. Those registered users can vote whether they think the story should be posted or not. When enough people vote to post a story, the story is pushed over the threshold and up it goes on the public page. On the other hand, when too many people voted to drop a story, the story will get trashed.

    Basically, this means that you, the community, are truly the editors of this site as you have the final decision on the content of this site. It's you judging the overall quality of a story. But remember, vote on whether the story is interesting, not on whether you agree with it or not. If the story goes up, you can disagree all you want, but don't vote `no' because you think the ideas expressed are wrong. Instead, vote `no' when you think the story is plain boring.

    "; + $content .= "

    ". t("Anyone who happens by, and has some news or some thoughts they'd like to share, can submit new content for consideration. After someone has submitted something, their story is added to a queue. All registered users can access this list of pending stories, that is, stories that have been submitted, but do not yet appear on the public front page. Those registered users can vote whether they think the story should be posted or not. When enough people vote to post a story, the story is pushed over the threshold and up it goes on the public page. On the other hand, when too many people voted to drop a story, the story will get trashed."). "

    "; + $content .= "

    ". t("Basically, this means that you, the community, are truly the editors of this site as you have the final decision on the content of this site. It's you judging the overall quality of a story. But remember, vote on whether the story is interesting, not on whether you agree with it or not. If the story goes up, you can disagree all you want, but don't vote `no' because you think the ideas expressed are wrong. Instead, vote `no' when you think the story is plain boring.") ."

    "; $content .= "\n"; - $content .= " \n"; + $content .= " \n"; while ($submission = db_fetch_object($result)) { if ($user->id == $submission->author || user_get_history($user->history, "s$submission->id")) $content .= " \n"; - else $content .= " \n"; + else $content .= " \n"; } $content .= "
    SubjectSectionDateAuthorScore
    ". t("Subject") ."". t("Section") ."". t("Date") ."". t("Author") ."". t("Score") ."
    id\">". check_output($submission->subject) ."$submission->section". date("Y-m-d", $submission->timestamp) ."
    ". date("H:m:s", $submission->timestamp) ."
    ". format_username($submission->userid) ."". submission_score($submission->id) ."
    id\">". check_output($submission->subject) ."$submission->section". date("Y-m-d", $submission->timestamp) ."
    ". date("H:m:s", $submission->timestamp) ."
    ". format_username($submission->userid) ."id\">vote
    id\">". check_output($submission->subject) ."$submission->section". date("Y-m-d", $submission->timestamp) ."
    ". date("H:m:s", $submission->timestamp) ."
    ". format_username($submission->userid) ."id\">". t("vote") ."
    \n"; $theme->header(); - $theme->box("Open submission queue - Pending stories", $content); + $theme->box(t("Open submission queue - Pending stories"), $content); $theme->footer(); } diff --git a/submit.php b/submit.php index 8e9e56967c9..7db513f90a3 100644 --- a/submit.php +++ b/submit.php @@ -4,50 +4,51 @@ function submit_enter() { global $anonymous, $allowed_html, $theme, $user; // Guidlines: - $output .= "

    Got some news or some thoughts you would like to share? Fill out this form and they will automatically get whisked away to our submission queue where our moderators will frown at it, poke at it and hopefully post it. Every registered user is automatically a moderator and can vote whether or not your sumbission should be carried to the front page for discussion.

    \n"; - $output .= "

    Note that we do not revamp or extend your submission so it is up to you to make sure your submission is well-written: if you don't care enough to be clear and complete, your submission is likely to be moderated down by our army of moderators. Try to be complete, aim for clarity, organize and structure your text, and try to carry out your statements with examples. It is also encouraged to extend your submission with arguments that flow from your unique intellectual capability and experience: offer some insight or explanation as to why you think your submission is interesting. Make sure your submission has some meat on it!

    \n"; - $output .= "

    However, if you have bugs to report, complaints, personal questions or anything besides a public submission, we would prefer you to mail us instead, or your message is likely to get lost.


    \n"; + $output .= "

    ". t("Got some news or some thoughts you would like to share? Fill out this form and they will automatically get whisked away to our submission queue where our moderators will frown at it, poke at it and hopefully post it. Every registered user is automatically a moderator and can vote whether or not your sumbission should be carried to the front page for discussion.") ."

    \n"; + $output .= "

    ". t("Note that we do not revamp or extend your submission so it is up to you to make sure your submission is well-written: if you don't care enough to be clear and complete, your submission is likely to be moderated down by our army of moderators. Try to be complete, aim for clarity, organize and structure your text, and try to carry out your statements with examples. It is also encouraged to extend your submission with arguments that flow from your unique intellectual capability and experience: offer some insight or explanation as to why you think your submission is interesting. Make sure your submission has some meat on it!") ."

    \n"; + $output .= "

    ". t("However, if you have bugs to report, complaints, personal questions or anything besides a public submission, we would prefer you to mail us instead, or your message is likely to get lost.") ."

    \n"; // Submission form: $output .= "
    \n"; - $output .= "

    \n Your name:
    \n"; + $output .= "

    \n"; + $output .= " ". t("Your name") .":
    \n"; $output .= format_username($user->userid); $output .= "

    \n"; $output .= "

    \n"; - $output .= " Subject:
    \n"; + $output .= " ". t("Subject") .":
    \n"; $output .= "
    \n"; - $output .= " Bad subjects are 'Check this out!' or 'An article'. Be descriptive, clear and simple!\n"; $output .= "

    \n"; - $output .= "

    Section:
    \n"; + $output .= "

    \n"; + $output .= " ". t("Section") .":
    \n"; $output .= " \n"; $output .= "

    \n"; $output .= "

    \n"; - $output .= " Abstract:
    \n"; + $output .= " ". t("Abstract") .":
    \n"; $output .= "
    \n"; - $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; + $output .= " ". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".\n"; $output .= "

    \n"; $output .= "

    \n"; - $output .= " Extended story:
    \n"; + $output .= " ". t("Extended story") .":
    \n"; $output .= "
    \n"; - $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; + $output .= " ". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".\n"; $output .= "

    \n"; $output .= "

    \n"; - $output .= " You must preview at least once before you can submit:
    \n"; + $output .= " ". t("You must preview at least once before you can submit") .":
    \n"; $output .= " \n"; $output .= "

    \n"; $output .= "
    \n"; $theme->header(); - $theme->box("Submit a story", $output); + $theme->box(t("Submit a story"), $output); $theme->footer(); } @@ -59,45 +60,43 @@ function submit_preview($subject, $abstract, $article, $section) { $output .= "
    \n"; $output .= "

    \n"; - $output .= " Your name:
    \n"; + $output .= " ". t("Your name") .":
    \n"; $output .= format_username($user->userid); $output .= "

    \n"; $output .= "

    \n"; - $output .= " Subject:
    \n"; + $output .= " ". t("Subject") .":
    \n"; $output .= "
    \n"; - $output .= " Bad subjects are 'Check this out!' or 'An article'. Be descriptive, clear and simple!\n"; $output .= "

    \n"; - $output .= "

    Section:
    \n"; + $output .= "

    \n"; + $output .= " ". t("Section") .":
    \n"; $output .= " \n"; $output .= "

    \n"; $output .= "

    \n"; - $output .= "Abstract:
    \n"; + $output .= "". t("Abstract") .":
    \n"; $output .= "
    \n"; $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; $output .= "

    \n"; $output .= "

    \n"; - $output .= " Extended story:
    \n"; + $output .= " ". t("Extended story") .":
    \n"; $output .= "
    \n"; $output .= " Allowed HTML tags: ". htmlspecialchars($allowed_html) .".\n"; $output .= "

    \n"; if (empty($subject)) { - $output .= "

    \n"; - $output .= " Warning: you did not supply a subject.\n"; - $outout .= "

    \n"; + $output .= "

    ". t("Warning: you did not supply a subject.") ."

    \n"; $output .= "

    \n"; $output .= " \n"; $output .= "

    \n"; } else if (empty($abstract)) { $output .= "

    \n"; - $output .= " Warning: you did not supply an abstract.\n"; + $output .= " ". t("Warning: you did not supply an abstract.") ."\n"; $outout .= "

    \n"; $output .= "

    \n"; $output .= " \n"; @@ -113,7 +112,7 @@ function submit_preview($subject, $abstract, $article, $section) { $theme->header(); $theme->article(new Story($user->userid, $subject, $abstract, $article, $section, time())); - $theme->box("Submit a story", $output); + $theme->box(t("Submit a story"), $output); $theme->footer(); } diff --git a/updates/1.00-to-1.xx b/updates/1.00-to-1.xx index f7b93027875..8ef4971cf2a 100644 --- a/updates/1.00-to-1.xx +++ b/updates/1.00-to-1.xx @@ -13,3 +13,10 @@ alter table blocks add remove tinyint(1) DEFAULT '0' NOT NULL; # 07/02/2001: value calculation alter table users add rating decimal(8,4) DEFAULT '0' NOT NULL; + +# 12/02/2001: locale / internationalisation +create table locales ( + id int(11) DEFAULT '0' NOT NULL auto_increment, + english TEXT DEFAULT '' NOT NULL, + PRIMARY KEY (id) +);