diff --git a/images/flags/DE.png b/images/flags/DE.png deleted file mode 100644 index c44b6bd..0000000 Binary files a/images/flags/DE.png and /dev/null differ diff --git a/images/flags/DK.png b/images/flags/DK.png deleted file mode 100644 index 7e7ddd5..0000000 Binary files a/images/flags/DK.png and /dev/null differ diff --git a/images/flags/GB.png b/images/flags/GB.png deleted file mode 100644 index 7fcf132..0000000 Binary files a/images/flags/GB.png and /dev/null differ diff --git a/images/flags/RU.png b/images/flags/RU.png deleted file mode 100644 index a79df26..0000000 Binary files a/images/flags/RU.png and /dev/null differ diff --git a/images/flags/US.png b/images/flags/US.png deleted file mode 100644 index 9e4edb5..0000000 Binary files a/images/flags/US.png and /dev/null differ diff --git a/includes/functions_unicode.php b/includes/functions_unicode.php index 038fa62..edf408f 100644 --- a/includes/functions_unicode.php +++ b/includes/functions_unicode.php @@ -11,7 +11,7 @@ function country_code_to_unicode( $country ) { if ( ( $country === false ) or ( strlen( $country ) != 2 ) ) - return ''; + return '🌍'; $country = strtoupper( $country ); @@ -20,7 +20,7 @@ function country_code_to_unicode( $country ) { if (( $char1 > 25 ) or ( $char2 > 25 ) or ( $char1 < 0 ) or ( $char2 < 0 ) ) - return ''; + return '🌍'; $start = 0x1F1E6; $char1 += $start; $char2 += $start; diff --git a/servers.php b/servers.php index 9196a98..d2c3d42 100644 --- a/servers.php +++ b/servers.php @@ -6,6 +6,7 @@ include_once( 'includes/header.php' ); include_once( 'includes/GameQ.php' ); include_once( 'includes/paths.php' ); +include_once( 'includes/functions_unicode.php' ); $Servers = file( $serversRepo . '/serverlist' ); ?>

Game Servers

@@ -64,7 +65,7 @@ $data['gq_address'] = preg_replace( '/.steamlug.org/', '​.steamlug.org', $data['gq_address'], 1 ); echo << - + 🌍 Server Unresponsive @@ -77,6 +78,8 @@ } else { /* this block of code should be better… TODO it please */ $serverLoc = geoip_country_code_by_name( $data['gq_address'] ); + $serverFlag = country_code_to_unicode( $serverLoc ); + $serverLoc = $serverLoc ? $serverLoc : 'Unknown'; $serverSec = ! empty( $data['secure'] ) ? '' : ''; $serverPass = ! empty( $data['gq_password'] ) ? '' : ''; $serverDesc = ! empty( $data['gq_name'] ) ? $data['gq_name'] : ''; @@ -84,11 +87,11 @@ // $serverDesc = ! empty( $data['gq_steamappid'] ) ? '' . $data['gq_name'] . '' : $data['gq_name']; $serverNum = ( ! empty( $data['gq_numplayers'] ) ? $data['gq_numplayers'] : '0') . ' ⁄ ' . $data['gq_maxplayers']; $serverMap = substr( $data['gq_mapname'], 0, 18 ); - $connectPort = ( ! empty( $data['port'] ) ? $data['port'] : ( isset( $data['gameport'] ) ? $data['gameport'] : $data['gq_port'] ) ); + $connectPort= ( ! empty( $data['port'] ) ? $data['port'] : ( isset( $data['gameport'] ) ? $data['gameport'] : $data['gq_port'] ) ); $serverHost = $data['gq_address'] . ":" . $connectPort; echo << - {$serverLoc} + {$serverFlag} {$serverSec} {$serverPass} {$serverDesc}