Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-02-16 02:28:35 +0400
committermattab <matthieu.aubry@gmail.com>2013-02-16 02:28:35 +0400
commitb9c192cd25a1c9611d6dab79000954c2e09ad84a (patch)
tree9617d012f3c6c7fcec70ce65eb33070c38747838 /plugins/Live/Visitor.php
parentb70e0240e06bc05d5ea5f39480c6860b63a66bde (diff)
Refs #1652 Adding Continent+ Country codes to Live API output for easier plotting
Diffstat (limited to 'plugins/Live/Visitor.php')
-rw-r--r--plugins/Live/Visitor.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php
index 599dcdae6b..c42ff66233 100644
--- a/plugins/Live/Visitor.php
+++ b/plugins/Live/Visitor.php
@@ -72,7 +72,9 @@ class Piwik_Live_Visitor
'daysSinceFirstVisit' => $this->getDaysSinceFirstVisit(),
'daysSinceLastEcommerceOrder' => $this->getDaysSinceLastEcommerceOrder(),
'continent' => $this->getContinent(),
+ 'continentCode' => $this->getContinentCode(),
'country' => $this->getCountryName(),
+ 'countryCode' => $this->getCountryCode(),
'countryFlag' => $this->getCountryFlag(),
'region' => $this->getRegionName(),
'city' => $this->getCityName(),
@@ -213,19 +215,29 @@ class Piwik_Live_Visitor
return strtotime($this->details['visit_last_action_time']);
}
+ function getCountryCode()
+ {
+ return $this->details['location_country'];
+ }
+
function getCountryName()
{
- return Piwik_CountryTranslate($this->details['location_country']);
+ return Piwik_CountryTranslate($this->getCountryCode());
}
function getCountryFlag()
{
- return Piwik_getFlagFromCode($this->details['location_country']);
+ return Piwik_getFlagFromCode($this->getCountryCode());
}
function getContinent()
{
- return Piwik_ContinentTranslate(Piwik_Common::getContinent($this->details['location_country']));
+ return Piwik_ContinentTranslate($this->getContinentCode());
+ }
+
+ function getContinentCode()
+ {
+ return Piwik_Common::getContinent($this->details['location_country']);
}
function getCityName()