Index: trunk/extensions/GeoLite/GeoLite_body.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | } |
20 | 20 | |
21 | 21 | public function execute( $sub ) { |
22 | | - global $wgOut, $wgRequest, $wgLandingPageBase, $wgKnownLandingPages; |
| 22 | + global $wgOut, $wgRequest, $wgLandingPageBase, $wgChaptersPageBase, $wgChapterLandingPages; |
23 | 23 | |
24 | 24 | $lang = ( preg_match( '/^[A-Za-z-]+$/', $wgRequest->getVal( 'lang' ) ) ) ? $wgRequest->getVal( 'lang' ) : 'en' ; |
25 | 25 | $utm_source = $wgRequest->getVal( 'utm_source' ); |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | if ( IP::isValid( $ip ) ) { |
38 | 38 | $country = geoip_country_code_by_name( $ip ); |
39 | 39 | if ( is_string ( $country ) && array_key_exists( $country, $wgKnownLandingPages ) ) { |
40 | | - $wgOut->redirect( $wgLandingPageBase . "/" . $wgKnownLandingPages[ $country ] . $tracking ); |
| 40 | + $wgOut->redirect( $wgChaptersPageBase . "/" . $wgChapterLandingPages[ $country ] . $tracking ); |
41 | 41 | } |
42 | 42 | } else { |
43 | 43 | // 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 @@ |
11 | 11 | } |
12 | 12 | |
13 | 13 | $wgLandingPageBase = 'http://wikimediafoundation.org/wiki/Support_Wikipedia'; |
| 14 | +$wgChaptersPageBase = 'http://wikimediafoundation.org/wiki/Global_Support'; |
14 | 15 | |
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 |
19 | 22 | |
20 | 23 | $wgExtensionCredits['specialpage'][] = array( |
21 | 24 | 'path' => __FILE__, |