mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Update geonames
This commit is contained in:
@@ -1,16 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2012 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
class geonames
|
class geonames
|
||||||
{
|
{
|
||||||
protected static $NamesFromId = array();
|
private $app;
|
||||||
protected static $CountryFromId = array();
|
|
||||||
protected static $CountryCodeFromId = array();
|
public function __construct(Application $app)
|
||||||
protected static $GeonameFromIp = array();
|
{
|
||||||
protected static $Searches = array();
|
$this->app = $app;
|
||||||
|
}
|
||||||
|
|
||||||
public function name_from_id($geonameid)
|
public function name_from_id($geonameid)
|
||||||
{
|
{
|
||||||
$registry = registry::get_instance();
|
$registry = $this->app['phraseanet.registry'];
|
||||||
$url = $registry->get('GV_i18n_service', 'http://localization.webservice.alchemyasp.com/')
|
$url = $registry->get('GV_i18n_service', 'http://localization.webservice.alchemyasp.com/')
|
||||||
. 'get_name.php?geonameid='
|
. 'get_name.php?geonameid='
|
||||||
. $geonameid;
|
. $geonameid;
|
||||||
@@ -36,7 +48,7 @@ class geonames
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$registry = registry::get_instance();
|
$registry = $this->app['phraseanet.registry'];
|
||||||
$url = $registry->get('GV_i18n_service', 'http://localization.webservice.alchemyasp.com/')
|
$url = $registry->get('GV_i18n_service', 'http://localization.webservice.alchemyasp.com/')
|
||||||
. 'get_name.php?geonameid='
|
. 'get_name.php?geonameid='
|
||||||
. $geonameid;
|
. $geonameid;
|
||||||
@@ -56,7 +68,7 @@ class geonames
|
|||||||
|
|
||||||
public function get_country_code($geonameid)
|
public function get_country_code($geonameid)
|
||||||
{
|
{
|
||||||
$registry = registry::get_instance();
|
$registry = $this->app['phraseanet.registry'];
|
||||||
$url = $registry->get('GV_i18n_service', 'http://localization.webservice.alchemyasp.com/')
|
$url = $registry->get('GV_i18n_service', 'http://localization.webservice.alchemyasp.com/')
|
||||||
. 'get_name.php?geonameid='
|
. 'get_name.php?geonameid='
|
||||||
. $geonameid;
|
. $geonameid;
|
||||||
@@ -95,7 +107,7 @@ class geonames
|
|||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
$registry = registry::get_instance();
|
$registry = $this->app['phraseanet.registry'];
|
||||||
$url = $registry->get('GV_i18n_service', 'http://localization.webservice.alchemyasp.com/')
|
$url = $registry->get('GV_i18n_service', 'http://localization.webservice.alchemyasp.com/')
|
||||||
. 'find_city.php?city='
|
. 'find_city.php?city='
|
||||||
. urlencode($cityName) . '&maxResult=30';
|
. urlencode($cityName) . '&maxResult=30';
|
||||||
@@ -142,7 +154,7 @@ class geonames
|
|||||||
'latitude' => ''
|
'latitude' => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
$registry = registry::get_instance();
|
$registry = $this->app['phraseanet.registry'];
|
||||||
$url = $registry->get('GV_i18n_service', 'http://localization.webservice.alchemyasp.com/')
|
$url = $registry->get('GV_i18n_service', 'http://localization.webservice.alchemyasp.com/')
|
||||||
. 'geoip.php?ip='
|
. 'geoip.php?ip='
|
||||||
. urlencode($ip);
|
. urlencode($ip);
|
||||||
|
Reference in New Issue
Block a user