mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
Add month translation option
This commit is contained in:
parent
24936479f9
commit
f6b86b8c2a
@ -302,6 +302,12 @@ class Page {
|
||||
function millis_to_date($millis) {
|
||||
$ts = $millis / 1000;
|
||||
$result = strftime($this->settings->date_format, $ts);
|
||||
$translations = $this->settings->date_month_translations;
|
||||
if ($translations !== null) {
|
||||
foreach ($translations as $key => $val) {
|
||||
$result = str_replace($key, $val, $result);
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,25 @@ final class Settings {
|
||||
// Enable error pages.
|
||||
$this->error_pages = true;
|
||||
|
||||
$this->date_month_translations = null;
|
||||
|
||||
/*
|
||||
$this->date_month_translations = array(
|
||||
"January" => "Month 1",
|
||||
"February" => "Month 2",
|
||||
"March" => "Month 3",
|
||||
"April" => "Month 4",
|
||||
"May" => "Month 5",
|
||||
"June" => "Month 6",
|
||||
"July" => "Month 7",
|
||||
"August" => "Month 8",
|
||||
"September" => "Month 9",
|
||||
"October" => "Month 10",
|
||||
"November" => "Month 11",
|
||||
"December" => "Month 12",
|
||||
);
|
||||
*/
|
||||
|
||||
/*** End of configuration ***/
|
||||
|
||||
|
||||
@ -81,15 +100,6 @@ final class Settings {
|
||||
ini_set("display_errors", 1);
|
||||
}
|
||||
|
||||
$this->table = array(
|
||||
'bans' => "${table_prefix}bans",
|
||||
'mutes' => "${table_prefix}mutes",
|
||||
'warnings' => "${table_prefix}warnings",
|
||||
'kicks' => "${table_prefix}kicks",
|
||||
'history' => "${table_prefix}history",
|
||||
'servers' => "${table_prefix}servers",
|
||||
);
|
||||
|
||||
$this->active_query = "";
|
||||
|
||||
if ($driver === "pgsql") {
|
||||
@ -101,6 +111,16 @@ final class Settings {
|
||||
$this->active_query = "WHERE active=" . Settings::$TRUE;
|
||||
}
|
||||
|
||||
// Internal table names, do not translate.
|
||||
$this->table = array(
|
||||
'bans' => "${table_prefix}bans",
|
||||
'mutes' => "${table_prefix}mutes",
|
||||
'warnings' => "${table_prefix}warnings",
|
||||
'kicks' => "${table_prefix}kicks",
|
||||
'history' => "${table_prefix}history",
|
||||
'servers' => "${table_prefix}servers",
|
||||
);
|
||||
|
||||
$this->driver = $driver;
|
||||
if ($connect) {
|
||||
if ($username === "" && $password === "") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user