forked from friendica/friendica-addons
[piwik] Update config file style/name
This commit is contained in:
parent
524937a830
commit
44d7a0b617
|
@ -20,20 +20,24 @@ Configuration
|
|||
|
||||
The easiest way to configure this addon is by activating the admin panels of your ~friendica server and then enter the needed details on the config page for the addon.
|
||||
|
||||
If you don't want to use the admin panel, you can configure the addon through the config/local.ini.php file.
|
||||
If you don't want to use the admin panel, you can configure the addon through the `config/local.config.php` file.
|
||||
|
||||
Open the config/local.ini.php file and add "piwik" to the list of activated addons.
|
||||
Open the `config/local.config.php` file and add "piwik" to the list of activated addons.
|
||||
|
||||
[system]
|
||||
addon = ...,piwik
|
||||
'system' => [
|
||||
...
|
||||
'addon' => '...,piwik'
|
||||
...
|
||||
]
|
||||
|
||||
You can change 4 more configuration variables for the addon in the config/addon.ini.php file:
|
||||
You can change 4 more configuration variables for the addon in the `config/addon.config.php` file:
|
||||
|
||||
[piwik]
|
||||
baseurl = example.com/piwik/
|
||||
sideid = 1
|
||||
optout = true
|
||||
async = false
|
||||
'piwik' => [
|
||||
'baseurl' => 'example.com/piwik/',
|
||||
'sideid' => 1,
|
||||
'optout' => true,
|
||||
'async' => false,
|
||||
],
|
||||
|
||||
Configuration fields
|
||||
---------------------
|
||||
|
|
29
piwik/config/piwik.config.php
Normal file
29
piwik/config/piwik.config.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
// Warning: Don't change this file! It only holds the default config values for this addon.
|
||||
// Instead overwrite these config values in config/addon.config.php in your Friendica directory
|
||||
|
||||
return [
|
||||
'piwik' => [
|
||||
// baseurl (String)
|
||||
// This URL points to your Piwik installation.
|
||||
// Use the absolute path, remember trailing slashes but ignore the protocol (http/s) part of the URL.
|
||||
// Example: baseurl = example.com/piwik/
|
||||
'baseurl' => '',
|
||||
|
||||
// siteid (Integer)
|
||||
// Change the *sideid* parameter to whatever ID you want to use for tracking your Friendica installation.
|
||||
'sideid' => '',
|
||||
|
||||
// optout (Boolean)
|
||||
// This defines whether or not a short notice about the utilization of Piwik will be displayed on every
|
||||
// page of your Friendica site (at the bottom of the page with some spacing to the other content).
|
||||
// Part of the note is a link that allows the visitor to set an opt-out cookie which will prevent visits
|
||||
// from that user be tracked by Piwik.
|
||||
'optout' => true,
|
||||
|
||||
// async (Boolean)
|
||||
// This defines whether or not to use asynchronous tracking so pages load (or appear to load) faster.
|
||||
'async' => false,
|
||||
],
|
||||
];
|
|
@ -1,29 +0,0 @@
|
|||
<?php return <<<INI
|
||||
|
||||
; Warning: Don't change this file! It only holds the default config values for this addon.
|
||||
; Instead overwrite these config values in config/addon.ini.php in your Friendica directory
|
||||
|
||||
[piwik]
|
||||
; baseurl (String)
|
||||
; This URL points to your Piwik installation.
|
||||
; Use the absolute path, remember trailing slashes but ignore the protocol (http/s) part of the URL.
|
||||
; Example: baseurl = example.com/piwik/
|
||||
baseurl =
|
||||
|
||||
; siteid (Integer)
|
||||
; Change the *sideid* parameter to whatever ID you want to use for tracking your Friendica installation.
|
||||
sideid =
|
||||
|
||||
; optout (Boolean)
|
||||
; This defines whether or not a short notice about the utilization of Piwik will be displayed on every
|
||||
; page of your Friendica site (at the bottom of the page with some spacing to the other content).
|
||||
; Part of the note is a link that allows the visitor to set an opt-out cookie which will prevent visits
|
||||
; from that user be tracked by Piwik.
|
||||
optout = true
|
||||
|
||||
; async (Boolean)
|
||||
; This defines whether or not to use asynchronous tracking so pages load (or appear to load) faster.
|
||||
async = false
|
||||
|
||||
INI;
|
||||
//Keep this line
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* Configuration:
|
||||
* Use the administration panel to configure the Piwik tracking addon, or
|
||||
* in case you don't use this add the following lines to your config/addon.ini.php
|
||||
* in case you don't use this add the following lines to your config/addon.config.php
|
||||
* file:
|
||||
*
|
||||
* [piwik]
|
||||
|
@ -53,7 +53,7 @@ function piwik_uninstall() {
|
|||
|
||||
function piwik_load_config(\Friendica\App $a)
|
||||
{
|
||||
$a->loadConfigFile(__DIR__. '/config/piwik.ini.php');
|
||||
$a->loadConfigFile(__DIR__ . '/config/piwik.config.php');
|
||||
}
|
||||
|
||||
function piwik_analytics($a,&$b) {
|
||||
|
@ -66,7 +66,7 @@ function piwik_analytics($a,&$b) {
|
|||
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->getBaseURL() . '/addon/piwik/piwik.css' . '" media="all" />';
|
||||
|
||||
/*
|
||||
* Get the configuration variables from the config/addon.ini.php file.
|
||||
* Get the configuration variables from the config/addon.config.php file.
|
||||
*/
|
||||
$baseurl = Config::get('piwik', 'baseurl');
|
||||
$siteid = Config::get('piwik', 'siteid');
|
||||
|
|
Loading…
Reference in a new issue