http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73993

Revision: 73993
Author:   tomasz
Date:     2010-09-29 22:18:50 +0000 (Wed, 29 Sep 2010)

Log Message:
-----------
Picking up fixes from 73991 & 73983

Modified Paths:
--------------
    branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.php
    branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerController.php

Property Changed:
----------------
    branches/wmf/1.16wmf4/extensions/CentralNotice/


Property changes on: branches/wmf/1.16wmf4/extensions/CentralNotice
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/wmf-deployment/extensions/CentralNotice:60970
/trunk/extensions/CentralNotice:62820-67552,67557,67559-71720,71725-71731,71734-71739,71748-71753,71774-71997,72058-72131,72136-73830,73847,73850,73852,73855,73980
/trunk/phase3/extensions/CentralNotice:63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816
   + /branches/wmf-deployment/extensions/CentralNotice:60970
/trunk/extensions/CentralNotice:62820-67552,67557,67559-71720,71725-71731,71734-71739,71748-71753,71774-71997,72058-72131,72136-73830,73847,73850,73852,73855,73973,73980,73983,73991
/trunk/phase3/extensions/CentralNotice:63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816

Modified: branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.php
===================================================================
--- branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.php    
2010-09-29 22:15:57 UTC (rev 73992)
+++ branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.php    
2010-09-29 22:18:50 UTC (rev 73993)
@@ -144,8 +144,11 @@
 
        $centralLoader = SpecialPage::getTitleFor( 'BannerController' 
)->getLocalUrl();
 
-       // Insert the geo IP lookup into the <head>
-       $wgOut->addScriptFile( 'http://geoiplookup.wikimedia.org/' );
+       $dbr = wfGetDB( DB_SLAVE );
+       $row = $dbr->selectRow( 'cn_notices', 'not_name', array( 'not_enabled = 
1', 'not_geo = 1' ) );
+       if ( $row ) {
+               $wgOut->addScriptFile( 'http://geoiplookup.wikimedia.org/' );
+       }
        
        // Insert the banner controller Javascript into the <head>
        $wgOut->addScriptFile( $centralLoader );

Modified: 
branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerController.php
===================================================================
--- branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerController.php  
2010-09-29 22:15:57 UTC (rev 73992)
+++ branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerController.php  
2010-09-29 22:18:50 UTC (rev 73993)
@@ -55,7 +55,7 @@
                'fn': {
                        'loadBanner': function( bannerName ) {
                                // Get the requested banner
-                               var bannerPage = 
'Special:BannerLoader?banner='+bannerName+'&userlang='+wgUserLanguage+'&sitename='+wgSiteName;
+                               var bannerPage = 
'Special:BannerLoader?banner='+bannerName+'&userlang='+wgUserLanguage+'&db='+wgDBname+'&sitename='+wgSiteName+'&country='+Geo.country;
 EOT;
                $js .= "\n\t\t\t\tvar bannerScript = '<script 
type=\"text/javascript\" src=\"".Xml::escapeJsString( $wgCentralPagePath )."' + 
bannerPage + '\"></script>';\n";
                $js .= <<<EOT



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to