diff --git a/Boards.iar b/Boards.iar index 9173843..97379cb 100644 Binary files a/Boards.iar and b/Boards.iar differ diff --git a/Config.php b/Config.php index 0a1a42e..67bd129 100644 --- a/Config.php +++ b/Config.php @@ -9,12 +9,12 @@ $GLOBALS["CONFIG"] = array( //Config for mysql server - "mysql" => array( - "server" => "127.0.0.1", - "user" => "VisitorBoard", - "pass" => "Password", - "db" => "visitorboard" - ) + "mysql" => array( + "server" => "127.0.0.1", + "user" => "VisitorBoard", + "pass" => "Password", + "db" => "visitorboard" + ) ); ?> \ No newline at end of file diff --git a/index.php b/index.php index 5110361..ca4c673 100644 --- a/index.php +++ b/index.php @@ -21,11 +21,6 @@ //Database $MySql = new MySql($GLOBALS["CONFIG"]["mysql"]["user"], $GLOBALS["CONFIG"]["mysql"]["pass"], $GLOBALS["CONFIG"]["mysql"]["db"], $GLOBALS["CONFIG"]["mysql"]["server"]); - //Handle languagefile - LoadLanguages(); - $SelLang = strtolower($_GET["l"]); - if (!isset($GLOBALS["LanguageData"][$SelLang])) {$SelLang = "en";} - //Look up timezone, country and the (hopefulle) correct language for the region that requests this image $ListOfTimezones = DateTimeZone::listIdentifiers(DateTimeZone::ALL); $MySql->query("DELETE FROM ip_timezones WHERE unix < {0} OR (unix < {1} AND country = '')", array(time() - 86400 * 60, time() - 86400)); @@ -52,6 +47,18 @@ if (in_array(strtolower($TimeZone), $ListOfTimezones)) {date_default_timezone_set($TimeZone);} + //Handle languagefile + LoadLanguages(); + $SelLang = strtolower($_GET["l"]); + if (empty($SelLang)) + { + //If no prefered language is sent to the script, use the clients ip address to detect display language + $Exists = $MySql->query("SELECT * FROM countries_lang WHERE country = {0} LIMIT 1", array(strtolower($Country)))->fetch(); + if (!empty($Exists["lang"])) + {$SelLang = strtolower($Exists["lang"]);} + } + if (!isset($GLOBALS["LanguageData"][$SelLang])) {$SelLang = "en";} + //So, now lets start with requesting all required information from the visitors grids $UserMem = array(); $AllUsers = explode(";", $_GET["u"]);