Small bugfixes

master
Kubwa 2020-11-29 12:40:30 +01:00
parent 87d3b4405e
commit d9d6161fa9
3 changed files with 18 additions and 11 deletions

Binary file not shown.

View File

@ -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"]);