mirror of https://github.com/BOINC/boinc.git
- web: country flags
svn path=/trunk/boinc/; revision=18390
This commit is contained in:
parent
cc47b6238f
commit
5a14204a1a
|
@ -5491,3 +5491,10 @@ David 11 June 2009
|
|||
assimilator.py
|
||||
pymw_assimilator.py
|
||||
testasm.py
|
||||
|
||||
David 11 June 2009
|
||||
- web: country flags
|
||||
|
||||
html/inc/
|
||||
countries.inc
|
||||
forum.inc
|
||||
|
|
|
@ -238,6 +238,240 @@ $countries = array(
|
|||
"Zimbabwe"
|
||||
);
|
||||
|
||||
$country_to_iso3166_2 = array (
|
||||
"Afghanistan" => "af",
|
||||
"Albania" => "al",
|
||||
"Algeria" => "dz",
|
||||
"American Samoa" => "as",
|
||||
"Andorra" => "ad",
|
||||
"Angola" => "ao",
|
||||
"Anguilla" => "ai",
|
||||
"Antarctica" => "aq",
|
||||
"Antigua and Barbuda" => "ag",
|
||||
"Argentina" => "ar",
|
||||
"Armenia" => "am",
|
||||
"Aruba" => "aw",
|
||||
"Australia" => "au",
|
||||
"Austria" => "at",
|
||||
"Azerbaijan" => "az",
|
||||
"Bahamas, The" => "bs",
|
||||
"Bahrain" => "bh",
|
||||
"Bangladesh" => "bd",
|
||||
"Barbados" => "bb",
|
||||
"Belarus" => "by",
|
||||
"Belgium" => "be",
|
||||
"Belize" => "bz",
|
||||
"Benin" => "bj",
|
||||
"Bermuda" => "bm",
|
||||
"Bhutan" => "bt",
|
||||
"Bolivia" => "bo",
|
||||
"Bosnia and Herzegovina" => "ba",
|
||||
"Botswana" => "bw",
|
||||
"Brazil" => "br",
|
||||
"British Virgin Islands" => "vg",
|
||||
"Brunei" => "bn",
|
||||
"Bulgaria" => "bg",
|
||||
"Burkina Faso" => "bf",
|
||||
"Burma" => "mm",
|
||||
"Burundi" => "bi",
|
||||
"Cambodia" => "kh",
|
||||
"Cameroon" => "cm",
|
||||
"Canada" => "ca",
|
||||
"Cape Verde" => "cv",
|
||||
"Cayman Islands" => "ky",
|
||||
"Central African Republic" => "cf",
|
||||
"Chad" => "td",
|
||||
"Channel Islands" => "gb",
|
||||
"Chile" => "cl",
|
||||
"China" => "cn",
|
||||
"Colombia" => "co",
|
||||
"Comoros" => "km",
|
||||
"Congo, Democratic Republic of the" => "cd",
|
||||
"Congo, Republic of the" => "cd",
|
||||
"Cook Islands" => "ck",
|
||||
"Costa Rica" => "cr",
|
||||
"Cote d'Ivoire" => "ci",
|
||||
"Croatia" => "hr",
|
||||
"Cuba" => "cu",
|
||||
"Cyprus" => "cy",
|
||||
"Czech Republic" => "cz",
|
||||
"Denmark" => "dk",
|
||||
"Djibouti" => "dj",
|
||||
"Dominica" => "dm",
|
||||
"Dominican Republic" => "do",
|
||||
"East Timor" => "tl",
|
||||
"Ecuador" => "ec",
|
||||
"Egypt" => "eg",
|
||||
"El Salvador" => "sv",
|
||||
"Equatorial Guinea" => "gq",
|
||||
"Eritrea" => "er",
|
||||
"Estonia" => "ee",
|
||||
"Ethiopia" => "et",
|
||||
"Falkland Islands" => "fk",
|
||||
"Faroe Islands" => "fo",
|
||||
"Fiji" => "fj",
|
||||
"Finland" => "fi",
|
||||
"France" => "fr",
|
||||
"French Guiana" => "gf",
|
||||
"French Polynesia" => "pf",
|
||||
"Gabon" => "ga",
|
||||
"Gambia, The" => "gm",
|
||||
"Gaza Strip" => "il",
|
||||
"Georgia" => "ge",
|
||||
"Germany" => "de",
|
||||
"Ghana" => "gh",
|
||||
"Gibraltar" => "gi",
|
||||
"Greece" => "gr",
|
||||
"Greenland" => "gl",
|
||||
"Grenada" => "gd",
|
||||
"Guadeloupe" => "gp",
|
||||
"Guam" => "gu",
|
||||
"Guatemala" => "gt",
|
||||
"Guinea" => "gn",
|
||||
"Guinea-Bissau" => "gw",
|
||||
"Guyana" => "gy",
|
||||
"Haiti" => "ht",
|
||||
"Holy See (Vatican City)" => "va",
|
||||
"Honduras" => "hn",
|
||||
"Hong Kong" => "hk",
|
||||
"Hungary" => "hu",
|
||||
"Iceland" => "is",
|
||||
"India" => "in",
|
||||
"Indonesia" => "id",
|
||||
"Iran" => "ir",
|
||||
"Iraq" => "iq",
|
||||
"Ireland" => "ie",
|
||||
"Isle of Man" => "im",
|
||||
"Israel" => "il",
|
||||
"Italy" => "it",
|
||||
"Jamaica" => "jm",
|
||||
"Japan" => "jp",
|
||||
"Jordan" => "jo",
|
||||
"Kazakhstan" => "kz",
|
||||
"Korea, North" => "kp",
|
||||
"Korea, South" => "kr",
|
||||
"Kenya" => "ke",
|
||||
"Kiribati" => "ki",
|
||||
"Kuwait" => "kw",
|
||||
"Kyrgyzstan" => "kg",
|
||||
"Laos" => "la",
|
||||
"Latvia" => "lv",
|
||||
"Lebanon" => "lb",
|
||||
"Lesotho" => "ls",
|
||||
"Liberia" => "lr",
|
||||
"Libya" => "ly",
|
||||
"Liechtenstein" => "li",
|
||||
"Lithuania" => "lt",
|
||||
"Luxembourg" => "lu",
|
||||
"Macau" => "mo",
|
||||
"Macedonia" => "mk",
|
||||
"Madagascar" => "mg",
|
||||
"Malawi" => "mw",
|
||||
"Malaysia" => "my",
|
||||
"Maldives" => "mv",
|
||||
"Mali" => "ml",
|
||||
"Malta" => "mt",
|
||||
"Marshall Islands" => "mh",
|
||||
"Martinique" => "mq",
|
||||
"Mauritania" => "mr",
|
||||
"Mauritius" => "mu",
|
||||
"Mexico" => "mx",
|
||||
"Micronesia" => "fm",
|
||||
"Moldova" => "md",
|
||||
"Monaco" => "mc",
|
||||
"Mongolia" => "mn",
|
||||
"Montenegro" => "me",
|
||||
"Montserrat" => "ms",
|
||||
"Morocco" => "ma",
|
||||
"Mozambique" => "mz",
|
||||
"Namibia" => "na",
|
||||
"Nauru" => "nr",
|
||||
"Nepal" => "np",
|
||||
"Netherlands" => "nl",
|
||||
"Netherlands Antilles" => "an",
|
||||
"New Caledonia" => "nc",
|
||||
"New Zealand" => "nz",
|
||||
"Nicaragua" => "ni",
|
||||
"Niger" => "ne",
|
||||
"Nigeria" => "ng",
|
||||
"Niue" => "nu",
|
||||
"Northern Mariana Islands" => "mp",
|
||||
"Norway" => "no",
|
||||
"Oman" => "om",
|
||||
"Pakistan" => "pk",
|
||||
"Palau" => "pw",
|
||||
"Panama" => "pa",
|
||||
"Papua New Guinea" => "pg",
|
||||
"Paraguay" => "py",
|
||||
"Peru" => "pe",
|
||||
"Philippines" => "ph",
|
||||
"Pitcairn Islands" => "pn",
|
||||
"Poland" => "pl",
|
||||
"Portugal" => "pt",
|
||||
"Puerto Rico" => "pr",
|
||||
"Qatar" => "qa",
|
||||
"Reunion" => "re",
|
||||
"Romania" => "ro",
|
||||
"Russia" => "ru",
|
||||
"Rwanda" => "rw",
|
||||
"Saint Kitts and Nevis" => "kn",
|
||||
"Saint Lucia" => "lc",
|
||||
"Saint Pierre and Miquelon" => "pm",
|
||||
"Saint Vincent and the Grenadines" => "vc",
|
||||
"Samoa" => "ws",
|
||||
"San Marino" => "sm",
|
||||
"Sao Tome and Principe" => "st",
|
||||
"Saudi Arabia" => "sa",
|
||||
"Senegal" => "sn",
|
||||
"Serbia" => "rs",
|
||||
"Seychelles" => "sc",
|
||||
"Sierra Leone" => "sl",
|
||||
"Singapore" => "sg",
|
||||
"Slovakia" => "sk",
|
||||
"Slovenia" => "si",
|
||||
"Solomon Islands" => "sb",
|
||||
"Somalia" => "so",
|
||||
"South Africa" => "za",
|
||||
"Spain" => "es",
|
||||
"Sri Lanka" => "lk",
|
||||
"Sudan" => "sd",
|
||||
"Suriname" => "sr",
|
||||
"Swaziland" => "sz",
|
||||
"Sweden" => "se",
|
||||
"Switzerland" => "ch",
|
||||
"Syria" => "sy",
|
||||
"Taiwan" => "ty",
|
||||
"Tajikistan" => "tj",
|
||||
"Tanzania" => "tz",
|
||||
"Thailand" => "th",
|
||||
"Togo" => "tg",
|
||||
"Tokelau" => "tk",
|
||||
"Tonga" => "tg",
|
||||
"Trinidad and Tobago" => "tt",
|
||||
"Tunisia" => "tn",
|
||||
"Turkey" => "tr",
|
||||
"Turkmenistan" => "tm",
|
||||
"Turks and Caicos Islands" => "tc",
|
||||
"Tuvalu" => "tv",
|
||||
"Uganda" => "ug",
|
||||
"Ukraine" => "ua",
|
||||
"United Arab Emirates" => "ae",
|
||||
"United Kingdom" => "gb",
|
||||
"United States" => "us",
|
||||
"Uruguay" => "uy",
|
||||
"Uzbekistan" => "uz",
|
||||
"Vanuatu" => "vu",
|
||||
"Venezuela" => "ve",
|
||||
"Vietnam" => "vn",
|
||||
"Virgin Islands" => "vg",
|
||||
"Wallis and Futuna" => "wf",
|
||||
"West Bank" => "il",
|
||||
"Western Sahara" => "eh",
|
||||
"Yemen" => "ye",
|
||||
"Zambia" => "zm",
|
||||
"Zimbabwe" => "zw"
|
||||
);
|
||||
|
||||
function print_country_select($selected_country="None") {
|
||||
global $countries;
|
||||
|
||||
|
|
|
@ -561,6 +561,17 @@ function show_post(
|
|||
echo "Credit: ".number_format($user->total_credit)."<br>";
|
||||
echo "RAC: ".number_format($user->expavg_credit)."<br>";
|
||||
}
|
||||
// to use this feature:
|
||||
// - get flags from http://www.famfamfam.com/lab/icons/flags/famfamfam_flag_icons.zip
|
||||
// - put the .png's in html/user/flags/
|
||||
// - put define(COUNTRY_FLAGS, 1) in your html/project/project.inc
|
||||
//
|
||||
if (defined(COUNTRY_FLAGS)) {
|
||||
if (array_key_exists($user->country, $country_to_iso3166_2)) {
|
||||
$code = $country_to_iso3166_2[$user->country];
|
||||
echo "Country: <img src=flags/$code.png><br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</span></div></td>";
|
||||
|
||||
|
|
Loading…
Reference in New Issue