/** * getCountryShortByIP * @author Cornelius Hansjakob <*****@*****.**> * @version 1.0 */ private function getCountryShortByIP($strIPAddress = '') { if (file_exists(GLOBAL_ROOT_PATH . 'library/IP2Location/IP-COUNTRY.BIN')) { $ip = new ip2location(); $ip->open(GLOBAL_ROOT_PATH . 'library/IP2Location/IP-COUNTRY.BIN'); $ipAddress = strpos($_SERVER['HTTP_HOST'], 'area51') === false ? $_SERVER['REMOTE_ADDR'] : '84.72.245.26'; if ($strIPAddress != '') { $ipAddress = $strIPAddress; } $countryShort = $ip->getCountryShort($ipAddress); return $countryShort; } }