r112254 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112253‎ | r112254 | r112255 >
Date:22:28, 23 February 2012
Author:catrope
Status:ok (Comments)
Tags:
Comment:
Add a configuration variable for disabling tracking of the sidebar links
Modified paths:
  • /trunk/extensions/ClickTracking/ClickTracking.hooks.php (modified) (history)
  • /trunk/extensions/ClickTracking/ClickTracking.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ClickTracking/ClickTracking.hooks.php
@@ -69,10 +69,10 @@
7070 * @return Boolean: always true
7171 */
7272 public static function beforePageDisplay( $out, $skin ) {
73 - global $wgClickTrackThrottle;
 73+ global $wgClickTrackSidebar, $wgClickTrackThrottle;
7474 $out->addModules( 'ext.UserBuckets' );
7575
76 - if ( $wgClickTrackThrottle >= 0 && rand() % $wgClickTrackThrottle == 0 ) {
 76+ if ( $wgClickTrackSidebar && $wgClickTrackThrottle >= 0 && rand() % $wgClickTrackThrottle == 0 ) {
7777 $out->addModules( 'ext.clickTracking' );
7878 }
7979 return true;
Index: trunk/extensions/ClickTracking/ClickTracking.php
@@ -31,6 +31,9 @@
3232 // Whether to log clicks to the database. If this is enabled and a log file is configured, events will be logged to both
3333 $wgClickTrackingDatabase = true;
3434
 35+// If true, apply clicktracking to the links in the sidebar
 36+$wgClickTrackSidebar = false;
 37+
3538 /* Setup */
3639
3740 $wgExtensionCredits['other'][] = array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r1122611.18wmf1: MFT r112254, r112255catrope23:10, 23 February 2012
r1122631.19wmf1: MFT r112254, r112255catrope23:10, 23 February 2012

Comments

#Comment by Kaldari (talk | contribs)   21:39, 28 February 2012

Looks good, but I'm going to separate the Throttling logic from the module loading logic in case people add some more modules and only want to enable some of them.

Status & tagging log