Sondage du mois

Sondage du mois
 

  La connaissance ne vaut que si elle est partagée par tous




 
  Astuce Adobe Flash : Raccourci Distribuer aux couches : Ctrl Maj D




Infos de Igixcs

Voir sa Fiche Membre

  • Blog conçu le : 27 Juin 2008
  • Nombre d'articles : 9
  • Nombre de pages vues : 10154
  • Adresse Email :

Les articles du blog

Blog de Igixcs
IgiX le POURIS
Blog de Igixcs - FamFamFam flags>php
le 31/01/2009 à 17h04 - 6 commentaires   

FamFamFam flags>php

3/5 (1 votes)

Plop!
Voilà sur famfamfam j'ai trouvé sympa leurs icônes flags et du coups j'poste si y en a qui veulent le bout de code que j'me suis farci pour un traitement sur les flags :p
Clique ici pour afficher le message caché
CODE PHP


<?php

/* PHP by IgiX naabzoor
Flags : http://www.famfamfam.com/lab/icons/flags/ */
$flags = array('AD' => 'Andorra ',
'AE' => 'United Arab Emirates ',
'AF' => 'Afghanistan ',
'AG' => 'Antigua and Barbuda ',
'AI' => 'Anguilla ',
'AL' => 'Albania ',
'AM' => 'Armenia ',
'AN' => 'Netherlands Antilles ',
'AO' => 'Angola ',
'AR' => 'Argentina ',
'AS' => 'American Samoa ',
'AT' => 'Austria ',
'AU' => 'Australia ',
'AW' => 'Aruba ',
'AX' => 'Åland Islands ',
'AZ' => 'Azerbaijan ',
'BA' => 'Bosnia and Herzegovina ',
'BB' => 'Barbados ',
'BD' => 'Bangladesh ',
'BE' => 'Belgium ',
'BF' => 'Burkina Faso ',
'BG' => 'Bulgaria ',
'BH' => 'Bahrain ',
'BI' => 'Burundi ',
'BJ' => 'Benin ',
'BM' => 'Bermuda ',
'BN' => 'Brunei Darussalam ',
'BO' => 'Bolivia ',
'BR' => 'Brazil ',
'BS' => 'Bahamas ',
'BT' => 'Bhutan ',
'BV' => 'Bouvet Island ',
'BW' => 'Botswana ',
'BY' => 'Belarus ',
'BZ' => 'Belize ',
'CA' => 'Canada ',
'CC' => 'Cocos (Keeling) Islands ',
'CD' => 'The Democratic Republic of the Congo ',
'CF' => 'Central African Republic ',
'CG' => 'Congo ',
'CH' => 'Switzerland ',
'CI' => 'Cote d'Ivoire ',
'CK' => 'Cook Islands ',
'CL' => 'Chile ',
'CM' => 'Cameroon ',
'CN' => 'China ',
'CO' => 'Colombia ',
'CR' => 'Costa Rica ',
'CU' => 'Cuba ',
'CV' => 'Cape Verde ',
'CX' => 'Christmas Island ',
'CY' => 'Cyprus ',
'CZ' => 'Czech Republic ',
'DE' => 'Germany ',
'DJ' => 'Djibouti ',
'DK' => 'Denmark ',
'DM' => 'Dominica ',
'DO' => 'Dominican Republic ',
'DZ' => 'Algeria ',
'EC' => 'Ecuador ',
'EE' => 'Estonia ',
'EG' => 'Egypt ',
'EH' => 'Western Sahara ',
'ER' => 'Eritrea ',
'ES' => 'Spain ',
'ET' => 'Ethiopia ',
'FI' => 'Finland ',
'FJ' => 'Fiji ',
'FK' => 'Falkland Islands (Malvinas) ',
'FM' => 'Federated States of Micronesia ',
'FO' => 'Faroe Islands ',
'FR' => 'France ',
'GA' => 'Gabon ',
'GB' => 'United Kingdom ',
'GD' => 'Grenada ',
'GE' => 'Georgia ',
'GF' => 'French Guiana ',
'GG' => 'Guernsey ',
'GH' => 'Ghana ',
'GI' => 'Gibraltar ',
'GL' => 'Greenland ',
'GM' => 'Gambia ',
'GN' => 'Guinea ',
'GP' => 'Guadeloupe ',
'GQ' => 'Equatorial Guinea ',
'GR' => 'Greece ',
'GS' => 'South Georgia and the South Sandwich Islands ',
'GT' => 'Guatemala ',
'GU' => 'Guam ',
'GW' => 'Guinea-Bissau ',
'GY' => 'Guyana ',
'HK' => 'Hong Kong ',
'HM' => 'Heard Island and McDonald Islands ',
'HN' => 'Honduras ',
'HR' => 'Croatia ',
'HT' => 'Haiti ',
'HU' => 'Hungary ',
'ID' => 'Indonesia ',
'IE' => 'Ireland ',
'IL' => 'Israel ',
'IN' => 'India ',
'IO' => 'British Indian Ocean Territory ',
'IQ' => 'Iraq ',
'IR' => 'Islamic Republic of Iran ',
'IS' => 'Iceland ',
'IT' => 'Italy ',
'JM' => 'Jamaica ',
'JO' => 'Jordan ',
'JP' => 'Japan ',
'KE' => 'Kenya ',
'KG' => 'Kyrgyzstan ',
'KH' => 'Cambodia ',
'KI' => 'Kiribati ',
'KM' => 'Comoros ',
'KN' => 'Saint Kitts and Nevis ',
'KP' => 'Democratic People's Republic of Korea ',
'KR' => 'Republic of Korea ',
'KW' => 'Kuwait ',
'KY' => 'Cayman Islands ',
'KZ' => 'Kazakhstan ',
'LA' => 'Lao People's Democratic Republic ',
'LB' => 'Lebanon ',
'LC' => 'Saint Lucia ',
'LI' => 'Liechtenstein ',
'LK' => 'Sri Lanka ',
'LR' => 'Liberia ',
'LS' => 'Lesotho ',
'LT' => 'Lithuania ',
'LU' => 'Luxembourg ',
'LV' => 'Latvia ',
'LY' => 'Libyan Arab Jamahiriya ',
'MA' => 'Morocco ',
'MC' => 'Monaco ',
'MD' => 'Moldova ',
'ME' => 'Montenegro ',
'MG' => 'Madagascar ',
'MH' => 'Marshall Islands ',
'MK' => 'the former Yugoslav Republic of Macedonia ',
'ML' => 'Mali ',
'MM' => 'Myanmar ',
'MN' => 'Mongolia ',
'MO' => 'Macao ',
'MP' => 'Northern Mariana Islands ',
'MQ' => 'Martinique ',
'MR' => 'Mauritania ',
'MS' => 'Montserrat ',
'MT' => 'Malta ',
'MU' => 'Mauritius ',
'MV' => 'Maldives ',
'MW' => 'Malawi ',
'MX' => 'Mexico ',
'MY' => 'Malaysia ',
'MZ' => 'Mozambique ',
'NA' => 'Namibia ',
'NC' => 'New Caledonia ',
'NE' => 'Niger ',
'NF' => 'Norfolk Island ',
'NG' => 'Nigeria ',
'NI' => 'Nicaragua ',
'NL' => 'Netherlands ',
'NO' => 'Norway ',
'NP' => 'Nepal ',
'NR' => 'Nauru ',
'NU' => 'Niue ',
'NZ' => 'New Zealand ',
'OM' => 'Oman ',
'PA' => 'Panama ',
'PE' => 'Peru ',
'PF' => 'French Polynesia ',
'PG' => 'Papua New Guinea ',
'PH' => 'Philippines ',
'PK' => 'Pakistan ',
'PL' => 'Poland ',
'PM' => 'Saint Pierre and Miquelon ',
'PN' => 'Pitcairn ',
'PR' => 'Puerto Rico ',
'PS' => 'Occupied Palestinian Territory ',
'PT' => 'Portugal ',
'PW' => 'Palau ',
'PY' => 'Paraguay ',
'QA' => 'Qatar ',
'RE' => 'Réunion ',
'RO' => 'Romania ',
'RS' => 'Serbia ',
'RU' => 'Russian Federation ',
'RW' => 'Rwanda ',
'SA' => 'Saudi Arabia ',
'SB' => 'Solomon Islands ',
'SC' => 'Seychelles ',
'SD' => 'Sudan ',
'SE' => 'Sweden ',
'SG' => 'Singapore ',
'SH' => 'Saint Helena ',
'SI' => 'Slovenia ',
'SJ' => 'Svalbard and Jan Mayen ',
'SK' => 'Slovakia ',
'SL' => 'Sierra Leone ',
'SM' => 'San Marino ',
'SN' => 'Senegal ',
'SO' => 'Somalia ',
'SR' => 'Suriname ',
'ST' => 'Sao Tome and Principe ',
'SV' => 'El Salvador ',
'SY' => 'Syrian Arab Republic ',
'SZ' => 'Swaziland ',
'TC' => 'Turks and Caicos Islands ',
'TD' => 'Chad ',
'TF' => 'French Southern Territories ',
'TG' => 'Togo ',
'TH' => 'Thailand ',
'TJ' => 'Tajikistan ',
'TK' => 'Tokelau ',
'TL' => 'Timor-Leste ',
'TM' => 'Turkmenistan ',
'TN' => 'Tunisia ',
'TO' => 'Tonga ',
'TR' => 'Turkey ',
'TT' => 'Trinidad and Tobago ',
'TV' => 'Tuvalu ',
'TW' => 'Province of China Taiwan ',
'TZ' => 'United Republic of Tanzania ',
'UA' => 'Ukraine ',
'UG' => 'Uganda ',
'UM' => 'United States Minor Outlying Islands ',
'US' => 'United States ',
'UY' => 'Uruguay ',
'UZ' => 'Uzbekistan ',
'VA' => 'Holy See (Vatican City State) ',
'VC' => 'Saint Vincent and the Grenadines ',
'VE' => 'Venezuela ',
'VG' => 'British Virgin Islands ',
'VI' => 'Virgin Islands, U.S. ',
'VN' => 'Viet Nam ',
'VU' => 'Vanuatu ',
'WF' => 'Wallis and Futuna ',
'WS' => 'Samoa ',
'YE' => 'Yemen ',
'YT' => 'Mayotte ',
'ZA' => 'South Africa ',
'ZM' => 'Zambia ',
'ZW' => 'Zimbabwe');
foreach($flags as $flag => $pays)
echo '<img src="./'.strtolower($flag).'.png" alt="'.$pays.'"/> '.$pays."<br />n";
?>



en bonus une fonction bien pratique pour les formulaires :p
Clique ici pour afficher le message caché
CODE PHP


<?php
function liste_flag($select, $name='flag', $id='flag', $id_prev = 'flag_prev'){
/* PHP by IgiX naabzoor
Flags : http://www.famfamfam.com/lab/icons/flags/ */
$flags = array('AD' => 'Andorra ',
'AE' => 'United Arab Emirates ',
'AF' => 'Afghanistan ',
'AG' => 'Antigua and Barbuda ',
'AI' => 'Anguilla ',
'AL' => 'Albania ',
'AM' => 'Armenia ',
'AN' => 'Netherlands Antilles ',
'AO' => 'Angola ',
'AR' => 'Argentina ',
'AS' => 'American Samoa ',
'AT' => 'Austria ',
'AU' => 'Australia ',
'AW' => 'Aruba ',
'AX' => 'Åland Islands ',
'AZ' => 'Azerbaijan ',
'BA' => 'Bosnia and Herzegovina ',
'BB' => 'Barbados ',
'BD' => 'Bangladesh ',
'BE' => 'Belgium ',
'BF' => 'Burkina Faso ',
'BG' => 'Bulgaria ',
'BH' => 'Bahrain ',
'BI' => 'Burundi ',
'BJ' => 'Benin ',
'BM' => 'Bermuda ',
'BN' => 'Brunei Darussalam ',
'BO' => 'Bolivia ',
'BR' => 'Brazil ',
'BS' => 'Bahamas ',
'BT' => 'Bhutan ',
'BV' => 'Bouvet Island ',
'BW' => 'Botswana ',
'BY' => 'Belarus ',
'BZ' => 'Belize ',
'CA' => 'Canada ',
'CC' => 'Cocos (Keeling) Islands ',
'CD' => 'The Democratic Republic of the Congo ',
'CF' => 'Central African Republic ',
'CG' => 'Congo ',
'CH' => 'Switzerland ',
'CI' => 'Cote d'Ivoire ',
'CK' => 'Cook Islands ',
'CL' => 'Chile ',
'CM' => 'Cameroon ',
'CN' => 'China ',
'CO' => 'Colombia ',
'CR' => 'Costa Rica ',
'CU' => 'Cuba ',
'CV' => 'Cape Verde ',
'CX' => 'Christmas Island ',
'CY' => 'Cyprus ',
'CZ' => 'Czech Republic ',
'DE' => 'Germany ',
'DJ' => 'Djibouti ',
'DK' => 'Denmark ',
'DM' => 'Dominica ',
'DO' => 'Dominican Republic ',
'DZ' => 'Algeria ',
'EC' => 'Ecuador ',
'EE' => 'Estonia ',
'EG' => 'Egypt ',
'EH' => 'Western Sahara ',
'ER' => 'Eritrea ',
'ES' => 'Spain ',
'ET' => 'Ethiopia ',
'FI' => 'Finland ',
'FJ' => 'Fiji ',
'FK' => 'Falkland Islands (Malvinas) ',
'FM' => 'Federated States of Micronesia ',
'FO' => 'Faroe Islands ',
'FR' => 'France ',
'GA' => 'Gabon ',
'GB' => 'United Kingdom ',
'GD' => 'Grenada ',
'GE' => 'Georgia ',
'GF' => 'French Guiana ',
'GG' => 'Guernsey ',
'GH' => 'Ghana ',
'GI' => 'Gibraltar ',
'GL' => 'Greenland ',
'GM' => 'Gambia ',
'GN' => 'Guinea ',
'GP' => 'Guadeloupe ',
'GQ' => 'Equatorial Guinea ',
'GR' => 'Greece ',
'GS' => 'South Georgia and the South Sandwich Islands ',
'GT' => 'Guatemala ',
'GU' => 'Guam ',
'GW' => 'Guinea-Bissau ',
'GY' => 'Guyana ',
'HK' => 'Hong Kong ',
'HM' => 'Heard Island and McDonald Islands ',
'HN' => 'Honduras ',
'HR' => 'Croatia ',
'HT' => 'Haiti ',
'HU' => 'Hungary ',
'ID' => 'Indonesia ',
'IE' => 'Ireland ',
'IL' => 'Israel ',
'IN' => 'India ',
'IO' => 'British Indian Ocean Territory ',
'IQ' => 'Iraq ',
'IR' => 'Islamic Republic of Iran ',
'IS' => 'Iceland ',
'IT' => 'Italy ',
'JM' => 'Jamaica ',
'JO' => 'Jordan ',
'JP' => 'Japan ',
'KE' => 'Kenya ',
'KG' => 'Kyrgyzstan ',
'KH' => 'Cambodia ',
'KI' => 'Kiribati ',
'KM' => 'Comoros ',
'KN' => 'Saint Kitts and Nevis ',
'KP' => 'Democratic People's Republic of Korea ',
'KR' => 'Republic of Korea ',
'KW' => 'Kuwait ',
'KY' => 'Cayman Islands ',
'KZ' => 'Kazakhstan ',
'LA' => 'Lao People's Democratic Republic ',
'LB' => 'Lebanon ',
'LC' => 'Saint Lucia ',
'LI' => 'Liechtenstein ',
'LK' => 'Sri Lanka ',
'LR' => 'Liberia ',
'LS' => 'Lesotho ',
'LT' => 'Lithuania ',
'LU' => 'Luxembourg ',
'LV' => 'Latvia ',
'LY' => 'Libyan Arab Jamahiriya ',
'MA' => 'Morocco ',
'MC' => 'Monaco ',
'MD' => 'Moldova ',
'ME' => 'Montenegro ',
'MG' => 'Madagascar ',
'MH' => 'Marshall Islands ',
'MK' => 'the former Yugoslav Republic of Macedonia ',
'ML' => 'Mali ',
'MM' => 'Myanmar ',
'MN' => 'Mongolia ',
'MO' => 'Macao ',
'MP' => 'Northern Mariana Islands ',
'MQ' => 'Martinique ',
'MR' => 'Mauritania ',
'MS' => 'Montserrat ',
'MT' => 'Malta ',
'MU' => 'Mauritius ',
'MV' => 'Maldives ',
'MW' => 'Malawi ',
'MX' => 'Mexico ',
'MY' => 'Malaysia ',
'MZ' => 'Mozambique ',
'NA' => 'Namibia ',
'NC' => 'New Caledonia ',
'NE' => 'Niger ',
'NF' => 'Norfolk Island ',
'NG' => 'Nigeria ',
'NI' => 'Nicaragua ',
'NL' => 'Netherlands ',
'NO' => 'Norway ',
'NP' => 'Nepal ',
'NR' => 'Nauru ',
'NU' => 'Niue ',
'NZ' => 'New Zealand ',
'OM' => 'Oman ',
'PA' => 'Panama ',
'PE' => 'Peru ',
'PF' => 'French Polynesia ',
'PG' => 'Papua New Guinea ',
'PH' => 'Philippines ',
'PK' => 'Pakistan ',
'PL' => 'Poland ',
'PM' => 'Saint Pierre and Miquelon ',
'PN' => 'Pitcairn ',
'PR' => 'Puerto Rico ',
'PS' => 'Occupied Palestinian Territory ',
'PT' => 'Portugal ',
'PW' => 'Palau ',
'PY' => 'Paraguay ',
'QA' => 'Qatar ',
'RE' => 'Réunion ',
'RO' => 'Romania ',
'RS' => 'Serbia ',
'RU' => 'Russian Federation ',
'RW' => 'Rwanda ',
'SA' => 'Saudi Arabia ',
'SB' => 'Solomon Islands ',
'SC' => 'Seychelles ',
'SD' => 'Sudan ',
'SE' => 'Sweden ',
'SG' => 'Singapore ',
'SH' => 'Saint Helena ',
'SI' => 'Slovenia ',
'SJ' => 'Svalbard and Jan Mayen ',
'SK' => 'Slovakia ',
'SL' => 'Sierra Leone ',
'SM' => 'San Marino ',
'SN' => 'Senegal ',
'SO' => 'Somalia ',
'SR' => 'Suriname ',
'ST' => 'Sao Tome and Principe ',
'SV' => 'El Salvador ',
'SY' => 'Syrian Arab Republic ',
'SZ' => 'Swaziland ',
'TC' => 'Turks and Caicos Islands ',
'TD' => 'Chad ',
'TF' => 'French Southern Territories ',
'TG' => 'Togo ',
'TH' => 'Thailand ',
'TJ' => 'Tajikistan ',
'TK' => 'Tokelau ',
'TL' => 'Timor-Leste ',
'TM' => 'Turkmenistan ',
'TN' => 'Tunisia ',
'TO' => 'Tonga ',
'TR' => 'Turkey ',
'TT' => 'Trinidad and Tobago ',
'TV' => 'Tuvalu ',
'TW' => 'Province of China Taiwan ',
'TZ' => 'United Republic of Tanzania ',
'UA' => 'Ukraine ',
'UG' => 'Uganda ',
'UM' => 'United States Minor Outlying Islands ',
'US' => 'United States ',
'UY' => 'Uruguay ',
'UZ' => 'Uzbekistan ',
'VA' => 'Holy See (Vatican City State) ',
'VC' => 'Saint Vincent and the Grenadines ',
'VE' => 'Venezuela ',
'VG' => 'British Virgin Islands ',
'VI' => 'Virgin Islands, U.S. ',
'VN' => 'Viet Nam ',
'VU' => 'Vanuatu ',
'WF' => 'Wallis and Futuna ',
'WS' => 'Samoa ',
'YE' => 'Yemen ',
'YT' => 'Mayotte ',
'ZA' => 'South Africa ',
'ZM' => 'Zambia ',
'ZW' => 'Zimbabwe');
echo '<select name="'.$name.'" id="'.$id.'" >', "n";
foreach($flags as $flag => $pays){
$changement = 'document.getElementById(''.$id_prev.'').src='./images/flag/'.strtolower($flag).'.png'';
if($select == $flag) $selected='selected="selected"';
else $selected = '';
echo '<option onmouseover='.$changement.' onclick='.$changement.' onselect='.$changement.' '.$selected.' value="'.$flag.'">'.$pays."</option>n";
}
echo '</select>';
}





Partager sur Twitter

Commentaires

Percoman, le 31/01/2009 à 19h11
  je préfère parcourir mon dossier de flags, car sinon si à chaque fois que tu veux rajouter un pays tu dois éditer ton fichier pour l'ajouter dans ton tableau c'est un peu chiant à force.



Igixcs, le 31/01/2009 à 19h53
  mouai, mais là y en a un paquet :p, m'ai c'est juste une ligne à rajouter ^^ ou sinon, dans un fichier xml :)



Percoman, le 01/02/2009 à 11h05
  oué enfin c'est pareil le fichier xml, tu dois ajouter le drapeau dans son dossier, modifier le xml et le uploader.



Igixcs, le 01/02/2009 à 17h51
  roh, go create un fichier upload.flag.php et tu fais les stats avec ton graph (cf forum) pour voir à quelle frequence on upload :p



Percoman, le 01/02/2009 à 18h57
  mdr



SaTurN1, le 01/02/2009 à 19h52
  lol igix tu devais te faire shier pour faire sa ^_^



Vous devez être membre pour poster des commentaires sur le site.

DERNIÈRES PUBLICATIONS DE OPEN-MOUTHED

En direct de open-mouthed.com