r73993 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73992‎ | r73993 | r73994 >
Date:22:18, 29 September 2010
Author:tomasz
Status:deferred
Tags:
Comment:
Picking up fixes from 73991 & 73983
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/CentralNotice (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerController.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.php
@@ -144,8 +144,11 @@
145145
146146 $centralLoader = SpecialPage::getTitleFor( 'BannerController' )->getLocalUrl();
147147
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+ }
150153
151154 // Insert the banner controller Javascript into the <head>
152155 $wgOut->addScriptFile( $centralLoader );
Index: branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerController.php
@@ -55,7 +55,7 @@
5656 'fn': {
5757 'loadBanner': function( bannerName ) {
5858 // 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;
6060 EOT;
6161 $js .= "\n\t\t\t\tvar bannerScript = '<script type=\"text/javascript\" src=\"".Xml::escapeJsString( $wgCentralPagePath )."' + bannerPage + '\"></script>';\n";
6262 $js .= <<<EOT
Property changes on: branches/wmf/1.16wmf4/extensions/CentralNotice
___________________________________________________________________
Modified: svn:mergeinfo
6363 Merged /trunk/extensions/CentralNotice:r73973,73983,73991

Status & tagging log