diff options
author | filip <filip.komar@gmail.com> | 2016-05-15 11:37:40 +0200 |
---|---|---|
committer | filip <filip.komar@gmail.com> | 2016-05-15 11:37:40 +0200 |
commit | 8710f94c9f038c81e9ad89a0a2a20cc693247a96 (patch) | |
tree | e092a79334fde2e63d5fd076ce0399e1af159d64 /en/downloads/get/index.php | |
parent | 7ad5d3aba6ce9c60d231948b523fb0a9f68bb190 (diff) | |
download | www-8710f94c9f038c81e9ad89a0a2a20cc693247a96.tar www-8710f94c9f038c81e9ad89a0a2a20cc693247a96.tar.gz www-8710f94c9f038c81e9ad89a0a2a20cc693247a96.tar.bz2 www-8710f94c9f038c81e9ad89a0a2a20cc693247a96.tar.xz www-8710f94c9f038c81e9ad89a0a2a20cc693247a96.zip |
improve visual representation of countries and continents on DL page
Diffstat (limited to 'en/downloads/get/index.php')
-rw-r--r-- | en/downloads/get/index.php | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/en/downloads/get/index.php b/en/downloads/get/index.php index b121e3407..21e9bed86 100644 --- a/en/downloads/get/index.php +++ b/en/downloads/get/index.php @@ -131,12 +131,19 @@ try { } // Feedback about current mirror location + trigger for alt mirrors. + if (array_key_exists($one_mirror['country'], $countries)) { + $mirrors_country_name = $countries[$one_mirror['country']]; + } else if (array_key_exists($one_mirror['country'], MGA_Geoip::$MGA_COUNTRY_CODE_TO_COUNTRY_NAME)) { + $mirrors_country_name = MGA_Geoip::$MGA_COUNTRY_CODE_TO_COUNTRY_NAME[$one_mirror['country']]; + } else { + $mirrors_country_name = $one_mirror['country']; + } $dl2_mirror_alt = sprintf( _r('This <a href="%s">%s</a> download mirror is located in %s (%s).'), $one_mirror['mirror_url'], $one_mirror['mirror_host'], - rewrite_city($one_mirror['city']) . ', ' . $countries[$one_mirror['country']], - $one_mirror['country'] + rewrite_city($one_mirror['city']), + $mirrors_country_name ) . ' ' . _r('If it does not work well for you, <a href="#om" id="other_mirrors_btn">check out these other mirrors</a>.'); @@ -233,9 +240,22 @@ if (array_key_exists('sha512', $product)) { </div> <?php endif; ?> <p><?php + if (array_key_exists($_SESSION['country'], $countries)) { + $country_name = $countries[$_SESSION['country']]; + } else if (array_key_exists($_SESSION['country'], MGA_Geoip::$MGA_COUNTRY_CODE_TO_COUNTRY_NAME)) { + $country_name = MGA_Geoip::$MGA_COUNTRY_CODE_TO_COUNTRY_NAME[$_SESSION['country']]; + } else { + $country_name = $_SESSION['country']; + } + + if (array_key_exists($_SESSION['continent'], MGA_Geoip::$MGA_CONTINENT_CODE_TO_CONTINENT_NAME)) { + $continent_name = MGA_Geoip::$MGA_CONTINENT_CODE_TO_CONTINENT_NAME[$_SESSION['continent']]; + } else { + $continent_name = $_SESSION['continent']; + } echo sprintf( _r('Your IP address is %s and you seem to be in %s, %s.'), - $_SESSION['ip'], $_SESSION['country'], $_SESSION['continent'] + $_SESSION['ip'], $country_name, $continent_name ); ?></p> </div> |