Index: branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -144,8 +144,11 @@ |
145 | 145 | |
146 | 146 | $centralLoader = SpecialPage::getTitleFor( 'BannerController' )->getLocalUrl(); |
147 | 147 | |
148 | | - // Insert the geo IP lookup into the <head> |
149 | | - $wgOut->addScriptFile( 'http://geoiplookup.wikimedia.org/' ); |
| 148 | + $dbr = wfGetDB( DB_SLAVE ); |
| 149 | + $row = $dbr->selectRow( 'cn_notices', 'not_name', array( 'not_enabled = 1', 'not_geo = 1' ) ); |
| 150 | + if ( $row ) { |
| 151 | + $wgOut->addScriptFile( 'http://geoiplookup.wikimedia.org/' ); |
| 152 | + } |
150 | 153 | |
151 | 154 | // Insert the banner controller Javascript into the <head> |
152 | 155 | $wgOut->addScriptFile( $centralLoader ); |
Index: branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerController.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | 'fn': { |
57 | 57 | 'loadBanner': function( bannerName ) { |
58 | 58 | // Get the requested banner |
59 | | - var bannerPage = 'Special:BannerLoader?banner='+bannerName+'&userlang='+wgUserLanguage+'&sitename='+wgSiteName; |
| 59 | + var bannerPage = 'Special:BannerLoader?banner='+bannerName+'&userlang='+wgUserLanguage+'&db='+wgDBname+'&sitename='+wgSiteName+'&country='+Geo.country; |
60 | 60 | EOT; |
61 | 61 | $js .= "\n\t\t\t\tvar bannerScript = '<script type=\"text/javascript\" src=\"".Xml::escapeJsString( $wgCentralPagePath )."' + bannerPage + '\"></script>';\n"; |
62 | 62 | $js .= <<<EOT |
Property changes on: branches/wmf/1.16wmf4/extensions/CentralNotice |
___________________________________________________________________ |
Modified: svn:mergeinfo |
63 | 63 | Merged /trunk/extensions/CentralNotice:r73973,73983,73991 |