diff --git a/extras_explorerjs.js b/extras_explorerjs.js index f9c1fe16174384c89ad06aaf53cb3b4e87ba6bda..59f9f9a5f7d902e03cb91be0e938b6f490f97d2f 100755 --- a/extras_explorerjs.js +++ b/extras_explorerjs.js @@ -2,7 +2,7 @@ * Customize as you want ;) */ function callGeomap(){ - db=JSON.stringify('php/community_fixed.db'); + db=JSON.stringify('php/community.db'); if(is_empty(selections)){ // jsonparams='["all"]'; jsonparams='["unique_id"]&unique_id='+getUrlParam.nodeidparam; diff --git a/geomap2/php/countries_ISO3166.txt b/geomap2/php/countries_ISO3166.txt new file mode 100644 index 0000000000000000000000000000000000000000..ee619d2deb145f1e95b2c095f1efba4ba251859c --- /dev/null +++ b/geomap2/php/countries_ISO3166.txt @@ -0,0 +1,173 @@ +AD Andorra +AE United Arab Emirates +AF Afghanistan +AL Albania +AM Armenia +AO Angola +AR Argentina +AT Austria +AU Australia +AZ Azerbaijan +BA Bosnia and Herzegovina +BD Bangladesh +BE Belgium +BF Burkina Faso +BG Bulgaria +BI Burundi +BJ Benin +BN Brunei Darussalam +BO Plurinational State of Bolivia +BR Brazil +BT Bhutan +BW Botswana +BY Belarus +BZ Belize +CA Canada +CD The Democratic Republic of the Congo +CF Central African Republic +CG Congo +CH Switzerland +CI Ivory Coast +CL Chile +CM Cameroon +CN China +CO Colombia +CR Costa Rica +CU Cuba +CY Cyprus +CZ Czech Republic +DE Germany +DJ Djibouti +DK Denmark +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) +FR France +GA Gabon +GB United Kingdom +GE Georgia +GF French Guiana +GH Ghana +GL Greenland +GM Gambia +GN Guinea +GQ Equatorial Guinea +GR Greece +GT Guatemala +GW Guinea-Bissau +GY Guyana +HN Honduras +HR Croatia +HT Haiti +HU Hungary +ID Indonesia +IE Ireland +IL Israel +IN India +IQ Iraq +IR Islamic Republic of Iran +IS Iceland +IT Italy +JM Jamaica +JO Jordan +JP Japan +KE Kenya +KG Kyrgyzstan +KH Cambodia +KP Democratic People's Republic of Korea +KR Republic of Korea +KW Kuwait +KZ Kazakhstan +LA Lao People's Democratic Republic +LB Lebanon +LK Sri Lanka +LR Liberia +LS Lesotho +LT Lithuania +LU Luxembourg +LV Latvia +LY Libyan Arab Jamahiriya +MA Morocco +MD Republic of Moldova +MG Madagascar +MK The Former Yugoslav Republic of Macedonia +ML Mali +MM Myanmar +MN Mongolia +MR Mauritania +MW Malawi +MX Mexico +MY Malaysia +MZ Mozambique +NA Namibia +NC New Caledonia +NE Niger +NG Nigeria +NI Nicaragua +NL Netherlands +NO Norway +NP Nepal +NZ New Zealand +OM Oman +PA Panama +PE Peru +PG Papua New Guinea +PH Philippines +PK Pakistan +PL Poland +PR Puerto Rico +PS Occupied Palestinian Territory +PT Portugal +PY Paraguay +QA Qatar +RO Romania +RS Serbia +RU Russian Federation +RW Rwanda +SA Saudi Arabia +SB Solomon Islands +SD Sudan +SE Sweden +SG Singapore +SI Slovenia +SJ Svalbard and Jan Mayen +SK Slovakia +SL Sierra Leone +SN Senegal +SO Somalia +SR Suriname +SV El Salvador +SY Syrian Arab Republic +SZ Swaziland +TD Chad +TG Togo +TH Thailand +TJ Tajikistan +TL Timor-Leste +TM Turkmenistan +TN Tunisia +TR Turkey +TW Province of China Taiwan +TZ Tanzania +UA Ukraine +UG Uganda +US United States +UY Uruguay +UZ Uzbekistan +VE Bolivarian Republic of Venezuela +VN Viet Nam +VU Vanuatu +XK Kosovo +YE Yemen +ZA South Africa +ZM Zambia +ZW Zimbabwe diff --git a/geomap2/php/countries_alternatives.txt b/geomap2/php/countries_alternatives.txt new file mode 100644 index 0000000000000000000000000000000000000000..aac4307b8e829430e9853e502ef93a74cd7208ba --- /dev/null +++ b/geomap2/php/countries_alternatives.txt @@ -0,0 +1,172 @@ +AE u arab emirates +AF afghanistan +AL +AM armenia +AO +AR argentina +AT austria +AU australia Norfolk Island +AZ +BA bosnia and herzegovina +BD bangladesh +BE belgium +BF burkina faso +BG bulgaria +BI burundi +BJ benin +BN +BO la paz - bolivia Bolivia +BR 883 fundos sidil divinópolis mg brasil rua meaipe . condominio valparaiso i. bloco c1. apt 204. laranjeiras - serra- es rua itapecerica avenida josé assis de vasconcelos brazil brasil viçosa mg 325 - bethânia - ipatinga - minas gerais - brasil rio de janeiro 883 sidil divinópolis mg brasil +BT +BW botswana btbswb +BY belarus +BZ +CA canada +CD +CF +CG democratic republic of the congo democratic republic of congo congo democratic republic of +CH switzerland geneva +CI +CL chile +CM cameroun cameroon +CN shanghai china hong kong ä¸å›½ +CO colombia +CR costa rica +CU +CY +CZ +DE germany +DJ +DK denmark +DO dominican republic +DZ +EC +EE +EG egypt +EH +ER +ES spain +ET ethiopia +FI +FJ +FK +FR france guadeloupe ile de france +GA +GB united kingdom united kingdon england u.k. uk britain +GE +GF +GH ghana accraghana +GL +GM the gambia +GN +GQ +GR greece +GT guatemala guatemala city +GW +GY +HN honduras +HR +HT haiti +HU +ID yogyakarta indonesia +IE ireland +IL israel +IN 184-1 thiruvikanagar street tamilnadu st.india 184/1 thiruvikanagar .harur tk.dharmapuri.tamilnadu st dist.udalguri.p.o. dimakuchi.vill.no 2 sonajuli dharmapuri dt nagaland india harur tk & po state assam india +IQ +IR iran +IS +IT italy +JM +JO jordan +JP +KE kenyan kenya kenya. +KG kyrgyzstan +KH cambodia +KP +KR south korea +KW +KZ +LA +LB lebanon +LK sri lanka +LR +LS +LT lithuania +LU Luxemburg +LV +LY +MA +MD moldova +MG +MK macedonia +ML mali +MM +MN +MR +MW malawi +MX dona ana méxico osvaldoalbuquerque65@hotmail.com mexico +MY malaysia +MZ mozambique +NA namibia +NC +NE +NG abuja-nigeria nigeria nigeria/australia +NI +NL the netherlands and egypt netherlands the netherlands +NO norway +NP nepal +NZ new zealand +OM oman +PA panama +PE peru +PG papua new guinea +PH philippines +PK pakistan +PL +PR +PS palestine +PT +PY paraguay +QA qatar +RO romania +RS republic of serbia serbia +RU russian federation +RW rwanda +SA +SB +SD +SE sverige sweden +SG singapore +SI slovenia +SJ +SK +SL +SN +SO somalia united state somalia diaspora +SR +SV el salvador +SY +SZ swaziland +TD +TG togo +TH thailand +TJ +TL +TM +TN +TR uftu turkey +TW taiwan +TZ tanzania in east africa tanzania usa & tanzania +UA Украина.ОдеÑÑа +UG uganda-africa uganda +US united state of america united states of america 17 dennison st usa united states atlanta ga waltham ma us u.s.a. america +UY +UZ +VE venezuela +VN vietnam +VU +XK kosovo +YE +ZA republic of south africa south africa +ZM zambia and south africa zambia +ZW zimbabwe diff --git a/geomap2/php/mapael.php b/geomap2/php/mapael.php index 66979984b688fb5d42c3d791159944e365481e22..b0b8c859587dab2c8508890c7a67a2c003f14fcd 100644 --- a/geomap2/php/mapael.php +++ b/geomap2/php/mapael.php @@ -15,7 +15,7 @@ include('countries_iso3166.php'); $sql=""; $table="scholars"; -$column="norm_country"; +$column="country"; $query = str_replace( '__and__', '&', $_GET["query"] ); $query = str_replace( 'D::', '', $query ); $elems = json_decode($query); @@ -23,8 +23,6 @@ $elems = json_decode($query); $unique_id = ""; $scholar_array = array(); - - $singularnick= "scholar"; $pluralnick = "scholars"; @@ -59,7 +57,7 @@ if(count($elems)==1){ $elems = array(); foreach($scholar_array as $key=>$value){ - array_push($elems, utf8_decode($key)); + array_push($elems, $key); } } break; @@ -70,23 +68,41 @@ if(count($elems)==1){ $norm_country = array(); +$InvIndCC = array(); + +$directory = '.'; + +if (! is_dir($directory)) { + exit('Invalid diretory path'); +} +foreach (scandir($directory) as $file) { + if ('.' === $file) continue; + if ('..' === $file) continue; + if(pathinfo($file, PATHINFO_EXTENSION)=="txt") { + extractIndexes( $file ); + } +} if($selectiveQuery){ $countries_temp=array(); foreach($elems as $e){ $sql="SELECT ".$column." FROM ".$table." where id=".$e; if($unique_id!="") - $sql="SELECT ".$column." FROM ".$table." where unique_id=\"".$e."\""; - + $sql="SELECT ".$column." FROM ".$table." where unique_id=\"".$e."\""; + + // echo $sql."\n"; foreach ($base->query($sql) as $row) { - - if($countries_temp[$row[$column]]) $countries_temp[$row[$column]]+=1; - else $countries_temp[$row[$column]]=1; + $cc = $InvIndCC [ $row[$column] ]; + // echo "\t".$row[$column]."\n"; + if($countries_temp[$cc]) $countries_temp[$cc]+=1; + else $countries_temp[$cc]=1; } } arsort($countries_temp); + // var_dump($countries_temp); + foreach ($countries_temp as $key => $value) { $code = strtoupper($key); if($CC[$code]){ @@ -205,6 +221,7 @@ if($selectiveQuery){ } } + $occToCC = array(); foreach ($norm_country as $c) { if (!$occToCC[$c["value"]]) { @@ -213,9 +230,6 @@ foreach ($norm_country as $c) { array_push($occToCC[$c["value"]], $c["code"]); } - - - krsort($occToCC); $countries_occ_DESC = array(); foreach ($occToCC as $key => $value) { @@ -332,4 +346,27 @@ function pr($msg) { echo $msg . "\n"; } +function extractIndexes( $dictname ) { + + $myfile = fopen($dictname, "r"); + + global $InvIndCC; + + while(!feof($myfile)) { + + $line = fgets($myfile); + + $line = str_replace("\n","",$line); + + $raw = array_filter( explode("\t", $line) , "strlen" ); + + foreach ($raw as $key=>$value) { + if($key>0) { + $InvIndCC[$value] = $raw[0]; + } + } + } + fclose($myfile); +} + ?> diff --git a/php/community.db b/php/community.db old mode 100644 new mode 100755 index 8c9b36fc5ce921d4e3f32b4651f657cd7dafe29e..e6efeb2d8458de3a38df9b283946d0490a6bedea Binary files a/php/community.db and b/php/community.db differ diff --git a/tinawebJS/js/main.js b/tinawebJS/js/main.js index 378678cc9875c84bc8c99886747872a1ab28d4d3..f28310d16b961470f4668ea9ead8d1b6da5185a2 100755 --- a/tinawebJS/js/main.js +++ b/tinawebJS/js/main.js @@ -454,7 +454,8 @@ function theListeners(){ if(is_empty(actualSel) || i==0){ pr("cursor radius ON, mouseDown -> selecciones vacias"); - cancelSelection(false); + cancelSelection(false); + // $("#names").html(""); // $("#opossiteNodes").html(""); @@ -474,6 +475,7 @@ function theListeners(){ } partialGraph.draw(); + trackMouse(); }