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