Index: trunk/extensions/VariablePage/VariablePage.body.php |
— | — | @@ -8,11 +8,11 @@ |
9 | 9 | |
10 | 10 | public function execute() { |
11 | 11 | global $wgOut, $wgRequest; |
12 | | - global $wgVariablePagePossibilities; |
13 | | - |
| 12 | + global $wgVariablePagePossibilities, $wgVariablePageUtmMedium; |
| 13 | + |
14 | 14 | $lang = ( preg_match( '/^[A-Za-z-]+$/', $wgRequest->getVal( 'lang' ) ) ) ? $wgRequest->getVal( 'lang' ) : 'en' ; |
15 | 15 | $utm_source = $wgRequest->getVal( 'utm_source' ); |
16 | | - $utm_medium = $wgRequest->getVal( 'utm_medium' ); |
| 16 | + $utm_medium = ( strlen($wgVariablePageUtmMedium )) ? $wgVariablePageUtmMedium : $wgRequest->getVal( 'utm_medium' ); |
17 | 17 | $utm_campaign = $wgRequest->getVal( 'utm_campaign' ); |
18 | 18 | $referrer = $wgRequest->getHeader( 'referrer' ); |
19 | 19 | |
Index: trunk/extensions/VariablePage/VariablePage.php |
— | — | @@ -35,6 +35,14 @@ |
36 | 36 | 'http://wikimediafoundation.org/wiki/Support_Wikipedia' => 100 |
37 | 37 | ); |
38 | 38 | |
| 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 | + |
39 | 47 | $dir = dirname( __FILE__ ) . '/'; |
40 | 48 | |
41 | 49 | $wgAutoloadClasses[ 'SpecialVariablePage' ] = $dir . 'VariablePage.body.php'; |