Make it possible to translate info.php tags - Active, Inactive, Permanent

This commit is contained in:
ruan 2018-01-31 16:45:20 +02:00
parent f9f3ffde8c
commit da32ec89b2
No known key found for this signature in database
GPG Key ID: 0D2EC1C52E469C0B
4 changed files with 10 additions and 5 deletions

View File

@ -30,7 +30,7 @@
require_once '../inc/settings.php'; require_once '../inc/settings.php';
$settings = new Settings(false); $settings = new Settings(false);
$host = $settings->host; $host = $settings->host;
if ($host === "localhost" || $host === "127.0.0.1") { if ($host === "localhost" || $host === "127.0.0.1" || $host === "0.0.0.0") {
echo("<br>- The web interface is connected to <a class=\"text-info\">$host</a>. If LiteBans and the web interface are both connected to <a class=\"text-info\">$host</a>, they should not be hosted on two separate servers."); echo("<br>- The web interface is connected to <a class=\"text-info\">$host</a>. If LiteBans and the web interface are both connected to <a class=\"text-info\">$host</a>, they should not be hosted on two separate servers.");
} }
$table_prefix = $settings->table_prefix; $table_prefix = $settings->table_prefix;

View File

@ -203,7 +203,7 @@ final class Settings {
static function append_query($existing, $new) { static function append_query($existing, $new) {
if ($existing !== "") { if ($existing !== "") {
return $existing . " AND $new"; return "$existing AND $new";
} }
return "WHERE $new"; return "WHERE $new";
} }

View File

@ -156,12 +156,12 @@ if ($st->execute(array($id))) {
$style = 'style="margin-left: 13px; font-size: 16px;"'; $style = 'style="margin-left: 13px; font-size: 16px;"';
$active = $page->active($row); $active = $page->active($row);
if ($active === true) { if ($active === true) {
$header .= "<span $style class='label label-danger'>Active</span>"; $header .= "<span $style class='label label-danger'>" . $page->t("info_tag_active") . "</span>";
if ($permanent) { if ($permanent) {
$header .= "<span $style class='label label-danger'>Permanent</span>"; $header .= "<span $style class='label label-danger'>" . $page->t("info_tag_permanent") . "</span>";
} }
} else { } else {
$header .= "<span $style class='label label-warning'>Inactive</span>"; $header .= "<span $style class='label label-warning'>" . $page->t("info_tag_inactive") . "</span>";
} }
} }
$page->print_header(true, $header); $page->print_header(true, $header);

View File

@ -63,6 +63,11 @@ class DefaultLang {
$array["info_kick_reason"] = "Kick Reason"; $array["info_kick_reason"] = "Kick Reason";
$array["info_kick_when"] = "Kick Date"; $array["info_kick_when"] = "Kick Date";
$array["info_tag_active"] = "Active";
$array["info_tag_inactive"] = "Inactive";
$array["info_tag_permanent"] = "Permanent";
$array["bans_player"] = "Name"; $array["bans_player"] = "Name";
$array["bans_by"] = "Banned By"; $array["bans_by"] = "Banned By";
$array["bans_reason"] = "Reason"; $array["bans_reason"] = "Reason";