diff --git a/imgboard.php b/imgboard.php
index 5bfe47b..b2b10a8 100644
--- a/imgboard.php
+++ b/imgboard.php
@@ -55,7 +55,11 @@ if (version_compare(phpversion(), '5.3.0', '<')) {
}
function fancyDie($message) {
- die('
' . $message . '
- Click here to go back -');
+ $back = 'Click here to go back';
+ if (function_exists('__')) {
+ $back = __('Click here to go back');
+ }
+ die('
' . $message . '
- ' . $back . ' -');
}
if (!file_exists('settings.php')) {
@@ -327,28 +331,28 @@ if (!isset($_GET['delete']) && !isset($_GET['manage']) && (isset($_POST['name'])
}
if ($post['file'] == '') { // No file uploaded
- $allowed = "";
- if (!empty($tinyib_uploads) && ($rawpost || !in_array('file', $hide_fields))) {
- $allowed = "file";
- }
- if (!empty($tinyib_embeds) && ($rawpost || !in_array('embed', $hide_fields))) {
- if ($allowed != "") {
- $allowed .= " or ";
- }
- $allowed .= "embed URL";
+ $file_ok = !empty($tinyib_uploads) && ($rawpost || !in_array('file', $hide_fields));
+ $embed_ok = !empty($tinyib_embeds) && ($rawpost || !in_array('embed', $hide_fields));
+ $allowed = '';
+ if ($file_ok && $embed_ok) {
+ $allowed = __('upload a file or embed a URL');
+ } else if ($file_ok) {
+ $allowed = __('upload a file');
+ } else if ($embed_ok) {
+ $allowed = __('embed a URL');
}
if ($post['parent'] == TINYIB_NEWTHREAD && $allowed != "" && !TINYIB_NOFILEOK) {
- fancyDie(sprintf(__('A %s is required to start a thread.'), $allowed));
+ fancyDie(sprintf(__('Please %s to start a new thread.'), $allowed));
}
if (!$rawpost && str_replace('
', '', $post['message']) == "") {
- $die_msg = "";
- if (!in_array('message', $hide_fields)) {
- $die_msg .= "enter a message " . ($allowed != "" ? " and/or " : "");
+ $message_ok = !in_array('message', $hide_fields);
+ if ($message_ok) {
+ if ($allowed != '') {
+ fancyDie(sprintf(__('Please enter a message and/or %s.'), $allowed));
+ }
+ fancyDie(__('Please enter a message.'));
}
- if ($allowed != "") {
- $die_msg .= "upload a $allowed";
- }
- fancyDie("Please $die_msg.");
+ fancyDie(sprintf(__('Please %s.'), $allowed));
}
} else {
echo sprintf(__('%s uploaded.'), $post['file_original']) . '
';
diff --git a/inc/html.php b/inc/html.php
index 1ba18f3..28cc93c 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -430,7 +430,7 @@ EOF;
EOF;
}
}
- if ($post["parent"] == TINYIB_NEWTHREAD) {
+ if ($post['parent'] == TINYIB_NEWTHREAD) {
$return .= $filehtml;
} else {
$return .= <<
@@ -802,15 +808,20 @@ function manageBansTable() {
}
function manageModeratePostForm() {
+ $txt_moderate = __('Moderate a post');
+ $txt_postid = __('Post ID');
$txt_submit = __('Submit');
+ $txt_tip = __('Tip:');
+ $txt_tiptext1 = __('While browsing the image board, you can easily moderate a post if you are logged in.');
+ $txt_tiptext2 = __('Tick the box next to a post and click "Delete" at the bottom of the page with a blank password.');
return <<
EOF;
@@ -820,13 +831,21 @@ function manageModeratePost($post) {
global $isadmin;
$ban = banByIP($post['ip']);
$ban_disabled = (!$ban && $isadmin) ? '' : ' disabled';
- $ban_info = (!$ban) ? ((!$isadmin) ? 'Only an administrator may ban an IP address.' : ('IP address: ' . $post["ip"])) : (' A ban record already exists for ' . $post['ip']);
+ if ($ban) {
+ $ban_info = sprintf(__(' A ban record already exists for %s'), $post['ip']);
+ } else {
+ if (!$isadmin) {
+ $ban_info = __('Only an administrator may ban an IP address.');
+ } else {
+ $ban_info = sprintf(__('IP address: %s'), $post['ip']);
+ }
+ }
$delete_info = ($post['parent'] == TINYIB_NEWTHREAD) ? __('This will delete the entire thread below.') : __('This will delete the post below.');
$post_or_thread = ($post['parent'] == TINYIB_NEWTHREAD) ? __('Thread') : __('Post');
$sticky_html = "";
$lock_html = "";
- if ($post["parent"] == TINYIB_NEWTHREAD) {
+ if ($post['parent'] == TINYIB_NEWTHREAD) {
$sticky_set = $post['stickied'] == 1 ? '0' : '1';
$sticky_unsticky = $post['stickied'] == 1 ? __('Un-sticky') : __('Sticky');
$sticky_unsticky_help = $post['stickied'] == 1 ? __('Return this thread to a normal state.') : __('Keep this thread at the top of the board.');
@@ -837,7 +856,7 @@ function manageModeratePost($post) {
-
+
$sticky_unsticky_help |
EOF;
@@ -851,7 +870,7 @@ EOF;
-
+
$lock_help |
EOF;
@@ -865,10 +884,17 @@ EOF;
$post_html = buildPost($post, TINYIB_INDEXPAGE);
}
+ $txt_moderating = sprintf(__('Moderating No.%d'), post['id']);
$txt_action = __('Action');
+ if ($post['parent'] == TINYIB_NEWTHREAD) {
+ $txt_delete = __('Delete thread');
+ } else {
+ $txt_delete = __('Delete post');
+ }
+ $txt_ban = __('Ban poster');
return <<
-
+