Index: trunk/extensions/Piwik/Piwik.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | |
16 | 16 | $wgExtensionCredits['specialpage'][] = array( |
17 | 17 | 'name' => 'Piwik Integration', |
18 | | - 'version' => '0.2.5rev0.7.1 Beta', |
| 18 | + 'version' => '0.2.5rev0.7.5 (1.0-RC1)', |
19 | 19 | 'svn-date' => '$LastChangedDate$', |
20 | 20 | 'svn-revision' => '$LastChangedRevision$', |
21 | 21 | 'author' => 'Isb1009', |
— | — | @@ -30,6 +30,7 @@ |
31 | 31 | $wgPiwikIgnoreSysops = true; |
32 | 32 | $wgPiwikIgnoreBots = true; |
33 | 33 | $wgPiwikCustomJS = ""; |
| 34 | +$wgPiwikUsePageTitle = false; |
34 | 35 | $wgPiwikActionName = ""; |
35 | 36 | |
36 | 37 | function efPiwikHookText(&$skin, &$text='') { |
— | — | @@ -38,17 +39,25 @@ |
39 | 40 | } |
40 | 41 | |
41 | 42 | function efAddPiwik() { |
42 | | - global $wgPiwikIDSite, $wgPiwikURL, $wgPiwikIgnoreSysops, $wgPiwikIgnoreBots, $wgUser, $wgScriptPath, $wgPiwikCustomJS, $wgPiwikActionName; |
| 43 | + global $wgPiwikIDSite, $wgPiwikURL, $wgPiwikIgnoreSysops, $wgPiwikIgnoreBots, $wgUser, $wgScriptPath, $wgPiwikCustomJS, $wgPiwikActionName, $wgTitle, $wgPiwikUsePageTitle; |
43 | 44 | if (!$wgUser->isAllowed('bot') || !$wgPiwikIgnoreBots) { |
44 | 45 | if (!$wgUser->isAllowed('protect') || !$wgPiwikIgnoreSysops) { |
45 | 46 | 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 | +} |
46 | 55 | $funcOutput = <<<PIWIK |
47 | 56 | <!-- Piwik --> |
48 | 57 | <a href="http://piwik.org" title="Web analytics" onclick="window.open(this.href);return(false);"> |
49 | 58 | <script language="javascript" src="{$wgScriptPath}/extensions/piwik/piwik-mw.js" type="text/javascript"></script> |
50 | 59 | <script type="text/javascript"> |
51 | 60 | <!-- |
52 | | -piwik_action_name = '{$wgPiwikActionName}'; |
| 61 | +piwik_action_name = '{$wgPiwikFinalActionName}'; |
53 | 62 | piwik_idsite = {$wgPiwikIDSite}; |
54 | 63 | piwik_url = '{$wgPiwikURL}piwik.php'; |
55 | 64 | piwik_log(piwik_action_name, piwik_idsite, piwik_url); |
Index: trunk/extensions/Piwik/README |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | MediaWiki Piwik Integration extension |
3 | 3 | |
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 |
6 | 6 | |
7 | 7 | This is the README file for the Piwik Integration extension for MediaWiki |
8 | 8 | software. The extension is only useful if you've got a MediaWiki |
— | — | @@ -68,3 +68,11 @@ |
69 | 69 | |
70 | 70 | * If you want to change piwik_action_name, you can set $wgPiwikActionName |
71 | 71 | 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 | + |