plugins.php 1.53 KB
Newer Older
root's avatar
root committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/*********************************
	WP-Piwik::Stats:Plugins
**********************************/

	$aryConf['data'] = $this->call_API(
			'UserSettings.getPlugin', 
			$aryConf['params']['period'], 
			$aryConf['params']['date'],
			$aryConf['params']['limit']
	);
	$aryConf['title'] = __('Plugins', 'wp-piwik');
	
	$aryOverview = $this->call_API(
                'VisitsSummary.get',
                $aryConf['params']['period'],
                $aryConf['params']['date'],
                $aryConf['params']['limit']
        );

	$intTotalVisits = $aryOverview['nb_visits'];

	unset($aryOverview);

	include('header.php');
/***************************************************************************/ ?>
<div class="table">
	<table class="widefat wp-piwik-table">
		<thead>
			<tr>
				<th><?php _e('Plugins', 'wp-piwik'); ?></th>
				<th class="n"><?php _e('Visits', 'wp-piwik'); ?></th>
				<th class="n"><?php _e('Percent', 'wp-piwik'); ?></th>
			</tr>
		</thead>
		<tbody>
<?php /************************************************************************/
	foreach ($aryConf['data'] as $aryValues)
		echo '<tr><td>'.
				$aryValues['label'].
			'</td><td class="n">'.
				$aryValues['nb_visits'].
			'</td><td class="n">'.
				number_format(($aryValues['nb_visits']/$intTotalVisits*100),2).
			'%</td></tr>';
	unset($aryTmp);
/***************************************************************************/ ?>
		</tbody>
	</table>
</div>
<?php /************************************************************************/
	include ('footer.php');

/* EOF */