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:
authormattpiwik <matthieu.aubry@gmail.com>2011-02-17 03:51:14 +0300
committermattpiwik <matthieu.aubry@gmail.com>2011-02-17 03:51:14 +0300
commitdc2b9dd1d9249f3f13bb1f0e3f432e5e77601335 (patch)
tree9ad232c88d2d02d36a02377628a30724e5f4ef19 /plugins/Live/Visitor.php
parent65b1aa14ecda1c8cecb906b5bb1e1b5ade737e50 (diff)
Refs #1984 - Displaying custom variables
git-svn-id: http://dev.piwik.org/svn/trunk@3917 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/Live/Visitor.php')
-rw-r--r--plugins/Live/Visitor.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php
index 892fd88d29..a81f6161e8 100644
--- a/plugins/Live/Visitor.php
+++ b/plugins/Live/Visitor.php
@@ -42,6 +42,7 @@ class Piwik_Live_Visitor
'idVisit' => $this->getIdVisit(),
'countActions' => $this->getNumberOfActions(),
'isVisitorReturning' => $this->isVisitorReturning(),
+ 'customVariables' => $this->getCustomVariables(),
'country' => $this->getCountryName(),
'countryFlag' => $this->getCountryFlag(),
'continent' => $this->getContinent(),
@@ -154,6 +155,23 @@ class Piwik_Live_Visitor
return Piwik_ContinentTranslate($this->details['location_continent']);
}
+ function getCustomVariables()
+ {
+ $customVariables = array();
+ for($i = 1; $i <= Piwik_Tracker::MAX_CUSTOM_VARIABLES; $i++)
+ {
+ if(!empty($this->details['custom_var_k'.$i])
+ && !empty($this->details['custom_var_v'.$i]))
+ {
+ $customVariables[$i] = array(
+ 'name' => $this->details['custom_var_k'.$i],
+ 'value' => $this->details['custom_var_v'.$i],
+ );
+ }
+ }
+ return $customVariables;
+ }
+
function getRefererType()
{
return Piwik_getRefererTypeFromShortName($this->details['referer_type']);