diff --git a/imgboard.php b/imgboard.php
index e496fc2..5bfe47b 100644
--- a/imgboard.php
+++ b/imgboard.php
@@ -68,6 +68,7 @@ if (!defined('TINYIB_LOCALE') || TINYIB_LOCALE == '') {
return $string;
}
} else {
+ setlocale(LC_ALL, TINYIB_LOCALE);
require 'inc/gettext/src/autoloader.php';
$translations = Translations::fromPoFile('locale/' . TINYIB_LOCALE . '/tinyib.po');
$translator = new Translator();
diff --git a/inc/defines.php b/inc/defines.php
index e52d992..a9bdd0d 100644
--- a/inc/defines.php
+++ b/inc/defines.php
@@ -56,7 +56,7 @@ if (!defined('TINYIB_JSON')) {
define('TINYIB_JSON', true);
}
if (!defined('TINYIB_DATEFMT')) {
- define('TINYIB_DATEFMT', 'y/m/d(D)H:i:s');
+ define('TINYIB_DATEFMT', '%g/%m/%d(%a)%H:%M:%S');
}
if (!defined('TINYIB_DBMIGRATE')) {
define('TINYIB_DBMIGRATE', false);
diff --git a/inc/functions.php b/inc/functions.php
index ed69902..5fcf6ca 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -136,7 +136,7 @@ function nameBlock($name, $tripcode, $email, $timestamp, $rawposttext) {
$output = '' . $output . '';
}
- return $output . $rawposttext . ' ' . date(TINYIB_DATEFMT, $timestamp);
+ return $output . $rawposttext . ' ' . strftime(TINYIB_DATEFMT, $timestamp);
}
function writePage($filename, $contents) {
@@ -244,7 +244,7 @@ function checkBanned() {
$ban = banByIP($_SERVER['REMOTE_ADDR']);
if ($ban) {
if ($ban['expire'] == 0 || $ban['expire'] > time()) {
- $expire = ($ban['expire'] > 0) ? ('
This ban will expire ' . date(TINYIB_DATEFMT, $ban['expire'])) : '
This ban is permanent and will not expire.';
+ $expire = ($ban['expire'] > 0) ? ('
This ban will expire ' . strftime(TINYIB_DATEFMT, $ban['expire'])) : '
This ban is permanent and will not expire.';
$reason = ($ban['reason'] == '') ? '' : ('
Reason: ' . $ban['reason']);
fancyDie('Your IP address ' . $ban['ip'] . ' has been banned from posting on this image board. ' . $expire . $reason);
} else {
diff --git a/inc/html.php b/inc/html.php
index f70c78f..1ba18f3 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -53,16 +53,11 @@ function supportedFileTypes() {
}
$types_allowed = array_map('strtoupper', array_unique(array_column($tinyib_uploads, 0)));
- $types_last = array_pop($types_allowed);
- $types_formatted = $types_allowed
- ? implode(', ', $types_allowed) . ' and ' . $types_last
- : $types_last;
-
- if (count($tinyib_uploads) == 1) {
- return sprintf(__('Supported file type is %s'), $types_formatted);
- } else {
- return sprintf(__('Supported file types are %s.'), $types_formatted);
+ if (count($types_allowed) == 1) {
+ return sprintf(__('Supported file type is %s'), $types_allowed[0]);
}
+ $last_type = array_pop($types_allowed);
+ return sprintf(__('Supported file types are %1$s and %2$s.'), implode(', ', $types_allowed), $last_type);
}
function makeLinksClickable($text) {
@@ -797,9 +792,9 @@ function manageBansTable() {
if (count($allbans) > 0) {
$text .= '
' . __('IP Address') . ' | ' . __('Set At') . ' | ' . __('Expires') . ' | ' . __('Reason') . ' | |
---|---|---|---|---|
' . $ban['ip'] . ' | ' . date(TINYIB_DATEFMT, $ban['timestamp']) . ' | ' . $expire . ' | ' . $reason . ' | ' . __('lift') . ' |
' . $ban['ip'] . ' | ' . strftime(TINYIB_DATEFMT, $ban['timestamp']) . ' | ' . $expire . ' | ' . $reason . ' | ' . __('lift') . ' |