r60965 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60964‎ | r60965 | r60966 >
Date:07:27, 12 January 2010
Author:tstarling
Status:resolved (Comments)
Tags:
Comment:
* Finished renaming GNSM to GoogleNewsSitemap. I used "Sitemap" instead of "SiteMap" because that's how Google spells it.
* Renamed feedSMItem to FeedSitemapItem.
* Removed "Special" from the special page aliases, as in "SpecialGNSM", since special pages do not normally have special in their name twice (once in the namespace and once in the second part). That meant that all the localisations could be removed since they were only translating the word "Special".
Modified paths:
  • /trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.alias.php (modified) (history)
  • /trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.i18n.php (modified) (history)
  • /trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.php (modified) (history)
  • /trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap_body.php
@@ -2,11 +2,11 @@
33 if (!defined('MEDIAWIKI')) die();
44
55 /**
6 - * Class GNSM creates Atom/RSS feeds for Wikinews
 6+ * Class GoogleNewsSitemap creates Atom/RSS feeds for Wikinews
77 **
88 * Simple feed using Atom/RSS coupled to DynamicPageList category searching.
99 *
10 - * To use: http://wiki.url/Special:GNSM/<feedType>?[paramter=value][...]
 10+ * To use: http://wiki.url/Special:GoogleNewsSitemap/<feedType>?[paramter=value][...]
1111 *
1212 * Implemented parameters are marked with an @
1313 **
@@ -26,7 +26,7 @@
2727 * suppresserrors = bool ; default = false
2828 **/
2929
30 -class GNSM extends IncludableSpecialPage {
 30+class GoogleNewsSitemap extends IncludableSpecialPage {
3131
3232
3333 /**
@@ -65,7 +65,7 @@
6666 * Constructor
6767 **/
6868 public function __construct() {
69 - parent::__construct( 'GNSM' );
 69+ parent::__construct( 'GoogleNewsSitemap' );
7070 }
7171
7272 /**
@@ -77,7 +77,7 @@
7878 global $wgContLang;
7979 global $wgRequest, $wgOut;
8080 global $wgSitename, $wgServer, $wgScriptPath;
81 - wfLoadExtensionMessages( 'GNSM' );
 81+ wfLoadExtensionMessages( 'GoogleNewsSitemap' );
8282 global $wgFeedClasses, $wgLocaltimezone;
8383
8484 // Not sure how clean $wgLocaltimezone is
@@ -143,7 +143,7 @@
144144 $this->pubDate = isset( $row->cl_timestamp ) ? $row->cl_timestamp : date( DATE_ATOM );
145145 $feedArticle = new Article( $title );
146146
147 - $feedItem = new feedSMItem(
 147+ $feedItem = new FeedSitemapItem(
148148 trim( $title->getFullURL() ),
149149 wfTimeStamp( TS_ISO_8601, $this->pubDate ),
150150 $this->getKeywords( $title ),
@@ -515,11 +515,11 @@
516516 }
517517
518518 /**
519 - * feedSMItem Class
 519+ * FeedSitemapItem Class
520520 **
521521 * Base class for basic SiteMap support, for building url containers.
522522 **/
523 -class feedSMItem{
 523+class FeedSitemapItem{
524524 /**
525525 * Var string
526526 **/
@@ -610,7 +610,7 @@
611611
612612 }
613613
614 -class SitemapFeed extends feedSMItem{
 614+class SitemapFeed extends FeedSitemapItem{
615615 /**
616616 * Output feed headers
617617 **/
@@ -623,7 +623,7 @@
624624 }
625625 /**
626626 * Output a SiteMap 0.9 item
627 - * @param feedSMItem item to be output
 627+ * @param FeedSitemapItem item to be output
628628 **/
629629 function outItem( $item ) {
630630 ?>
Index: trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.i18n.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Internationalisation file for extension special page GNSM
 4+ * Internationalisation file for extension special page GoogleNewsSitemap
55 * New version of DynamicPageList extension for use by Wikinews projects
66 *
77 * @addtogroup Extensions
@@ -13,7 +13,7 @@
1414 **/
1515
1616 $messages['en'] = array(
17 - 'gnsm' => 'Google News SiteMap',
 17+ 'gnsm' => 'Google News Sitemap',
1818 'gnsm-desc' => 'Outputs an Atom/RSS feed as a Google News Sitemap.',
1919 'gnsm_categorymap' => '', #default empty. list of categories to map to keywords. do not translate.
2020 'gnsm_toomanycats' => 'Error: Too many categories!',
@@ -27,7 +27,7 @@
2828 **/
2929
3030 $messages['fr'] = array(
31 - 'gnsm' => 'Google nouvelles SiteMap',
 31+ 'gnsm' => 'Google nouvelles Sitemap',
3232 'gnsm-desc' => 'Cre un Atom ou RSS feed comme un plan Sitemap pour Google.',
3333 'gnsm_toomanycats' => 'Erreur: Trop de nombreuses catégories!',
3434 'gnsm_toofewcats' => 'Erreur: Trop peu de catégories!',
Index: trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.php
@@ -1,8 +1,8 @@
22 <?php
33 if (!defined('MEDIAWIKI')) {
44 echo <<<EOT
5 -To install GNSM extension, an extension special page, put the following line in LocalSettings.php:
6 -require_once( dirname(__FILE__) . '/extensions/GNSM/SpecialGNSM.php' );
 5+To install GoogleNewsSitemap extension, an extension special page, put the following line in LocalSettings.php:
 6+require_once( dirname(__FILE__) . '/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.php' );
77 EOT;
88 exit( 1 );
99 }
@@ -17,11 +17,11 @@
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:GNSM[/][|category=Catname]
 21+ * This page can be accessed from Special:GoogleNewsSitemap[/][|category=Catname]
2222 * [|notcategory=OtherCatName][|namespace=0][|notnamespace=User]
2323 * [|feed=sitemap][|count=10][|mode=ul][|ordermethod=lastedit]
2424 * [|order=ascending] as well as being included like
25 - * {{Special:GNSM/[options][...]}}
 25+ * {{Special:GoogleNewsSitemap/[options][...]}}
2626 **
2727 * This program is free software; you can redistribute it and/or modify it
2828 * under the terms of the GNU General Public License as published by the Free
@@ -45,7 +45,7 @@
4646 * n:en:User:IlyaHaykinson http://en.wikinews.org/wiki/User:IlyaHaykinson
4747 **
4848 * FIXME requests
49 - * use=Mediawiki:GNSM_Feedname Parameter to allow on-site control of feed
 49+ * use=Mediawiki:GoogleNewsSitemap_Feedname Parameter to allow on-site control of feed
5050 **
5151 * @addtogroup Extensions
5252 *
@@ -55,15 +55,15 @@
5656 */
5757 $wgExtensionCredits['specialpage'][] = array(
5858 'path' => __FILE__,
59 - 'name' => 'GNSM',
 59+ 'name' => 'GoogleNewsSitemap',
6060 'author' => 'Amgine',
6161 'description' => 'Outputs xml based on defined criteria',
6262 'descriptionmsg' => 'gnsm-desc',
63 - 'url' => 'http://www.mediawiki.org/wiki/Extension:GNSM',
 63+ 'url' => 'http://www.mediawiki.org/wiki/Extension:GoogleNewsSitemap',
6464 );
6565
6666 $dir = dirname(__FILE__) . '/';
67 -$wgExtensionMessagesFiles['GNSM'] = $dir . 'SpecialGNSM.i18n.php';
68 -$wgExtensionAliasesFiles['GNSM'] = $dir . 'SpecialGNSM.alias.php';
69 -$wgAutoloadClasses['GNSM'] = $dir . 'SpecialGNSM_body.php';
70 -$wgSpecialPages['GNSM'] = 'GNSM';
\ No newline at end of file
 67+$wgExtensionMessagesFiles['GoogleNewsSitemap'] = $dir . 'SpecialGoogleNewsSitemap.i18n.php';
 68+$wgExtensionAliasesFiles['GoogleNewsSitemap'] = $dir . 'SpecialGoogleNewsSitemap.alias.php';
 69+$wgAutoloadClasses['GoogleNewsSitemap'] = $dir . 'SpecialGoogleNewsSitemap_body.php';
 70+$wgSpecialPages['GoogleNewsSitemap'] = 'GoogleNewsSitemap';
Index: trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.alias.php
@@ -1,42 +1,14 @@
22 <?php
33 /**
4 - * Aliases for Special:Editcount
 4+ * Aliases for Special:GoogleNewsSitemap
55 *
66 * @addtogroup Extensions
77 */
88
9 -/**
10 - * Deutsch
11 - * @author Amgine
12 - **/
13 -$aliases['de'] = array(
14 - 'GNSM' => array( 'SpezialGNSM' )
15 -);
16 -
179 /** English
1810 * @author Amgine
1911 **/
2012 $aliases['en'] = array(
21 - 'GNSM' => array( 'Google News SiteMap', 'SpecialGNSM' ),
 13+ 'GoogleNewsSitemap' => array( 'Google News Sitemap' ),
2214 );
2315
24 -/** Français
25 - * @author Amgine
26 - **/
27 -$aliases['fr'] = array(
28 - 'GNSM' => array( 'GNSMSpécial' ),
29 -);
30 -
31 -/** Nederlands
32 - * @author Amgine
33 - **/
34 -$aliases['nl'] = array(
35 - 'GNSM' => array( 'GNSMSpeciaal' )
36 -);
37 -
38 -/** Norsk (bokmål)
39 - * @author Amgine
40 - **/
41 -$aliases['no'] = array(
42 - 'GNSM' => array( 'SpesialGNSM' ),
43 -);
\ No newline at end of file

Follow-up revisions

RevisionCommit summaryAuthorDate
r78867Rename i18n key from gnsm to googlenewssitemap per fixme on r60965reedy00:24, 23 December 2010

Comments

#Comment by MarkAHershberger (talk | contribs)   18:32, 11 November 2010

- 'gnsm' => 'Google News SiteMap', + 'gnsm' => 'Google News Sitemap',

Because you used 'gnsm' here instead of 'googlenewssitemap' this shows up as <googlenewssitemap> on the list of special pages.

Status & tagging log