cvs: php-master-web /manage mirrors.php
| From: | jim winstead | Date: | Sun, 03 Mar 2002 19:32:58 +0000 |
| Subject: | cvs: php-master-web /manage mirrors.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-8928@lists.php.net to get a copy of this message | ||
jimw Sun Mar 3 14:32:58 2002 EDT
Modified files:
/php-master-web/manage mirrors.php
Log:
use country table
Index: php-master-web/manage/mirrors.php
diff -u php-master-web/manage/mirrors.php:1.5 php-master-web/manage/mirrors.php:1.6
--- php-master-web/manage/mirrors.php:1.5 Thu Feb 14 17:20:04 2002
+++ php-master-web/manage/mirrors.php Sun Mar 3 14:32:57 2002
@@ -2,61 +2,6 @@
require_once 'login.inc';
require_once 'functions.inc';
-# these are just here temporarily. they'll be in a database table eventually.
-$COUNTRIES = array(
- "au" => "Australia",
- "at" => "Austria",
- "be" => "Belgium",
- "bg" => "Bulgaria",
- "br" => "Brazil",
- "ca" => "Canada",
- "ch" => "Switzerland",
- "cl" => "Chile",
- "cn" => "China",
- "cr" => "Costa Rica",
- "cz" => "Czech Republic",
- "de" => "Germany",
- "dk" => "Denmark",
- "ee" => "Estonia",
- "es" => "Spain",
- "fi" => "Finland",
- "fr" => "France",
- "gr" => "Greece",
- "hk" => "China (Hong Kong)",
- "hu" => "Hungary",
- "id" => "Indonesia",
- "ie" => "Ireland",
- "il" => "Israel",
- "is" => "Iceland",
- "it" => "Italy",
- "jp" => "Japan",
- "kr" => "Korea",
- "li" => "Liechtenstein",
- "lt" => "Lithuania",
- "lv" => "Latvia",
- "mx" => "Mexico",
- "nl" => "Netherlands",
- "no" => "Norway",
- "nz" => "New Zealand",
- "ph" => "Philippines",
- "pl" => "Poland",
- "pt" => "Portugal",
- "ro" => "Romania",
- "ru" => "Russian Federation",
- "se" => "Sweden",
- "sk" => "Slovakia",
- "sg" => "Singapore",
- "si" => "Slovenia",
- "th" => "Thailand",
- "tr" => "Turkey",
- "tw" => "Taiwan",
- "ua" => "Ukraine",
- "uk" => "United Kingdom",
- "us" => "United States",
- "za" => "South Africa",
- "xx" => "Other"
-);
-
# http://www.unicode.org/unicode/onlinedat/languages.html
$LANGUAGES = array(
'en' => 'English',
@@ -208,10 +153,9 @@
foot();
function show_country_options($cc = "") {
- global $COUNTRIES;
- reset($COUNTRIES);
- while (list($k,$v) = each($COUNTRIES)) {
- echo "<option value=\"$k\"", $cc == $k ? " selected" :
"", ">$v</option>";
+ $res = @mysql_query("SELECT id,name FROM country ORDER BY name");
+ while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) {
+ echo "<option value=\"$row[id]\"", $cc == $row['id'] ? "
selected" : "", ">$row[name]</option>";
}
}