diff options
Diffstat (limited to 'plugins/UserCountry')
-rw-r--r-- | plugins/UserCountry/API.php | 4 | ||||
-rw-r--r-- | plugins/UserCountry/UserCountry.php | 2 | ||||
-rw-r--r-- | plugins/UserCountry/functions.php | 12 |
3 files changed, 8 insertions, 10 deletions
diff --git a/plugins/UserCountry/API.php b/plugins/UserCountry/API.php index 4043e88b88..0309dc01d8 100644 --- a/plugins/UserCountry/API.php +++ b/plugins/UserCountry/API.php @@ -76,7 +76,7 @@ class Piwik_UserCountry_API $dataTable = $this->getDataTable($recordName, $idSite, $period, $date, $segment); $separator = Piwik_UserCountry::LOCATION_SEPARATOR; - $unk = Piwik_UserCountry::UNKNOWN_CODE; + $unk = Piwik_Tracker_Visit::UNKNOWN_CODE; // split the label and put the elements into the 'region' and 'country' metadata fields $dataTable->filter('ColumnCallbackAddMetadata', @@ -119,7 +119,7 @@ class Piwik_UserCountry_API $dataTable = $this->getDataTable($recordName, $idSite, $period, $date, $segment); $separator = Piwik_UserCountry::LOCATION_SEPARATOR; - $unk = Piwik_UserCountry::UNKNOWN_CODE; + $unk = Piwik_Tracker_Visit::UNKNOWN_CODE; // split the label and put the elements into the 'city_name', 'region', 'country', // 'lat' & 'long' metadata fields diff --git a/plugins/UserCountry/UserCountry.php b/plugins/UserCountry/UserCountry.php index 7fbc4455d8..3d8e421892 100644 --- a/plugins/UserCountry/UserCountry.php +++ b/plugins/UserCountry/UserCountry.php @@ -22,8 +22,6 @@ class Piwik_UserCountry extends Piwik_Plugin const DISTINCT_COUNTRIES_METRIC = 'UserCountry_distinctCountries'; - const UNKNOWN_CODE = 'xx'; - // separate region, city & country info in stored report labels const LOCATION_SEPARATOR = '|'; diff --git a/plugins/UserCountry/functions.php b/plugins/UserCountry/functions.php index 9cf0583819..f91fedb19d 100644 --- a/plugins/UserCountry/functions.php +++ b/plugins/UserCountry/functions.php @@ -25,7 +25,7 @@ function Piwik_getFlagFromCode($code) { return $pathWithCode; } - return sprintf($pathInPiwik, Piwik_UserCountry::UNKNOWN_CODE); + return sprintf($pathInPiwik, Piwik_Tracker_Visit::UNKNOWN_CODE); } /** @@ -51,7 +51,7 @@ function Piwik_ContinentTranslate($label) */ function Piwik_CountryTranslate($label) { - if($label == Piwik_UserCountry::UNKNOWN_CODE || $label == '') + if($label == Piwik_Tracker_Visit::UNKNOWN_CODE || $label == '') { return Piwik_Translate('General_Unknown'); } @@ -126,7 +126,7 @@ function Piwik_UserCountry_getPrettyRegionName( $label ) list($regionCode, $countryCode) = explode(Piwik_UserCountry::LOCATION_SEPARATOR, $label); $result = Piwik_UserCountry_LocationProvider_GeoIp::getRegionNameFromCodes($countryCode, $regionCode); - if ($countryCode != Piwik_UserCountry::UNKNOWN_CODE && $countryCode != '') + if ($countryCode != Piwik_Tracker_Visit::UNKNOWN_CODE && $countryCode != '') { $result .= ', '.Piwik_CountryTranslate($countryCode); } @@ -160,15 +160,15 @@ function Piwik_UserCountry_getPrettyCityName( $label ) $regionCode = $parts[1]; $countryCode = $parts[2]; - if ($cityName == Piwik_UserCountry::UNKNOWN_CODE || $cityName == '') + if ($cityName == Piwik_Tracker_Visit::UNKNOWN_CODE || $cityName == '') { $cityName = Piwik_Translate('General_Unknown'); } $result = $cityName; - if ($countryCode != Piwik_UserCountry::UNKNOWN_CODE && $countryCode != '') + if ($countryCode != Piwik_Tracker_Visit::UNKNOWN_CODE && $countryCode != '') { - if ($regionCode != '' && $regionCode != Piwik_UserCountry::UNKNOWN_CODE) + if ($regionCode != '' && $regionCode != Piwik_Tracker_Visit::UNKNOWN_CODE) { $regionName = Piwik_UserCountry_LocationProvider_GeoIp::getRegionNameFromCodes($countryCode, $regionCode); $result .= ', '.$regionName; |