Index: trunk/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -145,8 +145,11 @@ |
146 | 146 | |
147 | 147 | $centralLoader = SpecialPage::getTitleFor( 'BannerController' )->getLocalUrl(); |
148 | 148 | |
149 | | - // Insert the geo IP lookup into the <head> |
150 | | - $wgOut->addScriptFile( 'http://geoiplookup.wikimedia.org/' ); |
| 149 | + $dbr = wfGetDB( DB_SLAVE ); |
| 150 | + $row = $dbr->selectRow( 'cn_notices', 'not_name', array( 'not_enabled = 1', 'not_geo = 1' ) ); |
| 151 | + if ( $row ) { |
| 152 | + $wgOut->addScriptFile( 'http://geoiplookup.wikimedia.org/' ); |
| 153 | + } |
151 | 154 | |
152 | 155 | // Insert the banner controller Javascript into the <head> |
153 | 156 | $wgOut->addScriptFile( $centralLoader ); |