mirror of
https://github.com/Findus23/plugin-ClassicCounter.git
synced 2024-09-19 15:23:45 +02:00
parent
b45ec27726
commit
196377a85a
3 changed files with 7 additions and 5 deletions
|
@ -43,6 +43,7 @@ class Controller extends \Piwik\Plugin\Controller
|
||||||
"foregroundColor" => Common::getRequestVar('foregroundColor', "f00", 'string'),
|
"foregroundColor" => Common::getRequestVar('foregroundColor', "f00", 'string'),
|
||||||
"lightColor" => Common::getRequestVar('lightColor', "222", 'string'),
|
"lightColor" => Common::getRequestVar('lightColor', "222", 'string'),
|
||||||
];
|
];
|
||||||
|
$historicValue = Common::getRequestVar('historicValue', 0, 'int');
|
||||||
try {
|
try {
|
||||||
if (!in_array($mode, $this->modes)) {
|
if (!in_array($mode, $this->modes)) {
|
||||||
$modestring = implode(", ", $this->modes);
|
$modestring = implode(", ", $this->modes);
|
||||||
|
@ -67,7 +68,7 @@ class Controller extends \Piwik\Plugin\Controller
|
||||||
$cache->save($cacheKey, $visitData, 60);
|
$cache->save($cacheKey, $visitData, 60);
|
||||||
}
|
}
|
||||||
$text = $visitData[$mode];
|
$text = $visitData[$mode];
|
||||||
$text = (int)$text;
|
$text = (int)$text + $historicValue;
|
||||||
$errorMessage = false;
|
$errorMessage = false;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$text = "Error";
|
$text = "Error";
|
||||||
|
|
|
@ -14,8 +14,9 @@ This plugin allows you to add an image showing the total amount of visits per `i
|
||||||
### Optional parameters:
|
### Optional parameters:
|
||||||
|
|
||||||
- `&mode=` one of `["nb_visits", "nb_actions", "nb_visits_converted", "bounce_count", "sum_visit_length", "max_actions", "bounce_rate", "nb_actions_per_visit", "avg_time_on_site"]` (responses from the `VisitsSummary.get` API)
|
- `&mode=` one of `["nb_visits", "nb_actions", "nb_visits_converted", "bounce_count", "sum_visit_length", "max_actions", "bounce_rate", "nb_actions_per_visit", "avg_time_on_site"]` (responses from the `VisitsSummary.get` API)
|
||||||
- `backgroundColor`: A hex color without the `#` (e.g. `f00` or `fe1234`)
|
- `&backgroundColor=`: A hex color without the `#` (e.g. `f00` or `fe1234`)
|
||||||
- `foregroundColor`
|
- `&foregroundColor=`
|
||||||
- `lightColor`
|
- `&lightColor=`
|
||||||
|
- `&historicValue=`: A number that is added to the value from Matomo before being displayed. Useful if you want to add data from a counter before starting to use Matomo.
|
||||||
|
|
||||||
<img src="https://github.com/Findus23/plugin-ClassicCounter/blob/4.x-dev/screenshots/4909.png?raw=true" height="80">
|
<img src="https://github.com/Findus23/plugin-ClassicCounter/blob/4.x-dev/screenshots/4909.png?raw=true" height="80">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "ClassicCounter",
|
"name": "ClassicCounter",
|
||||||
"description": "Embed a view counter in the style of classic CGI scripts into your website",
|
"description": "Embed a view counter in the style of classic CGI scripts into your website",
|
||||||
"version": "0.3.0",
|
"version": "0.3.1",
|
||||||
"theme": false,
|
"theme": false,
|
||||||
"require": {
|
"require": {
|
||||||
"matomo": ">=4.0.0-b1,<5.0.0-b1"
|
"matomo": ">=4.0.0-b1,<5.0.0-b1"
|
||||||
|
|
Loading…
Reference in a new issue