Index: branches/wmf/1.17wmf1/extensions/CentralNotice/special/SpecialBannerController.php |
— | — | @@ -54,12 +54,11 @@ |
55 | 55 | 'getVars': {} |
56 | 56 | }, |
57 | 57 | 'fn': { |
58 | | - 'loadBanner': function( bannerName, fundraising, landingPages, campaign ) { |
| 58 | + 'loadBanner': function( bannerName, campaign ) { |
59 | 59 | // Get the requested banner |
60 | 60 | var bannerPageQuery = $.param( { |
61 | 61 | 'banner': bannerName, 'campaign': campaign, 'userlang': wgUserLanguage, |
62 | | - 'db': wgDBname, 'sitename': wgSiteName, 'country': Geo.country, |
63 | | - 'fundraising': fundraising, 'landingpages': landingPages |
| 62 | + 'db': wgDBname, 'sitename': wgSiteName, 'country': Geo.country |
64 | 63 | } ); |
65 | 64 | var bannerPage = '?title=Special:BannerLoader&' + bannerPageQuery; |
66 | 65 | JAVASCRIPT; |
— | — | @@ -119,8 +118,6 @@ |
120 | 119 | // Load a random banner from our groomed list |
121 | 120 | $.centralNotice.fn.loadBanner( |
122 | 121 | groomedBannerList[pointer].name, |
123 | | - groomedBannerList[pointer].fundraising, |
124 | | - groomedBannerList[pointer].landing_pages, |
125 | 122 | groomedBannerList[pointer].campaign |
126 | 123 | ); |
127 | 124 | }, |
Property changes on: branches/wmf/1.17wmf1/extensions/CentralNotice/special/SpecialBannerController.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
128 | 125 | Merged /branches/wmf-deployment/extensions/CentralNotice/special/SpecialBannerController.php:r60970 |
129 | 126 | Merged /branches/wmf/1.16wmf4/extensions/CentralNotice/special/SpecialBannerController.php:r67177,69199,76243,77266 |
130 | 127 | Merged /trunk/extensions/CentralNotice/special/SpecialBannerController.php:r62820-67552,67557,67559-71720,71725-71731,71734-71739,71748-71753,71774-71997,72058-72131,72136-73830,73847,73850,73852,73855,73959,73963,73973,73980,73983,73991,73994-73995,74000-74321,74325-74406,75376-75470,75567,75643,75646,75674,75680,75726,75849,75889,75908,75973,76141,76145,76333,76347,76351,76356-76358,76361,76363,76462,76543,76763,77622-79761,79780,79783-80145,80147-80148,80150,80152-80602,81461-83563,83565-91217 |
131 | 128 | Merged /trunk/phase3/extensions/CentralNotice/special/SpecialBannerController.php:r63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,77555,77558-77560,77563-77565,77573 |
Index: branches/wmf/1.17wmf1/extensions/CentralNotice/special/SpecialBannerLoader.php |
— | — | @@ -23,9 +23,7 @@ |
24 | 24 | // Get values from the query string |
25 | 25 | $this->language = $wgRequest->getText( 'userlang', 'en' ); |
26 | 26 | $this->siteName = $wgRequest->getText( 'sitename', 'Wikipedia' ); |
27 | | - $this->campaign = $wgRequest->getText( 'campaign', 'unknown' ); |
28 | | - $this->fundraising = $wgRequest->getBool( 'fundraising', false ); |
29 | | - $this->landingPages = $wgRequest->getText( 'landingpages' ); |
| 27 | + $this->campaign = $wgRequest->getText( 'campaign', 'undefined' ); |
30 | 28 | |
31 | 29 | if ( $wgRequest->getText( 'banner' ) ) { |
32 | 30 | $bannerName = $wgRequest->getText( 'banner' ); |
— | — | @@ -76,8 +74,8 @@ |
77 | 75 | 'bannerName' => $bannerName, |
78 | 76 | 'bannerHtml' => $bannerHtml, |
79 | 77 | 'campaign' => $this->campaign, |
80 | | - 'fundraising' => $this->fundraising, |
81 | | - 'landingPages' => $this->landingPages |
| 78 | + 'fundraising' => $this->getFundraising( $bannerName ), |
| 79 | + 'landingPages' => $this->getLandingPages( $bannerName ) |
82 | 80 | ); |
83 | 81 | $bannerJs = 'insertBanner('.FormatJson::encode( $bannerArray ).');'; |
84 | 82 | return $bannerJs; |
— | — | @@ -196,6 +194,22 @@ |
197 | 195 | } |
198 | 196 | return $count; |
199 | 197 | } |
| 198 | + |
| 199 | + function getFundraising( $bannerName ) { |
| 200 | + global $wgCentralDBname; |
| 201 | + $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname ); |
| 202 | + $eBannerName = htmlspecialchars( $bannerName ); |
| 203 | + $row = $dbr->selectRow( 'cn_templates', 'tmp_fundraising', array( 'tmp_name' => $eBannerName ) ); |
| 204 | + return $row->tmp_fundraising; |
| 205 | + } |
| 206 | + |
| 207 | + function getLandingPages( $bannerName ) { |
| 208 | + global $wgCentralDBname; |
| 209 | + $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname ); |
| 210 | + $eBannerName = htmlspecialchars( $bannerName ); |
| 211 | + $row = $dbr->selectRow( 'cn_templates', 'tmp_landing_pages', array( 'tmp_name' => $eBannerName ) ); |
| 212 | + return $row->tmp_landing_pages; |
| 213 | + } |
200 | 214 | } |
201 | 215 | /** |
202 | 216 | * @defgroup Exception Exception |
Property changes on: branches/wmf/1.17wmf1/extensions/CentralNotice/special/SpecialBannerLoader.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
203 | 217 | Merged /trunk/phase3/extensions/CentralNotice/special/SpecialBannerLoader.php:r63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,77555,77558-77560,77563-77565,77573 |
204 | 218 | Merged /branches/wmf-deployment/extensions/CentralNotice/special/SpecialBannerLoader.php:r60970 |
205 | 219 | Merged /branches/wmf/1.16wmf4/extensions/CentralNotice/special/SpecialBannerLoader.php:r67177,69199,76243,77266 |
206 | 220 | Merged /trunk/extensions/CentralNotice/special/SpecialBannerLoader.php:r62820-67552,67557,67559-71720,71725-71731,71734-71739,71748-71753,71774-71997,72058-72131,72136-73830,73847,73850,73852,73855,73959,73963,73973,73980,73983,73991,73994-73995,74000-74321,74325-74406,75376-75470,75567,75643,75646,75674,75680,75726,75849,75889,75908,75973,76141,76145,76333,76347,76351,76356-76358,76361,76363,76462,76543,76763,77622-79761,79780,79783-80145,80147-80148,80150,80152-80602,81461-83563,83565-91217 |