From 198692048568bb6908682e981b47fe3b668dbf49 Mon Sep 17 00:00:00 2001
From: Wruczek <wruczekk@gmail.com>
Date: Wed, 12 Oct 2016 21:57:49 +0200
Subject: [PATCH] Small changes, fixed rare timezone issue
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixed error: “date(): It is not safe to rely on the system's timezone
settings…”
---
 .gitignore                 | 1 +
 api/status.php             | 6 ++++--
 bans.php                   | 2 +-
 config/config.template.php | 1 +
 viewer.php                 | 2 +-
 5 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index 42986f9..ef139ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 config/config.php
 prototypes/
+admin/
 
 # PhpStorm
 .idea/
diff --git a/api/status.php b/api/status.php
index 52328ca..c6c640d 100644
--- a/api/status.php
+++ b/api/status.php
@@ -6,6 +6,8 @@ set_error_handler("exception_error_handler", E_ALL);
 require_once __DIR__ . "/../include/tsutils.php";
 require_once __DIR__ . "/../lib/phpfastcache/autoload.php";
 
+date_default_timezone_set($config["general"]["timezone"]);
+
 use phpFastCache\Util;
 use phpFastCache\CacheManager;
 
@@ -48,8 +50,8 @@ function scriptFail($error) {
     die(json_encode(array(
         "success" => false,
         "id" => "script_error",
-        "message" => "There has been an error while retrieving the server status"
-        ,"error" => $error
+        "message" => "There has been an error while retrieving the server status",
+        "error" => $error
     )));
 }
 
diff --git a/bans.php b/bans.php
index 7e82199..7f62cde 100644
--- a/bans.php
+++ b/bans.php
@@ -55,7 +55,7 @@ if (is_null($banlist)) {
 
     </div>
     <div class="panel-footer">
-        <?php tl($lang["banlist"]["lastupdate"], [$banlist[1]]); ?><!-- <span style="float: right">Podgląd odświerza się co 60 sekund</span> -->
+        <?php tl($lang["banlist"]["lastupdate"], [$banlist[1]]); ?><!-- <span style="float: right">Podgląd odświeża się co 60 sekund</span> -->
     </div>
 </div>
 
diff --git a/config/config.template.php b/config/config.template.php
index 8f86456..edd119c 100644
--- a/config/config.template.php
+++ b/config/config.template.php
@@ -16,6 +16,7 @@ $config["general"]["icon"]          = "img/icon/icon-32.png";
 $config["general"]["subtitle"]      = " - Best TeamSpeak server!";                  // Website subtitle
 $config["general"]["desc"]          = "Polski serwer TeamSpeak! Zapraszamy :)";     // Website description - displayed in Google search engine
 $config["general"]["newsDir"]       = "config/news";                                // News folder (relative to project folder)
+$config["general"]["timezone"]      = "Europe/Warsaw";                              // Your timezone - http://php.net/manual/en/timezones.php
 
 $config["general"]["enablehta"]     = false; // Enable / Disable additional website features (recommended, but
                                              // you need to have up-to-date version of Apache and install mod_rewrite)
diff --git a/viewer.php b/viewer.php
index 7c9af7d..5d93dd7 100644
--- a/viewer.php
+++ b/viewer.php
@@ -42,7 +42,7 @@ function getViewer() {
         <?php echo $tsviewer[0]; ?>
     </div>
     <div class="panel-footer">
-        <?php tl($lang["viewer"]["lastupdate"], [$tsviewer[1]]); ?><!-- <span style="float: right">Podgląd odświerza się co 30 sekund</span> -->
+        <?php tl($lang["viewer"]["lastupdate"], [$tsviewer[1]]); ?><!-- <span style="float: right">Podgląd odświeża się co 30 sekund</span> -->
     </div>
 </div>