r87462 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87461‎ | r87462 | r87463 >
Date:22:16, 4 May 2011
Author:demon
Status:ok
Tags:
Comment:
MFT r87458, r87157 (for real this time), basically sync up to head.
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/GoogleNewsSitemap.alias.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/GoogleNewsSitemap.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
@@ -13,14 +13,14 @@
1414 * Parameters
1515 * * categories = string ; default = Published
1616 * * notcategories = string ; default = null
17 - * * namespace = string ; default = null
 17+ * * namespace = string ; default = 0 (main)
1818 * * count = integer ; default = $wgGNSMmaxResultCount = 50
1919 * * hourcont = integer ; default -1 (disabled), how many hours before cutoff
2020 * * order = string ; default = descending
2121 * * ordermethod = string ; default = categoryadd
2222 * * redirects = string ; default = exclude
23 - * * stablepages = string ; default = null
24 - * * qualitypages = string ; default = null
 23+ * * stablepages = string ; default = only
 24+ * * qualitypages = string ; default = include
2525 * * feed = string ; default = sitemap
2626 **/
2727
@@ -281,15 +281,14 @@
282282 switch ( $params['redirects'] ) {
283283 case self::OPT_ONLY:
284284 $conditions['page_is_redirect'] = 1;
285 - break;
 285+ break;
286286 case self::OPT_EXCLUDE:
287287 $conditions['page_is_redirect'] = 0;
288 - break;
 288+ break;
289289 }
290290
291291 if ( $params['hourCount'] > 0
292 - && $params['orderMethod'] !== 'lastedit' )
293 - {
 292+ && $params['orderMethod'] !== 'lastedit' ) {
294293 // Limit to last X number of hours added to category,
295294 // if hourcont is positive and we're sorting by
296295 // category add date.
@@ -341,7 +340,6 @@
342341 $options['ORDER BY'] = 'c1.cl_timestamp ' . $sortOrder;
343342 }
344343
345 -
346344 // earlier validation logic ensures this is a reasonable number
347345 $options['LIMIT'] = $params['count'];
348346
@@ -354,7 +352,7 @@
355353 * variables that make up the request.
356354 **/
357355 public function getParams() {
358 - global $wgContLang, $wgRequest, $wgGNSMmaxCategories,
 356+ global $wgRequest, $wgGNSMmaxCategories,
359357 $wgGNSMmaxResultCount, $wgGNSMfallbackCategory;
360358
361359 $params = array();
@@ -368,8 +366,7 @@
369367 $params['hourCount'] = $wgRequest->getInt( 'hourcount', -1 );
370368
371369 if ( ( $params['count'] > $wgGNSMmaxResultCount )
372 - || ( $params['count'] < 1 ) )
373 - {
 370+ || ( $params['count'] < 1 ) ) {
374371 $params['count'] = $wgGNSMmaxResultCount;
375372 }
376373
@@ -377,8 +374,8 @@
378375 $params['orderMethod'] = $wgRequest->getVal( 'ordermethod', 'categoryadd' );
379376
380377 $params['redirects'] = $this->getIEOVal( 'redirects', self::OPT_EXCLUDE );
381 - $params['stable'] = $this->getIEOVal( 'stable', self::OPT_ONLY );
382 - $params['quality'] = $this->getIEOVal( 'qualitypages', self::OPT_ONLY );
 378+ $params['stable'] = $this->getIEOVal( 'stablepages', self::OPT_ONLY );
 379+ $params['quality'] = $this->getIEOVal( 'qualitypages', self::OPT_INCLUDE );
383380
384381 // feed parameter is validated later in the execute method.
385382 $params['feed'] = $wgRequest->getVal( 'feed', 'sitemap' );
Index: branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/GoogleNewsSitemap.php
@@ -17,11 +17,10 @@
1818 * - 0.92 http://www.rssboard.org/rss-0-9-2
1919 * Atom feed output - 2005 http://tools.ietf.org/html/rfc4287
2020 **
21 - * This page can be accessed from Special:GoogleNewsSitemap[/][|category=Catname]
22 - * [|notcategory=OtherCatName][|namespace=0][|notnamespace=User]
23 - * [|feed=sitemap][|count=10][|mode=ul][|ordermethod=lastedit]
24 - * [|order=ascending] as well as being included like
25 - * {{Special:GoogleNewsSitemap/[options][...]}}
 21+ * This page can be accessed from Special:GoogleNewsSitemap?[categories=Catname]
 22+ * [&notcategories=OtherCatName][&namespace=0]
 23+ * [&feed=sitemap][&count=10][&ordermethod=lastedit]
 24+ * [&order=ascending]
2625 **
2726 * This program is free software; you can redistribute it and/or modify it
2827 * under the terms of the GNU General Public License as published by the Free
@@ -56,9 +55,10 @@
5756 $wgExtensionCredits['specialpage'][] = array(
5857 'path' => __FILE__,
5958 'name' => 'GoogleNewsSitemap',
60 - 'author' => 'Amgine',
 59+ 'author' => array( 'Amgine', '[http://mediawiki.org/wiki/User:Bawolff Brian Wolff]' ),
6160 'descriptionmsg' => 'googlenewssitemap-desc',
6261 'url' => 'http://www.mediawiki.org/wiki/Extension:GoogleNewsSitemap',
 62+ 'version' => 1,
6363 );
6464
6565 $dir = dirname( __FILE__ ) . '/';
Index: branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap/GoogleNewsSitemap.alias.php
@@ -12,7 +12,7 @@
1313 * @author Amgine
1414 */
1515 $specialPageAliases['en'] = array(
16 - 'GoogleNewsSitemap' => array( 'GoogleNewsSitemap' ),
 16+ 'GoogleNewsSitemap' => array( 'NewsFeed', 'GoogleNewsSitemap' ),
1717 );
1818
1919 /** Arabic (العربية) */
@@ -73,4 +73,4 @@
7474 /**
7575 * For backwards compatibility with MediaWiki 1.15 and earlier.
7676 */
77 -$aliases =& $specialPageAliases;
\ No newline at end of file
 77+$aliases =& $specialPageAliases;
Property changes on: branches/wmf/1.17wmf1/extensions/GoogleNewsSitemap
___________________________________________________________________
Modified: svn:mergeinfo
7878 Merged /trunk/extensions/GoogleNewsSitemap:r87153,87157,87458

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87157Rename the "stable" option to "stablepages" to match docs and be consistent...bawolff02:11, 30 April 2011
r87458Based on feedback from folks at enwikinews - having the special page named...bawolff21:32, 4 May 2011

Status & tagging log