r72951 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72950‎ | r72951 | r72952 >
Date:01:19, 14 September 2010
Author:awjrichards
Status:ok
Tags:
Comment:
Added configurable utm_medium
Modified paths:
  • /trunk/extensions/VariablePage/VariablePage.body.php (modified) (history)
  • /trunk/extensions/VariablePage/VariablePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/VariablePage/VariablePage.body.php
@@ -8,11 +8,11 @@
99
1010 public function execute() {
1111 global $wgOut, $wgRequest;
12 - global $wgVariablePagePossibilities;
13 -
 12+ global $wgVariablePagePossibilities, $wgVariablePageUtmMedium;
 13+
1414 $lang = ( preg_match( '/^[A-Za-z-]+$/', $wgRequest->getVal( 'lang' ) ) ) ? $wgRequest->getVal( 'lang' ) : 'en' ;
1515 $utm_source = $wgRequest->getVal( 'utm_source' );
16 - $utm_medium = $wgRequest->getVal( 'utm_medium' );
 16+ $utm_medium = ( strlen($wgVariablePageUtmMedium )) ? $wgVariablePageUtmMedium : $wgRequest->getVal( 'utm_medium' );
1717 $utm_campaign = $wgRequest->getVal( 'utm_campaign' );
1818 $referrer = $wgRequest->getHeader( 'referrer' );
1919
Index: trunk/extensions/VariablePage/VariablePage.php
@@ -35,6 +35,14 @@
3636 'http://wikimediafoundation.org/wiki/Support_Wikipedia' => 100
3737 );
3838
 39+/**
 40+ * You may set a custom utm_medium to be used for pages reached via VariablePage
 41+ *
 42+ * This can be set to whatever string you wish to use for utm_medium
 43+ */
 44+$wgVariablePageUtmMedium;
 45+
 46+
3947 $dir = dirname( __FILE__ ) . '/';
4048
4149 $wgAutoloadClasses[ 'SpecialVariablePage' ] = $dir . 'VariablePage.body.php';

Status & tagging log