Created
October 12, 2012 12:13
-
-
Save halfdan/3878923 to your computer and use it in GitHub Desktop.
Piwik Plugin IPvUsage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<result> | |
<IPv6Usage_IPv4>36</IPv6Usage_IPv4> | |
<IPv6Usage_IPv6>1</IPv6Usage_IPv6> | |
</result> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getIPv6UsageByProtocol( $idSite, $period, $date ) { | |
Piwik::checkUserHasViewAccess( $idSite ); | |
$archive = Piwik_Archive::build($idSite, $period, $date ); | |
$dataTable = $archive->getDataTableFromNumeric(array( | |
'IPv6Usage_IPv4', 'IPv6Usage_IPv6' | |
)); | |
return $dataTable; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getIPv6UsageGraph( $fetch = false) | |
{ | |
$view = Piwik_ViewDataTable::factory('graphPie'); | |
$view->init($this->pluginName, __FUNCTION__, 'IPv6Usage.getIPv6UsageByProtocol'); | |
$view->setColumnTranslation('label', Piwik_Translate('IPv6Usage_IPProtocol')); | |
$view->setSortedColumn( 'label', 'asc' ); | |
$view->setLimit(2); | |
$view->setGraphLimit(2); | |
$view->disableSearchBox(); | |
$view->disableExcludeLowPopulation(); | |
$view->disableOffsetInformationAndPaginationControls(); | |
$this->setMetricsVariablesView($view); | |
return $this->renderView($view, $fetch); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Piwik_AddWidget( 'General_Visitors', 'IPv6Usage_WidgetProtocolDescription', 'IPv6Usage', 'getIPv6UsageGraph'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment