r58806 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58805‎ | r58806 | r58807 >
Date:05:35, 9 November 2009
Author:tomasz
Status:ok
Tags:
Comment:
Adding default participating chapters. New landing page. Small tweaks.
Modified paths:
  • /trunk/extensions/GeoLite/GeoLite.php (modified) (history)
  • /trunk/extensions/GeoLite/GeoLite_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GeoLite/GeoLite_body.php
@@ -18,7 +18,7 @@
1919 }
2020
2121 public function execute( $sub ) {
22 - global $wgOut, $wgRequest, $wgLandingPageBase, $wgKnownLandingPages;
 22+ global $wgOut, $wgRequest, $wgLandingPageBase, $wgChaptersPageBase, $wgChapterLandingPages;
2323
2424 $lang = ( preg_match( '/^[A-Za-z-]+$/', $wgRequest->getVal( 'lang' ) ) ) ? $wgRequest->getVal( 'lang' ) : 'en' ;
2525 $utm_source = $wgRequest->getVal( 'utm_source' );
@@ -36,7 +36,7 @@
3737 if ( IP::isValid( $ip ) ) {
3838 $country = geoip_country_code_by_name( $ip );
3939 if ( is_string ( $country ) && array_key_exists( $country, $wgKnownLandingPages ) ) {
40 - $wgOut->redirect( $wgLandingPageBase . "/" . $wgKnownLandingPages[ $country ] . $tracking );
 40+ $wgOut->redirect( $wgChaptersPageBase . "/" . $wgChapterLandingPages[ $country ] . $tracking );
4141 }
4242 } else {
4343 // Either we couldn't get the ip from the client or the geo ip lookup failed. Redirect as best as we can
Index: trunk/extensions/GeoLite/GeoLite.php
@@ -10,11 +10,14 @@
1111 }
1212
1313 $wgLandingPageBase = 'http://wikimediafoundation.org/wiki/Support_Wikipedia';
 14+$wgChaptersPageBase = 'http://wikimediafoundation.org/wiki/Global_Support';
1415
15 -$wgKnownLandingPages = array( 'US' => 'en',
16 - 'DE' => '',
17 - 'PL' => '',
18 - ); # Which Chapters actually have landing pages
 16+$wgChapterLandingPages = array( 'HK' => 'hk',
 17+ 'DE' => 'de',
 18+ 'UK' => 'uk',
 19+ 'FR' => 'fr',
 20+ 'CH' => 'ch',
 21+ ); # Which Chapters actually have landing pages
1922
2023 $wgExtensionCredits['specialpage'][] = array(
2124 'path' => __FILE__,

Status & tagging log