diff options
Diffstat (limited to 'plugins/PiwikAnalytics')
10 files changed, 373 insertions, 0 deletions
diff --git a/plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php b/plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php new file mode 100644 index 000000000..777fd9c5d --- /dev/null +++ b/plugins/PiwikAnalytics/PiwikAnalyticsPlugin.php @@ -0,0 +1,108 @@ +<?php +/** + * StatusNet, the distributed open-source microblogging tool + * + * Plugin to use Piwik Analytics + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Plugin + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Tobias Diekershoff <tobias.diekershoff@gmx.net> + * @copyright 2008 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + exit(1); +} + +/** + * Plugin to use Piwik Analytics (based on the Google Analytics plugin by Evan) + * + * This plugin will spoot out the correct JavaScript spell to invoke + * Piwik Analytics on a page. + * + * To use this plugin add the following to your config.php + * + * addPlugin('PiwikAnalytics', array('piwikroot' => 'example.com/piwik/', + * 'piwikId' => 'id')); + * + * Replace 'example.com/piwik/' with the URL to your Piwik installation and + * make sure you don't forget the final /. + * Replace 'id' with the ID your statusnet installation has in your Piwik + * analytics setup - for example '8'. + * + */ +class PiwikAnalyticsPlugin extends Plugin +{ + /** the base of your Piwik installation */ + public $piwikroot = null; + /** the Piwik Id of your statusnet installation */ + public $piwikId = null; + + /** + * constructor + * + * @param string $root Piwik root URL + * @param string $id Piwik ID of this app + */ + function __construct($root=null, $id=null) + { + $this->piwikroot = $root; + $this->piwikId = $id; + parent::__construct(); + } + + /** + * Called when all scripts have been shown + * + * @param Action $action Current action + * + * @return boolean ignored + */ + function onEndShowScripts($action) + { + $piwikCode1 = <<<ENDOFPIWIK +var pkBaseURL = (("https:" == document.location.protocol) ? "https://{$this->piwikroot}" : "http://{$this->piwikroot}"); +document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); +ENDOFPIWIK; + $piwikCode2 = <<<ENDOFPIWIK +try { + var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", {$this->piwikId}); + piwikTracker.trackPageView(); + piwikTracker.enableLinkTracking(); +} catch( err ) {} +ENDOFPIWIK; + + $action->inlineScript($piwikCode1); + $action->inlineScript($piwikCode2); + return true; + } + + function onPluginVersion(&$versions) + { + $versions[] = array('name' => 'PiwikAnalytics', + 'version' => STATUSNET_VERSION, + 'author' => 'Tobias Diekershoff, Evan Prodromou', + 'homepage' => 'http://status.net/wiki/Plugin:Piwik', + 'rawdescription' => + _m('Use <a href="http://piwik.org/">Piwik</a> Open Source web analytics software.')); + return true; + } +} diff --git a/plugins/PiwikAnalytics/locale/PiwikAnalytics.pot b/plugins/PiwikAnalytics/locale/PiwikAnalytics.pot new file mode 100644 index 000000000..f9491cc4b --- /dev/null +++ b/plugins/PiwikAnalytics/locale/PiwikAnalytics.pot @@ -0,0 +1,23 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: PiwikAnalyticsPlugin.php:105 +msgid "" +"Use <a href=\"http://piwik.org/\">Piwik</a> Open Source web analytics " +"software." +msgstr "" diff --git a/plugins/PiwikAnalytics/locale/es/LC_MESSAGES/PiwikAnalytics.po b/plugins/PiwikAnalytics/locale/es/LC_MESSAGES/PiwikAnalytics.po new file mode 100644 index 000000000..a809ea1b6 --- /dev/null +++ b/plugins/PiwikAnalytics/locale/es/LC_MESSAGES/PiwikAnalytics.po @@ -0,0 +1,30 @@ +# Translation of StatusNet - PiwikAnalytics to Spanish (Español) +# Expored from translatewiki.net +# +# Author: Translationista +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - PiwikAnalytics\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:57:16+0000\n" +"Language-Team: Spanish <http://translatewiki.net/wiki/Portal:es>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-10-01 20:39:02+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: es\n" +"X-Message-Group: #out-statusnet-plugin-piwikanalytics\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: PiwikAnalyticsPlugin.php:105 +msgid "" +"Use <a href=\"http://piwik.org/\">Piwik</a> Open Source web analytics " +"software." +msgstr "" +"Utiliza el software de análisis de sitios Web de fuente abierta <a href=" +"\"http://piwik.org/\">Piwik</a>." diff --git a/plugins/PiwikAnalytics/locale/fr/LC_MESSAGES/PiwikAnalytics.po b/plugins/PiwikAnalytics/locale/fr/LC_MESSAGES/PiwikAnalytics.po new file mode 100644 index 000000000..99178db73 --- /dev/null +++ b/plugins/PiwikAnalytics/locale/fr/LC_MESSAGES/PiwikAnalytics.po @@ -0,0 +1,30 @@ +# Translation of StatusNet - PiwikAnalytics to French (Français) +# Expored from translatewiki.net +# +# Author: Verdy p +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - PiwikAnalytics\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:57:16+0000\n" +"Language-Team: French <http://translatewiki.net/wiki/Portal:fr>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-10-01 20:39:02+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: fr\n" +"X-Message-Group: #out-statusnet-plugin-piwikanalytics\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: PiwikAnalyticsPlugin.php:105 +msgid "" +"Use <a href=\"http://piwik.org/\">Piwik</a> Open Source web analytics " +"software." +msgstr "" +"Utiliser le logiciel d’analyse Web en source ouvert <a href=\"http://piwik." +"org/\">Piwik</a>." diff --git a/plugins/PiwikAnalytics/locale/ia/LC_MESSAGES/PiwikAnalytics.po b/plugins/PiwikAnalytics/locale/ia/LC_MESSAGES/PiwikAnalytics.po new file mode 100644 index 000000000..99867ca4a --- /dev/null +++ b/plugins/PiwikAnalytics/locale/ia/LC_MESSAGES/PiwikAnalytics.po @@ -0,0 +1,30 @@ +# Translation of StatusNet - PiwikAnalytics to Interlingua (Interlingua) +# Expored from translatewiki.net +# +# Author: McDutchie +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - PiwikAnalytics\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:57:16+0000\n" +"Language-Team: Interlingua <http://translatewiki.net/wiki/Portal:ia>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-10-01 20:39:02+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: ia\n" +"X-Message-Group: #out-statusnet-plugin-piwikanalytics\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: PiwikAnalyticsPlugin.php:105 +msgid "" +"Use <a href=\"http://piwik.org/\">Piwik</a> Open Source web analytics " +"software." +msgstr "" +"Usar le software open source de analyse web <a href=\"http://piwik.org/" +"\">Piwik</a>." diff --git a/plugins/PiwikAnalytics/locale/mk/LC_MESSAGES/PiwikAnalytics.po b/plugins/PiwikAnalytics/locale/mk/LC_MESSAGES/PiwikAnalytics.po new file mode 100644 index 000000000..b7ef8467d --- /dev/null +++ b/plugins/PiwikAnalytics/locale/mk/LC_MESSAGES/PiwikAnalytics.po @@ -0,0 +1,30 @@ +# Translation of StatusNet - PiwikAnalytics to Macedonian (Македонски) +# Expored from translatewiki.net +# +# Author: Bjankuloski06 +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - PiwikAnalytics\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:57:16+0000\n" +"Language-Team: Macedonian <http://translatewiki.net/wiki/Portal:mk>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-10-01 20:39:02+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: mk\n" +"X-Message-Group: #out-statusnet-plugin-piwikanalytics\n" +"Plural-Forms: nplurals=2; plural=(n == 1 || n%10 == 1) ? 0 : 1;\n" + +#: PiwikAnalyticsPlugin.php:105 +msgid "" +"Use <a href=\"http://piwik.org/\">Piwik</a> Open Source web analytics " +"software." +msgstr "" +"Користи <a href=\"http://piwik.org/\">Piwik</a> - програм за мрежна " +"аналитика со отворен код." diff --git a/plugins/PiwikAnalytics/locale/nl/LC_MESSAGES/PiwikAnalytics.po b/plugins/PiwikAnalytics/locale/nl/LC_MESSAGES/PiwikAnalytics.po new file mode 100644 index 000000000..62b7b645b --- /dev/null +++ b/plugins/PiwikAnalytics/locale/nl/LC_MESSAGES/PiwikAnalytics.po @@ -0,0 +1,30 @@ +# Translation of StatusNet - PiwikAnalytics to Dutch (Nederlands) +# Expored from translatewiki.net +# +# Author: Siebrand +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - PiwikAnalytics\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:57:16+0000\n" +"Language-Team: Dutch <http://translatewiki.net/wiki/Portal:nl>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-10-01 20:39:02+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: nl\n" +"X-Message-Group: #out-statusnet-plugin-piwikanalytics\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: PiwikAnalyticsPlugin.php:105 +msgid "" +"Use <a href=\"http://piwik.org/\">Piwik</a> Open Source web analytics " +"software." +msgstr "" +"<a href=\"http://piwik.org/\">Piwik</a> Open Source webanalysesoftware " +"gebruiken." diff --git a/plugins/PiwikAnalytics/locale/ru/LC_MESSAGES/PiwikAnalytics.po b/plugins/PiwikAnalytics/locale/ru/LC_MESSAGES/PiwikAnalytics.po new file mode 100644 index 000000000..26f7ec4e6 --- /dev/null +++ b/plugins/PiwikAnalytics/locale/ru/LC_MESSAGES/PiwikAnalytics.po @@ -0,0 +1,31 @@ +# Translation of StatusNet - PiwikAnalytics to Russian (Русский) +# Expored from translatewiki.net +# +# Author: Eleferen +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - PiwikAnalytics\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:57:16+0000\n" +"Language-Team: Russian <http://translatewiki.net/wiki/Portal:ru>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-10-01 20:39:02+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: ru\n" +"X-Message-Group: #out-statusnet-plugin-piwikanalytics\n" +"Plural-Forms: nplurals=3; plural=(n%10 == 1 && n%100 != 11) ? 0 : ( (n%10 >= " +"2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20)) ? 1 : 2 );\n" + +#: PiwikAnalyticsPlugin.php:105 +msgid "" +"Use <a href=\"http://piwik.org/\">Piwik</a> Open Source web analytics " +"software." +msgstr "" +"Использование Open Source программного обеспечения для веб-аналитики: <a " +"href=\"http://piwik.org/\">Piwik</a>." diff --git a/plugins/PiwikAnalytics/locale/tl/LC_MESSAGES/PiwikAnalytics.po b/plugins/PiwikAnalytics/locale/tl/LC_MESSAGES/PiwikAnalytics.po new file mode 100644 index 000000000..e257b89c6 --- /dev/null +++ b/plugins/PiwikAnalytics/locale/tl/LC_MESSAGES/PiwikAnalytics.po @@ -0,0 +1,30 @@ +# Translation of StatusNet - PiwikAnalytics to Tagalog (Tagalog) +# Expored from translatewiki.net +# +# Author: AnakngAraw +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - PiwikAnalytics\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:57:16+0000\n" +"Language-Team: Tagalog <http://translatewiki.net/wiki/Portal:tl>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-10-01 20:39:02+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: tl\n" +"X-Message-Group: #out-statusnet-plugin-piwikanalytics\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: PiwikAnalyticsPlugin.php:105 +msgid "" +"Use <a href=\"http://piwik.org/\">Piwik</a> Open Source web analytics " +"software." +msgstr "" +"Gamitin ang analatikong pangweb na sopwer na <a href=\"http://piwik.org/" +"\">Piwik</a> na may Bukas na Pinagmulan." diff --git a/plugins/PiwikAnalytics/locale/uk/LC_MESSAGES/PiwikAnalytics.po b/plugins/PiwikAnalytics/locale/uk/LC_MESSAGES/PiwikAnalytics.po new file mode 100644 index 000000000..1955825b8 --- /dev/null +++ b/plugins/PiwikAnalytics/locale/uk/LC_MESSAGES/PiwikAnalytics.po @@ -0,0 +1,31 @@ +# Translation of StatusNet - PiwikAnalytics to Ukrainian (Українська) +# Expored from translatewiki.net +# +# Author: Boogie +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - PiwikAnalytics\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:57:16+0000\n" +"Language-Team: Ukrainian <http://translatewiki.net/wiki/Portal:uk>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-10-01 20:39:02+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: uk\n" +"X-Message-Group: #out-statusnet-plugin-piwikanalytics\n" +"Plural-Forms: nplurals=3; plural=(n%10 == 1 && n%100 != 11) ? 0 : ( (n%10 >= " +"2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20)) ? 1 : 2 );\n" + +#: PiwikAnalyticsPlugin.php:105 +msgid "" +"Use <a href=\"http://piwik.org/\">Piwik</a> Open Source web analytics " +"software." +msgstr "" +"Використання програмного забезпечення з відкритим кодом <a href=\"http://" +"piwik.org/\">Piwik</a> для аналізу веб-потоків." |