X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=piwik%2Fpiwik.php;h=7a1cb5813776a001100e333a31122f2db2f1f42b;hb=3d0a8b45b5b74e9a859094d06e72aaa8e3162785;hp=9ba15db63f9e7dd35445f8cae10d3ef2daad8038;hpb=6272aed8f262566893d21ab77e53a0c49fa0836b;p=friendica-addons.git diff --git a/piwik/piwik.php b/piwik/piwik.php index 9ba15db6..7a1cb581 100755 --- a/piwik/piwik.php +++ b/piwik/piwik.php @@ -2,8 +2,8 @@ /** * Name: Piwik Analytics * Description: Piwik Analytics Plugin for Friendica - * Version: 1.1 - * Author: Tobias Diekershoff + * Version: 1.2 + * Author: Tobias Diekershoff * Author: Klaus Weidenbach */ @@ -15,7 +15,9 @@ * License: 3-clause BSD license * * Configuration: - * Add the following lines to your .htconfig.php file: + * Use the administration panel to configure the Piwik tracking addon, or + * in case you don't use this add the following lines to your .htconfig.php + * file: * * $a->config['piwik']['baseurl'] = 'www.example.com/piwik/'; * $a->config['piwik']['siteid'] = '1'; @@ -26,8 +28,6 @@ * installation has. Alter the baseurl to fit your needs, don't care * about http/https but beware to put the trailing / at the end of your * setting. - * - * Documentation see http://diekershoff.homeunix.net/redmine/wiki/friendikaplugin/Piwik_Plugin */ function piwik_install() { @@ -64,10 +64,10 @@ function piwik_analytics($a,&$b) { * If async is set to true use asynchronous tracking */ if ($async) { - $a->page['htmlhead'] .= " \r\n\r\n"; + $b .= " \r\n"; $b .= "
\r\n\r\n
"; } else { - $b .= "
\r\n \r\n\r\n\r\n
"; + $b .= " \r\n"; } /* @@ -79,14 +79,14 @@ function piwik_analytics($a,&$b) { $b .= t("This website is tracked using the Piwik analytics tool."); $b .= " "; $the_url = "http://".$baseurl ."index.php?module=CoreAdminHome&action=optOut"; - $b .= sprintf(t("If you do not want that your visits are logged this way you can set a cookie to prevent Piwik from tracking further visits of the site (opt-out)."), $the_url); + $b .= sprintf(t("If you do not want that your visits are logged in this way you can set a cookie to prevent Piwik from tracking further visits of the site (opt-out)."), $the_url); $b .= ""; } } function piwik_plugin_admin (&$a, &$o) { - $t = file_get_contents( dirname(__file__)."/admin.tpl"); + $t = get_markup_template( "admin.tpl", "addon/piwik/" ); $o = replace_macros( $t, array( - '$submit' => t('Submit'), + '$submit' => t('Save Settings'), '$baseurl' => array('baseurl', t('Piwik Base URL'), get_config('piwik','baseurl' ), t('Absolute path to your Piwik installation. (without protocol (http/s), with trailing slash)')), '$siteid' => array('siteid', t('Site ID'), get_config('piwik','siteid' ), ''), '$optout' => array('optout', t('Show opt-out cookie link?'), get_config('piwik','optout' ), ''),