Config = $Config; $this->Database = $this->OpenWebDatabase(); } function NetworkPortState($Address, $Port, $Timeout = 1) { set_error_handler('ErrorHandler'); if($Socket = @fsockopen($Address, $Port, $ERROR_NO, $ERROR_STR, (float)$Timeout)) { fclose($Socket); $Result = true; } else $Result = false; restore_error_handler(); return($Result); } function SQLURLName($Name) { return('LOWER(REPLACE('.$Name.', " ", "-"))'); } function SeoUrl($Address) { $Diakritika = array("á","ä","č","ď","é","ě","ë","í","ň","ó","ö","ř","š","ť","ú","ů","ü","ý","ž","Á","Ä","Č","Ď","É","Ě","Ë","Í","Ň","Ó","Ö","Ř","Š","Ť","Ú","Ů","Ü","Ý","Ž"); $Nediakritika = array("a","a","c","d","e","e","e","i","n","o","o","r","s","t","u","u","u","y","z","A","A","C","D","E","E","E","I","N","O","O","R","S","T","U","U","U","Y","Z"); $Address = str_replace($Diakritika, $Nediakritika, $Address); $Address = strtolower($Address); $Address = preg_replace("/[^[:alpha:][:digit:]]/", "-", $Address); $Address = trim($Address, "-"); $Address = preg_replace("/[-]+/", "-", $Address); return($Address); } function OpenLogonServerDatabase() { $Database = new Database($this->Config['Mangos']['DatabaseHost'], $this->Config['Mangos']['DatabaseUser'], $this->Config['Mangos']['DatabasePassword'], $this->Config['Mangos']['DatabaseRealmd']); if(mysqli_connect_error()) { die('Přihlášení k databázi selhalo: '.mysqli_connect_error()); } $Database->charset($this->Config['Database']['Charset']); return($Database); } function OpenWebDatabase() { $Database = new Database($this->Config['Database']['Host'], $this->Config['Database']['User'], $this->Config['Database']['Password'], $this->Config['Database']['Database']); if(mysqli_connect_error()) { die('Přihlášení k databázi selhalo: '.mysqli_connect_error()); } $Database->charset($this->Config['Database']['Charset']); return($Database); } } ?>