r37267 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37266‎ | r37267 | r37268 >
Date:17:06, 7 July 2008
Author:demon
Status:old
Tags:
Comment:
Updates to piwik. Patch by Isb1009.
Modified paths:
  • /trunk/extensions/Piwik/Piwik.php (modified) (history)
  • /trunk/extensions/Piwik/README (modified) (history)

Diff [purge]

Index: trunk/extensions/Piwik/Piwik.php
@@ -14,7 +14,7 @@
1515
1616 $wgExtensionCredits['specialpage'][] = array(
1717 'name' => 'Piwik Integration',
18 - 'version' => '0.2.5rev0.7.1 Beta',
 18+ 'version' => '0.2.5rev0.7.5 (1.0-RC1)',
1919 'svn-date' => '$LastChangedDate$',
2020 'svn-revision' => '$LastChangedRevision$',
2121 'author' => 'Isb1009',
@@ -30,6 +30,7 @@
3131 $wgPiwikIgnoreSysops = true;
3232 $wgPiwikIgnoreBots = true;
3333 $wgPiwikCustomJS = "";
 34+$wgPiwikUsePageTitle = false;
3435 $wgPiwikActionName = "";
3536
3637 function efPiwikHookText(&$skin, &$text='') {
@@ -38,17 +39,25 @@
3940 }
4041
4142 function efAddPiwik() {
42 - global $wgPiwikIDSite, $wgPiwikURL, $wgPiwikIgnoreSysops, $wgPiwikIgnoreBots, $wgUser, $wgScriptPath, $wgPiwikCustomJS, $wgPiwikActionName;
 43+ global $wgPiwikIDSite, $wgPiwikURL, $wgPiwikIgnoreSysops, $wgPiwikIgnoreBots, $wgUser, $wgScriptPath, $wgPiwikCustomJS, $wgPiwikActionName, $wgTitle, $wgPiwikUsePageTitle;
4344 if (!$wgUser->isAllowed('bot') || !$wgPiwikIgnoreBots) {
4445 if (!$wgUser->isAllowed('protect') || !$wgPiwikIgnoreSysops) {
4546 if ( !empty($wgPiwikIDSite) AND !empty($wgPiwikURL)) {
 47+if ($wgPiwikUsePageTitle == true ) {
 48+$wgPiwikPageTitle = $wgTitle->getPrefixedText();
 49+
 50+$wgPiwikFinalActionName = $wgPiwikActionName;
 51+$wgPiwikFinalActionName .= $wgPiwikPageTitle;
 52+} else {
 53+$wgPiwikFinalActionName = $wgPiwikActionName;
 54+}
4655 $funcOutput = <<<PIWIK
4756 <!-- Piwik -->
4857 <a href="http://piwik.org" title="Web analytics" onclick="window.open(this.href);return(false);">
4958 <script language="javascript" src="{$wgScriptPath}/extensions/piwik/piwik-mw.js" type="text/javascript"></script>
5059 <script type="text/javascript">
5160 <!--
52 -piwik_action_name = '{$wgPiwikActionName}';
 61+piwik_action_name = '{$wgPiwikFinalActionName}';
5362 piwik_idsite = {$wgPiwikIDSite};
5463 piwik_url = '{$wgPiwikURL}piwik.php';
5564 piwik_log(piwik_action_name, piwik_idsite, piwik_url);
Index: trunk/extensions/Piwik/README
@@ -1,7 +1,7 @@
22 MediaWiki Piwik Integration extension
33
4 -version 0.2.4rev0.7 Beta
5 -01 July 2008
 4+version 0.2.5rev0.7.5 (1.0-RC1)
 5+07 July 2008
66
77 This is the README file for the Piwik Integration extension for MediaWiki
88 software. The extension is only useful if you've got a MediaWiki
@@ -68,3 +68,11 @@
6969
7070 * If you want to change piwik_action_name, you can set $wgPiwikActionName
7171 inside your LocalSettings.php file.
 72+
 73+** In case you want to include the piwik_action_name as, for example,
 74+ "wiki/Title of the page", you can set $wgPiwikUsePageTitle to
 75+ true and set $wgPiwikActionName to "wiki/". The extension will print
 76+
 77+ piwik_action_name = 'wiki/Title of the page';
 78+
 79+

Status & tagging log