r78108 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78107‎ | r78108 | r78109 >
Date:02:19, 9 December 2010
Author:kim
Status:deferred (Comments)
Tags:
Comment:
Changes by Jason Giglio
Modified paths:
  • /trunk/extensions/GoogleNewsSitemap/FeedSitemapItem.php (deleted) (history)
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.alias.php (modified) (history)
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.i18n.php (modified) (history)
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.php (modified) (history)
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GoogleNewsSitemap/FeedSitemapItem.php
@@ -1,143 +0,0 @@
2 -<?php
3 -if ( !defined( 'MEDIAWIKI' ) ) die();
4 -
5 -/**
6 - * FeedSitemapItem Class
7 - **
8 - * Base class for basic SiteMap support, for building url containers.
9 - **/
10 -class FeedSitemapItem {
11 - /**
12 - * Var string
13 - **/
14 - var $url, $pubDate, $keywords, $lastMod, $priority;
15 -
16 - function __construct( $url, $pubDate, $keywords = '', $lastMod = '', $priority = '' ) {
17 - $this->url = $url;
18 - $this->pubDate = $pubDate;
19 - $this->keywords = $keywords;
20 - $this->lastMod = $lastMod;
21 - $this->priority = $priority;
22 - }
23 -
24 - public function xmlEncode( $string ) {
25 - $string = str_replace( "\r\n", "\n", $string );
26 - $string = preg_replace( '/[\x00-\x08\x0b\x0c\x0e-\x1f]/', '', $string );
27 - return htmlspecialchars( $string );
28 - }
29 -
30 - public function getUrl() {
31 - return $this->url;
32 - }
33 -
34 - public function getPriority() {
35 - return $this->priority;
36 - }
37 -
38 - public function getLastMod() {
39 - return $this->lastMod;
40 - }
41 -
42 - public function getKeywords () {
43 - return $this->xmlEncode( $this->keywords );
44 - }
45 -
46 - public function getPubDate() {
47 - return $this->pubDate;
48 - }
49 -
50 - function formatTime( $ts ) {
51 - // need to use RFC 822 time format at least for rss2.0
52 - return gmdate( 'Y-m-d\TH:i:s', wfTimestamp( TS_UNIX, $ts ) );
53 - }
54 -
55 - /**
56 - * Setup and send HTTP headers. Don't send any content;
57 - * content might end up being cached and re-sent with
58 - * these same headers later.
59 - *
60 - * This should be called from the outHeader() method,
61 - * but can also be called separately.
62 - *
63 - * @public
64 - **/
65 - function httpHeaders() {
66 - global $wgOut;
67 - # We take over from $wgOut, excepting its cache header info
68 - $wgOut->disable();
69 - $mimetype = $this->contentType();
70 - header( "Content-type: $mimetype; charset=UTF-8" );
71 - $wgOut->sendCacheControl();
72 -
73 - }
74 -
75 - function outXmlHeader() {
76 - $this->httpHeaders();
77 - echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
78 - }
79 -
80 - /**
81 - * Return an internet media type to be sent in the headers.
82 - *
83 - * @return string
84 - * @private
85 - **/
86 - function contentType() {
87 - global $wgRequest;
88 - $ctype = $wgRequest->getVal( 'ctype', 'application/xml' );
89 - $allowedctypes = array( 'application/xml', 'text/xml', 'application/rss+xml', 'application/atom+xml' );
90 - return ( in_array( $ctype, $allowedctypes ) ? $ctype : 'application/xml' );
91 - }
92 -}
93 -
94 -class SitemapFeed extends FeedSitemapItem {
95 - /**
96 - * Output feed headers
97 - **/
98 - function outHeader() {
99 - $this->outXmlHeader();
100 - ?>
101 -<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
102 - xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
103 - <?php
104 - }
105 - /**
106 - * Output a SiteMap 0.9 item
107 - * @param FeedSitemapItem item to be output
108 - **/
109 - function outItem( $item ) {
110 - ?>
111 -<url>
112 -<loc>
113 - <?php print $item->getUrl() ?>
114 -</loc>
115 -<news:news>
116 - <news:publication_date>
117 - <?php print $item->getPubDate() ?>
118 - </news:publication_date>
119 - <?php if ( $item->getKeywords() ) {
120 - echo '<news:keywords>' . $item->getKeywords() . "</news:keywords>\n";
121 - }
122 - ?>
123 -</news:news>
124 - <?php if ( $item->getLastMod() ) { ?>
125 -<lastmod>
126 - <?php print $item->getLastMod(); ?>
127 -</lastmod>
128 - <?php } ?>
129 - <?php if ( $item->getPriority() ) { ?>
130 -<priority>
131 - <? print $item->getPriority(); ?>
132 -</priority>
133 - <?php } ?>
134 -</url>
135 - <?php
136 - }
137 -
138 - /**
139 - * Output SiteMap 0.9 footer
140 - **/
141 - function outFooter() {
142 - echo '</urlset>';
143 - }
144 -}
Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
@@ -1,32 +1,34 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) die();
 3+if (!defined('MEDIAWIKI')) die();
44
55 /**
6 - * Class GoogleNewsSitemap creates Atom/RSS feeds for Wikinews
 6+ * Class GNSM 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:GoogleNewsSitemap/<feedType>?[paramter=value][...]
 10+ * To use: http://wiki.url/Special:GNSM/[paramter=value][...]
1111 *
1212 * Implemented parameters are marked with an @
1313 **
1414 * Parameters
15 - * * category = string ; default = Published
16 - * * notcategory = string ; default = null
17 - * * namespace = string ; default = null
18 - * * count = integer ; default = $wgDPLmaxResultCount = 50
19 - * * order = string ; default = descending
20 - * * ordermethod = string ; default = categoryadd
21 - * * redirects = string ; default = exclude
22 - * * stablepages = string ; default = null
23 - * * qualitypages = string ; default = null
24 - * * feed = string ; default = atom
 15+ * * category = string ; default = Published
 16+ * * notcategory = string ; default = null
 17+ * * namespace = string ; default = null
 18+ * * count = integer ; default = $wgDPLmaxResultCount = 50
 19+ * * order = string ; default = descending
 20+ * * ordermethod = string ; default = categoryadd
 21+ * * redirects = string ; default = exclude
 22+ * * stablepages = string ; default = null
 23+ * * qualitypages = string ; default = null
 24+ * * feed = string ; default = atom
2525 * usenamespace = bool ; default = false
2626 * usecurid = bool ; default = false
2727 * suppresserrors = bool ; default = false
2828 **/
2929
30 -class GoogleNewsSitemap extends IncludableSpecialPage {
 30+class GNSM extends IncludableSpecialPage {
 31+
 32+
3133 /**
3234 * FIXME: Some of this might need a config eventually
3335 * @var string
@@ -44,425 +46,305 @@
4547 /**
4648 * Script default values - correctly spelt, naming standard.
4749 **/
48 - var $wgDPlminCategories = 1; // Minimum number of categories to look for
49 - var $wgDPlmaxCategories = 6; // Maximum number of categories to look for
50 - var $wgDPLminResultCount = 1; // Minimum number of results to allow
51 - var $wgDPLmaxResultCount = 50; // Maximum number of results to allow
52 - var $wgDPLallowUnlimitedResults = true; // Allow unlimited results
 50+ var $wgDPlminCategories = 1; // Minimum number of categories to look for
 51+ var $wgDPlmaxCategories = 6; // Maximum number of categories to look for
 52+ var $wgDPLminResultCount = 1; // Minimum number of results to allow
 53+ var $wgDPLmaxResultCount = 50; // Maximum number of results to allow
 54+ var $wgDPLallowUnlimitedResults = true; // Allow unlimited results
5355 var $wgDPLallowUnlimitedCategories = false; // Allow unlimited categories
5456
 57+
5558 /**
5659 * @var array Parameters array
5760 **/
5861 var $params = array();
5962 var $categories = array();
6063 var $notCategories = array();
61 -
 64+
6265 /**
6366 * Constructor
6467 **/
6568 public function __construct() {
66 - parent::__construct( 'GoogleNewsSitemap' );
 69+ parent::__construct( 'GNSM' );
6770 }
68 -
 71+
6972 /**
7073 * main()
7174 **/
7275 public function execute( $par ) {
 76+ global $wgUser;
 77+ global $wgLang;
 78+ global $wgContLang;
 79+ global $wgRequest, $wgOut;
7380 global $wgSitename, $wgServer, $wgScriptPath;
 81+ // global $wfTimeStamp;
 82+ wfLoadExtensionMessages( 'GNSM' );
7483 global $wgFeedClasses, $wgLocaltimezone;
75 -
 84+
7685 // Not sure how clean $wgLocaltimezone is
7786 // In fact, it's default setting is null...
78 - if ( null == $wgLocaltimezone ) {
 87+ if ( null == $wgLocaltimezone )
7988 $wgLocaltimezone = date_default_timezone_get();
80 - }
8189 date_default_timezone_set( $wgLocaltimezone );
82 - // $url = __FILE__;
 90+ //$url = __FILE__;
8391
84 - $this->dpl_parm( $par );
 92+ $this->unload_params(); //populates this->params as a side effect
8593
 94+
8695 $wgFeedClasses[] = array( 'sitemap' => 'SitemapFeed' );
87 -
88 - if ( 'sitemap' == $this->params['feed'] ) {
 96+
 97+ if ( 'sitemap' == $this->params['feed'] ){
8998 $feed = new SitemapFeed(
90 - $wgServer . $wgScriptPath,
91 - date( DATE_ATOM )
 99+ $wgServer.$wgScriptPath,
 100+ date( DATE_ATOM )
92101 );
93 - } else {
 102+ }else{
94103 // FIXME: These should be configurable at some point
95104 $feed = new $wgFeedClasses[ $this->params['feed'] ](
96105 $wgSitename,
97106 $wgSitename . ' ' . $this->params['feed'] . ' feed',
98 - $wgServer . $wgScriptPath,
 107+ $wgServer.$wgScriptPath,
99108 date( DATE_ATOM ),
100109 $wgSitename
101110 );
102111 }
103112
104113 $feed->outHeader();
105 -
 114+
106115 // main routine to output items
107 - if ( isset( $this->params['error'] ) ) {
108 - echo $this->params['error'];
109 - } else {
110 - $dbr = wfGetDB( DB_SLAVE );
111 - $sql = $this->dpl_buildSQL();
112 - // Debug line
113 - // echo "\n<p>$sql</p>\n";
114 - $res = $dbr->query ( $sql );
 116+ if ( isset( $this->param['error'] ) ){
 117+ $wgOut->disable();
 118+ echo $this->param['error'];
 119+ $feed->outFooter();
 120+ return;
 121+ }
115122
116 - // FIXME: figure out how to fail with no results gracefully
117 - if ( $dbr->numRows( $res ) == 0 ) {
 123+ $dbr =& wfGetDB( DB_SLAVE );
 124+ $sql = $this->dpl_buildSQL();
 125+ //Debug line
 126+ //echo "\n<p>$sql</p>\n";
 127+ $res = $dbr->query ( $sql );
 128+
 129+ // FIXME: figure out how to fail with no results gracefully
 130+ if ( $dbr->numRows( $res ) == 0 ){
 131+ $feed->outFooter();
 132+ if ( false == $this->params['suppressErrors'] )
 133+ return htmlspecialchars( wfMsg( 'gnsm_noresults' ) );
 134+ else
 135+ return '';
 136+ }
 137+
 138+ while ($row = $dbr->fetchObject( $res ) ) {
 139+ $title = Title::makeTitle( $row->page_namespace, $row->page_title);
 140+
 141+ if ( ! $title ){
118142 $feed->outFooter();
119 - if ( false == $this->params['suppressErrors'] ) {
120 - return htmlspecialchars( wfMsg( 'gnsm_noresults' ) );
121 - } else {
122 - return '';
123 - }
 143+ return;
124144 }
 145+
 146+ $titleText = ( true == $this->params['nameSpace'] ) ? $title->getPrefixedText() : $title->getText();
 147+
 148+ if ( 'sitemap' == $this->params['feed'] ){
 149+
 150+ $this->pubDate = isset( $row->cl_timestamp ) ? $row->cl_timestamp : date( DATE_ATOM );
 151+ $feedArticle = new Article( $title );
125152
126 - foreach ($res as $row ) {
127 - $title = Title::makeTitle( $row->page_namespace, $row->page_title );
128 -
129 - if ( $title ) {
130 - if ( 'sitemap' == $this->params['feed'] ) {
131 -
132 - $this->pubDate = isset( $row->cl_timestamp ) ? $row->cl_timestamp : date( DATE_ATOM );
133 - $feedArticle = new Article( $title );
134 -
135 - $feedItem = new FeedSitemapItem(
136 - trim( $title->getFullURL() ),
137 - wfTimeStamp( TS_ISO_8601, $this->pubDate ),
138 - $this->getKeywords( $title ),
139 - wfTimeStamp( TS_ISO_8601, $feedArticle->getTouched() ),
140 - $feed->getPriority( $this->priority )
141 - );
142 -
143 - } elseif ( ( 'atom' == $this->params['feed'] ) || ( 'rss' == $this->params['feed'] ) ) {
144 - $this->Date = isset( $row->cl_timestamp ) ? $row->cl_timestamp : date( DATE_ATOM );
145 - if ( isset( $row->comment ) ) {
146 - $comments = htmlspecialchars( $row->comment );
147 - } else {
148 - $talkpage = $title->getTalkPage();
149 - $comments = $talkpage->getFullURL();
150 - }
151 - $titleText = ( true === $this->params['nameSpace'] )
152 - ? $title->getPrefixedText()
153 - : $title->getText();
154 - $feedItem = new FeedItem(
155 - $titleText,
156 - $this->feedItemDesc( $row ),
157 - $title->getFullURL(),
158 - $this->Date,
159 - $this->feedItemAuthor( $row ),
160 - $comments
161 - );
162 - }
163 - $feed->outItem( $feedItem );
 153+ $feedItem = new feedSMItem(
 154+ trim( $title->getFullURL() ),
 155+ wfTimeStamp( TS_ISO_8601, $this->pubDate ),
 156+ $this->getKeywords( $title ),
 157+ wfTimeStamp( TS_ISO_8601, $feedArticle->getTouched() ),
 158+ $feed->getPriority( $this->priority )
 159+ );
 160+
 161+ }elseif ( ('atom' == $this->params['feed'] ) || ( 'rss' == $this->params['feed'] ) ){
 162+
 163+ $this->Date = isset( $row->cl_timestamp ) ? $row->cl_timestamp : date( DATE_ATOM );
 164+ if ( isset( $row->comment ) ){
 165+ $comments = htmlspecialchars( $row->comment );
 166+ }else{
 167+ $talkpage = $title->getTalkPage();
 168+ $comments = $talkpage->getFullURL();
164169 }
 170+ $titleText = (true === $this->params['nameSpace'] ) ? $title->getPrefixedText() : $title->getText();
 171+ $feedItem = new FeedItem(
 172+ $titleText,
 173+ $this->feedItemDesc( $row ),
 174+ $title->getFullURL(),
 175+ $this->Date,
 176+ $this->feedItemAuthor( $row ),
 177+ $comments);
165178 }
166 - }
 179+ $feed->outItem( $feedItem );
 180+ }//end while fetchobject
167181 $feed->outFooter();
168 - }
169 -
 182+ } //end public function execute
 183+
170184 /**
171185 * Build sql
172186 **/
173 - public function dpl_buildSQL() {
174 - $dbr = wfGetDB( DB_SLAVE );
175 - $sqlSelectFrom = 'SELECT page_namespace, page_title, page_id, c1.cl_timestamp FROM '
176 - . $dbr->tableName( 'page' );
177 -
178 - if ( $this->params['nameSpace'] ) {
179 - $sqlWhere = ' WHERE page_namespace=' . $this->params['iNameSpace'] . ' ';
180 - } else {
 187+ public function dpl_buildSQL(){
 188+
 189+ $sqlSelectFrom = 'SELECT page_namespace, page_title, page_id, c1.cl_timestamp FROM ' . $this->params['dbr']->tableName( 'page' );
 190+
 191+ if ( $this->params['nameSpace'] ){
 192+ $sqlWhere = ' WHERE page_namespace=' . $this->params['nameSpace'] . ' ';
 193+ }else{
181194 $sqlWhere = ' WHERE 1=1 ';
182195 }
183 -
 196+
184197 // If flagged revisions is in use, check which options selected.
185198 // FIXME: double check the default options in function::dpl_parm; what should it default to?
186 - if ( function_exists( 'efLoadFlaggedRevs' ) ) {
187 - $flaggedPages = $dbr->tableName( 'flaggedpages' );
 199+ if( function_exists('efLoadFlaggedRevs') ) {
 200+ $flaggedPages = $this->params['dbr']->tableName( 'flaggedpages' );
188201 $filterSet = array( 'only', 'exclude' );
189202 # Either involves the same JOIN here...
190 - if ( in_array( $this->params['stable'], $filterSet ) || in_array( $this->params['quality'], $filterSet ) ) {
 203+ if( in_array( $this->params['stable'], $filterSet ) || in_array( $this->params['quality'], $filterSet ) ) {
191204 $sqlSelectFrom .= " LEFT JOIN $flaggedPages ON page_id = fp_page_id";
192 - }
193 - switch( $this->params['stable'] ) {
 205+ }
 206+ switch( $this->params['stable'] ){
194207 case 'only':
195208 $sqlWhere .= ' AND fp_stable IS NOT NULL ';
196209 break;
197210 case 'exclude':
198211 $sqlWhere .= ' AND fp_stable IS NULL ';
199212 break;
200 - }
201 - switch( $this->params['quality'] ) {
 213+ }
 214+ switch( $this->params['quality'] ){
202215 case 'only':
203 - $sqlWhere .= ' AND fp_quality >= 1';
 216+ $sqlWhere .= ' AND fp_quality >= 1';
204217 break;
205218 case 'exclude':
206219 $sqlWhere .= ' AND fp_quality = 0';
207220 break;
 221+ }
208222 }
209 - }
210 -
211 - switch ( $this->params['redirects'] ) {
212 - case 'only':
213 - $sqlWhere .= ' AND page_is_redirect = 1 ';
 223+
 224+ switch ( $this->params['redirects'] ){
 225+ case 'only':
 226+ $sqlWhere .= ' AND page_is_redirect = 1 ';
214227 break;
215 - case 'exclude':
216 - $sqlWhere .= ' AND page_is_redirect = 0 ';
 228+ case 'exclude':
 229+ $sqlWhere .= ' AND page_is_redirect = 0 ';
217230 break;
218 - }
 231+ }
 232+
 233+ $currentTableNumber = 0;
 234+
 235+ for ( $i = 0; $i < $this->params['catCount']; $i++ ){
 236+ $sqlSelectFrom .= ' INNER JOIN ' . $this->params['dbr']->tableName( 'categorylinks' );
 237+ $sqlSelectFrom .= ' AS c' . ( $currentTableNumber + 1 ) . ' ON page_id = c';
 238+ $sqlSelectFrom .= ( $currentTableNumber + 1 ) . '.cl_from AND c' . ( $currentTableNumber + 1 );
219239
220 - $currentTableNumber = 0;
 240+ $sqlSelectFrom .= '.cl_to=' . $this->params['dbr']->addQuotes( $this->categories[$i]->getDBkey() );
 241+
 242+ $currentTableNumber++;
 243+ }
221244
222 - for ( $i = 0; $i < $this->params['catCount']; $i++ ) {
 245+ for ( $i = 0; $i < $this->params['notCatCount']; $i++ ){
 246+ //echo "notCategory parameter $i<br />\n";
 247+ $sqlSelectFrom .= ' LEFT OUTER JOIN ' . $this->params['dbr']->tableName( 'categorylinks' );
 248+ $sqlSelectFrom .= ' AS c' . ( $currentTableNumber + 1 ) . ' ON page_id = c' . ( $currentTableNumber + 1 );
 249+ $sqlSelectFrom .= '.cl_from AND c' . ( $currentTableNumber + 1 );
 250+ $sqlSelectFrom .= '.cl_to=' . $this->params['dbr']->addQuotes( $this->notCategories[$i]->getDBkey() );
 251+
 252+ $sqlWhere .= ' AND c' . ( $currentTableNumber + 1 ) . '.cl_to IS NULL';
223253
224 - $sqlSelectFrom .= ' INNER JOIN ' . $dbr->tableName( 'categorylinks' );
225 - $sqlSelectFrom .= ' AS c' . ( $currentTableNumber + 1 ) . ' ON page_id = c';
226 - $sqlSelectFrom .= ( $currentTableNumber + 1 ) . '.cl_from AND c' . ( $currentTableNumber + 1 );
 254+ $currentTableNumber++;
 255+ }
 256+
 257+ if ('lastedit' == $this->params['orderMethod'] ){
 258+ $sqlWhere .= ' ORDER BY page_touched ';
 259+ }else{
 260+ $sqlWhere .= ' ORDER BY c1.cl_timestamp ';
 261+ }
 262+
 263+ if ( 'descending' == $this->params['order'] ){
 264+ $sqlWhere .= 'DESC';
 265+ }else{
 266+ $sqlWhere .= 'ASC';
 267+ }
227268
228 - $sqlSelectFrom .= '.cl_to=' . $dbr->addQuotes( $this->categories[$i]->getDBkey() );
229 -
230 - $currentTableNumber++;
231 - }
232 -
233 - for ( $i = 0; $i < $this->params['notCatCount']; $i++ ) {
234 - // echo "notCategory parameter $i<br />\n";
235 - $sqlSelectFrom .= ' LEFT OUTER JOIN ' . $dbr->tableName( 'categorylinks' );
236 - $sqlSelectFrom .= ' AS c' . ( $currentTableNumber + 1 ) . ' ON page_id = c' . ( $currentTableNumber + 1 );
237 - $sqlSelectFrom .= '.cl_from AND c' . ( $currentTableNumber + 1 );
238 - $sqlSelectFrom .= '.cl_to=' . $dbr->addQuotes( $this->notCategories[$i]->getDBkey() );
239 -
240 - $sqlWhere .= ' AND c' . ( $currentTableNumber + 1 ) . '.cl_to IS NULL';
241 -
242 - $currentTableNumber++;
243 - }
244 -
245 - if ( 'lastedit' == $this->params['orderMethod'] ) {
246 - $sqlWhere .= ' ORDER BY page_touched ';
247 - } else {
248 - $sqlWhere .= ' ORDER BY c1.cl_timestamp ';
249 - }
250 -
251 - if ( 'descending' == $this->params['order'] ) {
252 - $sqlWhere .= 'DESC';
253 - } else {
254 - $sqlWhere .= 'ASC';
255 - }
256 - // FIXME: Note: this is not a boolean type check - will also trap count = 0 which may
257 - // accidentally give unlimited returns
258 - if ( 0 < $this->params['count'] ) {
259 - $sqlWhere .= ' LIMIT ' . $this->params['count'];
260 - }
261 -
262 - return $sqlSelectFrom . $sqlWhere;
263 - }
264 -
 269+ // FIXME: Note: this is not a boolean type check - will also trap count = 0 which may
 270+ // accidentally give unlimited returns
 271+ if ( 0 < $this->params['count'] ){
 272+ $sqlWhere .= ' LIMIT ' . $this->params['count'];
 273+ }
 274+
 275+ //debug line
 276+ //echo "<p>$sqlSelectFrom$sqlWhere;</p>\n";
 277+
 278+ return $sqlSelectFrom . $sqlWhere;
 279+ } //end buildSQL
 280+
265281 /**
266282 * Parse parameters
267283 **
268284 * FIXME this includes a lot of DynamicPageList cruft in need of thinning.
269285 **/
270 - public function dpl_parm( $par ) {
 286+ public function unload_params(){
271287 global $wgContLang;
272288 global $wgRequest;
 289+ global $wgOut;
 290+ $wgOut->disable();
273291
274 - $params = $wgRequest->getValues();
275 - // FIXME: note: if ( false === $count ) then no count has ever been set
276 - // however, there's still no guarantee $count <> zero || NULL
277 - $this->params['count'] = $this->wgDPLmaxResultCount;
278 -
279 - $this->params['orderMethod'] = 'categoryadd';
280 - $this->params['order'] = 'descending';
281 - $this->params['redirects'] = 'exclude';
282 - $this->params['stable'] = $this->params['quality'] = 'only';
283 -
284 - $this->params['nameSpace'] = false;
285 - $this->params['iNameSpace'] = 0;
286 -
287 - $this->params['useNameSpace'] = false;
288 - $this->params['useCurId'] = false;
289 -
290 - $this->params['suppressErrors'] = false;
291 -
292 - $this->params['feed'] = 'atom';
293 - $feedType = explode( '/', $par, 2 );
294 - switch( strtolower( $feedType[0] ) ) {
295 - case 'rss':
296 - $this->params['feed'] = 'rss';
297 - break;
298 - case 'sitemap':
299 - $this->params['feed'] = 'sitemap';
300 - break;
301 - default:
302 - $this->params['feed'] = 'atom';
303 - break;
304 - }
305 -
 292+ $this->params = array();
306293 $parser = new Parser;
307 - $poptions = new ParserOptions;
 294+ $poptions = new ParserOptions;
 295+ $category = $wgRequest->getArray('category', 'Published');
 296+ //$title = Title::newFromText( $parser->transformMsg( $category, $poptions ) );
 297+ //if ( is_object( $title ) ){
 298+ // $this->categories[] = $title;
 299+ // }
 300+ //FIXME:notcats
 301+ //$this->notCategories[] = $wgRequest->getArray('notcategory');
 302+ $this->params['nameSpace'] = $wgContLang->getNsIndex($wgRequest->getVal('namespace',0));
 303+ $this->params['count'] = $wgRequest->getInt('count', $this->wgDPLmaxResultCount);
 304+ if (($this->params['count'] > $this->wgDPLmaxResultCount)||($this->params['count'] < $this->wgDPLminResultCount))
 305+ $this->params['count'] = $this->wgDPLmaxResultCount;
308306
309 - foreach ( $params as $key => $value ) {
310 - switch ( $key ) {
311 - case 'category':
312 - $title = Title::newFromText( $parser->transformMsg( $value, $poptions ) );
 307+ $this->params['order'] = $wgRequest->getVal('order', 'descending');
 308+ $this->params['orderMethod'] = $wgRequest->getVal('ordermethod', 'categoryadd');
 309+ $this->params['redirects'] = $wgRequest->getVal('redirects', 'exclude');
 310+ $this->params['stable'] = $wgRequest->getVal('stable','only');
 311+ $this->params['quality'] = $wgRequest->getVal('qualitypages', 'only');
 312+ $this->params['suppressErrors']=$wgRequest->getBool('supresserrors', false);
 313+ $this->params['useNameSpace'] = $wgRequest->getBool('usenamespace', false);
 314+ $this->params['useCurId'] = $wgRequest->getBool('usecurid', false);
 315+ $this->params['feed'] = $wgRequest->getVal('feed', 'sitemap');
313316
314 - if ( is_object( $title ) ) {
315 - $this->categories[] = $title;
316 - } else {
317 - echo "Explode on category.\n";
318 - continue;
319 - }
320 - break;
321 - case 'notcategory':
322 - // echo "Got notcategory $value\n";
323 - $title = Title::newFromText( $parser->transformMsg( $value, $poptions ) );
324 - if ( is_object( $title ) )
325 - $this->notCategories[] = $title;
326 - else {
327 - echo 'Explode on notCategory.';
328 - continue;
329 - }
330 - break;
331 - case 'namespace':
332 - if ( $value == intval( $value ) ) {
333 - $this->params['iNameSpace'] = intval( $value );
334 - if ( 0 <= $this->params['iNameSpace'] ) {
335 - $this->params['nameSpace'] = true;
336 - } else {
337 - $this->params['nameSpace'] = false;
338 - }
339 - } else {
340 - $ns = $wgContLang->getNsIndex( $value );
341 - if ( null !== $ns ) {
342 - $this->params['iNameSpace'] = $ns;
343 - $this->params['nameSpace'] = true;
344 - }
345 - }
346 - break;
347 - case 'count':
348 - if ( ( $this->wgDPLminResultCount < $value ) && ( $value < $this->wgDPLmaxResultCount ) ) {
349 - $this->params['count'] = intval( $value );
350 - }
351 - break;
352 - case 'order';
353 - switch ( $value ) {
354 - case 'ascending':
355 - $this->params['order'] = 'ascending';
356 - break;
357 - case 'descending':
358 - default:
359 - $this->params['order'] = 'descending';
360 - break;
361 - }
362 - break;
363 - case 'ordermethod';
364 - switch ( $value ) {
365 - case 'lastedit':
366 - $this->params['orderMethod'] = 'lastedit';
367 - break;
368 - case 'categoryadd':
369 - default:
370 - $this->params['orderMethod'] = 'categoryadd';
371 - break;
372 - }
373 - break;
374 - case 'redirects';
375 - switch ( $value ) {
376 - case 'include':
377 - $this->params['redirects'] = 'include';
378 - break;
379 - case 'only':
380 - $this->params['redirects'] = 'only';
381 - break;
382 - case 'exclude':
383 - default:
384 - $this->params['redirects'] = 'exclude';
385 - break;
386 - }
387 - break;
388 - case 'stablepages':
389 - switch ( $value ) {
390 - case 'include':
391 - $this->params['stable'] = 'include';
392 - break;
393 - case 'exclude':
394 - $this->params['stable'] = 'exclude';
395 - break;
396 - case 'only':
397 - default:
398 - $this->params['stable'] = 'only';
399 - break;
400 - }
401 - break;
402 - case 'qualitypages':
403 - switch ( $value ) {
404 - case 'include':
405 - $this->params['quality'] = 'include';
406 - break;
407 - case 'only':
408 - $this->params['quality'] = 'only';
409 - break;
410 - case 'exclude':
411 - default:
412 - $this->params['quality'] = 'exclude';
413 - break;
414 - }
415 - break;
416 - case 'suppresserrors':
417 - // note: if previously set to true, remains true. malformed does not reset to false.
418 - if ( $value === 'true' ) {
419 - $this->params['suppressErrors'] = true;
420 - }
421 - break;
422 - case 'usenamespace':
423 - // note: if previously set to false, remains false. Malformed does not reset to true.
424 - if ( $value === 'false' ) {
425 - $this->params['useNameSpace'] = false;
426 - }
427 - break;
428 - case 'usecurid':
429 - // note: if previously set to true, remains true. Malformed does not reset to false.
430 - if ( $value === 'true' ) {
431 - $this->params['useCurId'] = true;
432 - }
433 - break;
434 - default:
435 - }
436 - }
437 -
 317+
438318 $this->params['catCount'] = count( $this->categories );
439319 $this->params['notCatCount'] = count( $this->notCategories );
440320 $totalCatCount = $this->params['catCount'] + $this->params['notCatCount'];
441 -
442 - if ( ( $this->params['catCount'] < 1 && false == $this->params['nameSpace'] )
443 - || ( $totalCatCount < $this->wgDPlminCategories ) ) {
444 - // echo "Boom on catCount\n";
 321+ if (( $this->params['catCount'] < 1 && false == $this->params['nameSpace'] ) || ( $totalCatCount < $this->wgDPlminCategories )){
 322+ //echo "Boom on catCount\n";
445323 $parser = new Parser;
446324 $poptions = new ParserOptions;
447325 $feed = Title::newFromText( $parser->transformMsg( 'Published', $poptions ) );
448 - if ( is_object( $feed ) ) {
 326+ if ( is_object( $feed ) ){
449327 $this->categories[] = $feed;
450 - $this->params['catCount'] = count( $this->categories );
451 - } else {
 328+ $this->params['catCount'] = count( $this->categories );
 329+ }else{
452330 echo "\$feed is not an object.\n";
 331+ continue;
453332 }
454333 }
455 -
456 - if ( ( $totalCatCount > $this->wgDPlmaxCategories ) && ( !$this->wgDPLallowUnlimitedCategories ) ) {
 334+
 335+ if ( ( $totalCatCount > $this->wgDPlmaxCategories ) && ( !$this->wgDPLallowUnlimitedCategories ) ){
457336 $this->params['error'] = htmlspecialchars( wfMsg( 'intersection_toomanycats' ) ); // "!!too many categories!!";
458337 }
459 -
460 - // disallow showing date if the query doesn't have an inclusion category parameter
461 - if ( $this->params['count'] < 1 ) {
 338+
 339+ //disallow showing date if the query doesn't have an inclusion category parameter
 340+ if ( $this->params['count'] < 1 )
462341 $this->params['addFirstCategoryDate'] = false;
463 - }
 342+
 343+ $this->params['dbr'] =& wfGetDB( DB_SLAVE );
 344+ //print_r($this->notCategories);
 345+ //print_r($this->categories);
464346 return;
465347 }
466 -
 348+
467349 function feedItemAuthor( $row ) {
468350 return isset( $row->user_text ) ? $row->user_text : 'Wikinews';
469351 }
@@ -470,38 +352,169 @@
471353 function feedItemDesc( $row ) {
472354 return isset( $row->comment ) ? htmlspecialchars( $row->comment ) : '';
473355 }
474 -
475 - function getKeywords ( $title ) {
 356+
 357+ function getKeywords ( $title ){
476358 $cats = $title->getParentCategories();
477359 $str = '';
478 - # the following code is based (stolen) from r56954 of flagged revs.
 360+ #the following code is based (stolen) from r56954 of flagged revs.
479361 $catMap = Array();
480362 $catMask = Array();
481363 $msg = wfMsg( 'gnsm_categorymap' );
482364 if ( !wfEmptyMsg( 'gnsm_categorymap', $msg ) ) {
483 - $list = explode( "\n*", "\n$msg" );
484 - foreach ( $list as $item ) {
485 - $mapping = explode( '|', $item, 2 );
 365+ $list = explode( "\n*", "\n$msg");
 366+ foreach($list as $item) {
 367+ $mapping = explode('|', $item, 2);
486368 if ( count( $mapping ) == 2 ) {
487 - if ( trim( $mapping[1] ) == '__MASK__' ) {
488 - $catMask[trim( $mapping[0] )] = true;
 369+ if ( trim( $mapping[1] ) == '__MASK__') {
 370+ $catMask[trim($mapping[0])] = true;
489371 } else {
490 - $catMap[trim( $mapping[0] )] = trim( $mapping[1] );
 372+ $catMap[trim($mapping[0])] = trim($mapping[1]);
491373 }
492374 }
493375 }
494376 }
495 - foreach ( $cats as $key => $val ) {
 377+ foreach ( $cats as $key => $val ){
496378 $cat = str_replace( '_', ' ', trim( substr( $key, strpos( $key, ':' ) + 1 ) ) );
497 - if ( !isset( $catMask[$cat] ) ) {
498 - if ( isset( $catMap[$cat] ) ) {
499 - $str .= ', ' . str_replace( '_', ' ', trim ( $catMap[$cat] ) );
500 - } else {
501 - $str .= ', ' . $cat;
 379+ if (!isset($catMask[$cat])) {
 380+ if (isset($catMap[$cat])) {
 381+ $str .= ', ' . str_replace( '_', ' ', trim ( $catMap[$cat] ) );
 382+ } else {
 383+ $str .= ', ' . $cat;
 384+ }
502385 }
503 - }
504386 }
505 - $str = substr( $str, 2 ); # to remove leading ', '
 387+ $str = substr( $str, 2 ); #to remove leading ', '
506388 return $str;
507389 }
 390+
508391 }
 392+
 393+/**
 394+ * feedSMItem Class
 395+ **
 396+ * Base class for basic SiteMap support, for building url containers.
 397+ **/
 398+class feedSMItem{
 399+ /**
 400+ * Var string
 401+ **/
 402+ var $url = '';
 403+ var $pubDate = '';
 404+ var $keywords = '';
 405+ var $lastMod = '';
 406+ var $priority = '';
 407+
 408+ function __construct( $url, $pubDate, $keywords = '', $lastMod = '', $priority = ''){
 409+ $this->url = $url;
 410+ $this->pubDate = $pubDate;
 411+ $this->keywords = $keywords;
 412+ $this->lastMod = $lastMod;
 413+ $this->priority = $priority;
 414+ }
 415+
 416+ public function xmlEncode( $string ){
 417+ $string = str_replace( "\r\n", "\n", $string );
 418+ $string = preg_replace( '/[\x00-\x08\x0b\x0c\x0e-\x1f]/', '', $string );
 419+ return htmlspecialchars( $string );
 420+ }
 421+
 422+ public function getUrl(){
 423+ return $this->url;
 424+ }
 425+
 426+ public function getPriority(){
 427+ return $this->priority;
 428+ }
 429+
 430+ public function getLastMod(){
 431+ return $this->lastMod;
 432+ }
 433+
 434+ public function getKeywords (){
 435+ return $this->xmlEncode( $this->keywords );
 436+ }
 437+
 438+ public function getPubDate(){
 439+ return $this->pubDate;
 440+ }
 441+
 442+ function formatTime( $ts ) {
 443+ // need to use RFC 822 time format at least for rss2.0
 444+ return gmdate( 'Y-m-d\TH:i:s', wfTimestamp( TS_UNIX, $ts ) );
 445+ }
 446+
 447+}
 448+
 449+class SitemapFeed extends feedSMItem{
 450+ private $writer;
 451+
 452+
 453+ function __construct(){
 454+ global $wgOut;
 455+ $this->writer=new XMLWriter();
 456+ $wgOut->disable();
 457+ }
 458+ /**
 459+ * Output feed headers
 460+ **/
 461+ function outHeader(){
 462+ global $wgOut;
 463+ global $wgRequest;
 464+
 465+ //FIXME: Why can't we just pick one mime type and always send that?
 466+ $ctype = $wgRequest->getVal( 'ctype', 'application/xml' );
 467+ $allowedctypes = array( 'application/xml', 'text/xml', 'application/rss+xml', 'application/atom+xml' );
 468+ $mimetype = in_array( $ctype, $allowedctypes ) ? $ctype : 'application/xml';
 469+ header( "Content-type: $mimetype; charset=UTF-8" );
 470+ $wgOut->sendCacheControl();
 471+
 472+ $this->writer->openURI('php://output');
 473+ $this->writer->setIndent(true);
 474+ $this->writer->startDocument("1.0", "UTF-8");
 475+ $this->writer->startElement("urlset");
 476+ $this->writer->writeAttribute("xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9");
 477+ $this->writer->writeAttribute("xmlns:news", "http://www.google.com/schemas/sitemap-news/0.9");
 478+ $this->writer->flush();
 479+ }
 480+ /**
 481+ * Output a SiteMap 0.9 item
 482+ * @param feedSMItem item to be output
 483+ **/
 484+ function outItem( $item ) {
 485+
 486+ $this->writer->startElement("url");
 487+ $this->writer->startElement("loc");
 488+ $this->writer->text($item->getUrl());
 489+ $this->writer->endElement();
 490+ $this->writer->startElement("news:news");
 491+ $this->writer->startElement("news:publication_date");
 492+ $this->writer->text($item->getPubDate());
 493+ $this->writer->endElement();
 494+ if( $item->getKeywords() ){
 495+ $this->writer->startElement("news:keywords");
 496+ $this->writer->text($item->getKeywords());
 497+ $this->writer->endElement();
 498+ }
 499+ $this->writer->endElement(); //end news:news
 500+ if( $item->getLastMod() ){
 501+ $this->writer->startElement("lastmod");
 502+ $this->writer->text($item->getLastMod());
 503+ $this->writer->endElement();
 504+ }
 505+ if( $item->getPriority() ){
 506+ $this->writer->startElement("priority");
 507+ $this->writer->text($item->getPriority());
 508+ $this->writer->endElement();
 509+ }
 510+ $this->writer->endElement(); //end url
 511+ }
 512+
 513+ /**
 514+ * Output SiteMap 0.9 footer
 515+ **/
 516+ function outFooter(){
 517+ $this->writer->endDocument();
 518+ $this->writer->flush();
 519+ }
 520+
 521+}
Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.i18n.php
@@ -1,562 +1,36 @@
22 <?php
33 /**
4 - * Internationalisation file for extension special page GoogleNewsSitemap
 4+ * Internationalisation file for extension special page GNSM
55 * New version of DynamicPageList extension for use by Wikinews projects
66 *
7 - * @file
8 - * @ingroup Extensions
9 - */
 7+ * @addtogroup Extensions
 8+ **/
109
11 -$messages = array();
 10+$messages= array();
1211
1312 /** English
1413 * @author Amgine
15 - */
 14+ **/
1615
1716 $messages['en'] = array(
18 - 'gnsm' => 'Google News Sitemap',
19 - 'gnsm-desc' => 'Outputs an Atom/RSS feed as a Google News Sitemap',
20 - 'gnsm_categorymap' => '', # Default empty. List of categories to map to keywords. Do not translate.
21 - 'gnsm_toomanycats' => 'Error: Too many categories!',
22 - 'gnsm_toofewcats' => 'Error: Too few categories!',
23 - 'gnsm_noresults' => 'Error: No results!',
24 - 'gnsm_noincludecats' => 'Error: You need to include at least one category, or specify a namespace!',
 17+ 'gnsm' => 'Google News SiteMap',
 18+ 'gnsm-desc' => 'Outputs an Atom/RSS feed as a Google News Sitemap.',
 19+ 'gnsm_categorymap' => '', #default empty. list of categories to map to keywords. do not translate.
 20+ 'gnsm_toomanycats' => 'Error: Too many categories!',
 21+ 'gnsm_toofewcats' => 'Error: Too few categories!',
 22+ 'gnsm_noresults' => 'Error: No results!',
 23+ 'gnsm_noincludecats' => 'Error: You need to include at least one category, or specify a namespace!',
2524 );
2625
27 -/** Message documentation (Message documentation)
28 - * @author Umherirrender
29 - */
30 -$messages['qqq'] = array(
31 - 'gnsm-desc' => '{{desc}}',
32 -);
33 -
34 -/** Afrikaans (Afrikaans)
35 - * @author Naudefj
36 - */
37 -$messages['af'] = array(
38 - 'gnsm' => 'Google Nuus Sitemap',
39 - 'gnsm-desc' => 'Eksporteer \'n Atom/RSS-voer as \'n Google "News Sitemap"',
40 - 'gnsm_toomanycats' => 'Fout: Te veel kategorieë!',
41 - 'gnsm_toofewcats' => 'Fout: Te min kategorieë!',
42 - 'gnsm_noresults' => 'Fout: Geen resultate!',
43 - 'gnsm_noincludecats' => "Fout: U moet ten minste een kategorie insluit, of spesifiseer 'n naamspasie!",
44 -);
45 -
46 -/** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
47 - * @author EugeneZelenko
48 - * @author Jim-by
49 - */
50 -$messages['be-tarask'] = array(
51 - 'gnsm' => 'Мапа сайту Google News',
52 - 'gnsm-desc' => 'Выводзіць стужкі Atom/RSS у выглядзе мапы сайту Google News',
53 - 'gnsm_toomanycats' => 'Памылка: зашмат катэгорыяў!',
54 - 'gnsm_toofewcats' => 'Памылка: занадта мала катэгорыяў!',
55 - 'gnsm_noresults' => 'Памылка: няма вынікаў!',
56 - 'gnsm_noincludecats' => 'Памылка: Вам неабходна дадаць хаця б адну катэгорыю, альбо пазначыць прастору назваў!',
57 -);
58 -
59 -/** Bulgarian (Български)
60 - * @author DCLXVI
61 - */
62 -$messages['bg'] = array(
63 - 'gnsm_noresults' => 'Грешка: Няма резултати!',
64 -);
65 -
66 -/** Breton (Brezhoneg)
67 - * @author Fulup
68 - * @author Y-M D
69 - */
70 -$messages['br'] = array(
71 - 'gnsm' => "Steuñvenn lec'hienn Keleier Google",
72 - 'gnsm-desc' => "Krouiñ a ra ul lanvad Atom/RSS evel steuñvenn ul lec'hienn Keleier Google",
73 - 'gnsm_toomanycats' => 'Fazi : Re a rummadoù !',
74 - 'gnsm_toofewcats' => 'Fazi : Re nebeut a rummadoù !',
75 - 'gnsm_noresults' => "Fazi : Disoc'h ebet !",
76 - 'gnsm_noincludecats' => "Fazi : Ret eo deoc'h merkañ ur rummad da nebeutañ, pe spisaat un esaouenn anv!",
77 -);
78 -
79 -/** Bosnian (Bosanski)
80 - * @author CERminator
81 - */
82 -$messages['bs'] = array(
83 - 'gnsm' => 'Google News mapa stranice',
84 - 'gnsm-desc' => 'Daje izlaz atom/RSS fida kao Google News mapa stranice',
85 - 'gnsm_toomanycats' => 'Greška: Previše kategorija!',
86 - 'gnsm_toofewcats' => 'Greška: Premalo kategorija!',
87 - 'gnsm_noresults' => 'Greška: Nema rezultata!',
88 - 'gnsm_noincludecats' => 'Greška: Morate uključiti najmanje jednu kategoriju ili navesti imenski prostor!',
89 -);
90 -
91 -/** Catalan (Català)
92 - * @author Davidpar
93 - * @author Paucabot
94 - */
95 -$messages['ca'] = array(
96 - 'gnsm' => 'Mapa del lloc Google News',
97 - 'gnsm-desc' => 'Fes sortir un Atom/RSS feed com a Google News Sitemap',
98 - 'gnsm_toomanycats' => 'Error: Massa categories!',
99 - 'gnsm_toofewcats' => 'Error: Massa poques categories!',
100 - 'gnsm_noresults' => 'Error: Cap resultat!',
101 - 'gnsm_noincludecats' => "Error: Heu d'incloure almenys una categoria o especificar un espai de noms!",
102 -);
103 -
104 -/** German (Deutsch)
105 - * @author Kghbln
106 - */
107 -$messages['de'] = array(
108 - 'gnsm' => 'Sitemap für Google News',
109 - 'gnsm-desc' => 'Gibt Atom/RSS-Feeds in Form einer Sitemap für Google News aus.',
110 - 'gnsm_toomanycats' => 'Fehler: Zu viele Kategorien!',
111 - 'gnsm_toofewcats' => 'Fehler: Zu wenig Kategorien!',
112 - 'gnsm_noresults' => 'Fehler: Keine Ergebnisse vorhanden!',
113 - 'gnsm_noincludecats' => 'Fehler: Du musst mindestens eine Kategorie oder einen Namensraum angeben!',
114 -);
115 -
116 -/** German (formal address) (Deutsch (Sie-Form))
117 - * @author Kghbln
118 - */
119 -$messages['de-formal'] = array(
120 - 'gnsm_noincludecats' => 'Fehler: Sie müssen mindestens eine Kategorie oder einen Namensraum angeben!',
121 -);
122 -
123 -/** Lower Sorbian (Dolnoserbski)
124 - * @author Michawiki
125 - */
126 -$messages['dsb'] = array(
127 - 'gnsm' => 'Sedłowy pśeglěd Google Nowosći',
128 - 'gnsm-desc' => 'Wudawa kanal Atom/RSS ako sedłowy pśeglěd Google Nowosći',
129 - 'gnsm_toomanycats' => 'Zmólka: Pśewjele kategorijow!',
130 - 'gnsm_toofewcats' => 'Zmólka: Pśemało kategorijow!',
131 - 'gnsm_noresults' => 'Zmólka: Žedne wuslědki!',
132 - 'gnsm_noincludecats' => 'Zmólka: Musyš nanejmjenjej jadnu kategoriju zapśěgnuś abo mjenjowy rum pódaś!',
133 -);
134 -
135 -/** Greek (Ελληνικά)
136 - * @author Περίεργος
137 - */
138 -$messages['el'] = array(
139 - 'gnsm' => 'Χάρτης Ειδήσεων της Google',
140 - 'gnsm-desc' => 'Βγάζει το Χάρτη Ειδήσεων της Google ως Atom/RSS',
141 - 'gnsm_toomanycats' => 'Σφάλμα: Υπερβολικά πολλές κατηγορίες!',
142 - 'gnsm_toofewcats' => 'Σφάλμα: Υπερβολικά λίγες κατηγορίες!',
143 - 'gnsm_noresults' => 'Σφάλμα: Δεν υπάρχουν αποτελέσματα!',
144 - 'gnsm_noincludecats' => 'Σφάλμα: Χρειάζεται να συμπεριλάβετε τουλάχιστον μια κατηγορία, ή να προσδιορίσετε μια περιοχή ονομάτων!',
145 -);
146 -
147 -/** Esperanto (Esperanto)
148 - * @author Yekrats
149 - */
150 -$messages['eo'] = array(
151 - 'gnsm' => 'Retmapo de Google-Aktualaĵoj',
152 - 'gnsm-desc' => 'Generas Atom aŭ RSS retfluon kiel Retmapo de Google-Aktualaĵoj',
153 - 'gnsm_toomanycats' => 'Eraro: Tro da kategorioj!',
154 - 'gnsm_toofewcats' => 'Eraro: Tro malmultaj da kategorioj!',
155 - 'gnsm_noresults' => 'Eraro: Neniuj rezultoj!',
156 - 'gnsm_noincludecats' => 'Eraro: Vi devas inkluzivi almenaŭ unu kategorio, aŭ specifigu nomspacon!',
157 -);
158 -
159 -/** Spanish (Español)
160 - * @author Translationista
161 - */
162 -$messages['es'] = array(
163 - 'gnsm' => 'Mapa del sitio Google Noticias',
164 - 'gnsm-desc' => 'Genera una fuenteAtom/RSS como un mapa de sitio de Google Noticias',
165 - 'gnsm_toomanycats' => 'Error: ¡Demasiadas categorías!',
166 - 'gnsm_toofewcats' => 'Error: ¡Muy pocas categorías!',
167 - 'gnsm_noresults' => 'Error: ¡No hay resultados!',
168 - 'gnsm_noincludecats' => 'Error: ¡Es necesario incluir al menos una categoría o especificar un espacio de nombres!',
169 -);
170 -
171 -/** Basque (Euskara)
172 - * @author An13sa
173 - */
174 -$messages['eu'] = array(
175 - 'gnsm' => 'Google News Gunearen mapa',
176 - 'gnsm-desc' => 'Atom/RSS iturria zehazten du Google News Gunearen maparentzat',
177 - 'gnsm_toomanycats' => 'Errorea: Kategoria gehiegi!',
178 - 'gnsm_toofewcats' => 'Errorea: Kategoria gutxiegi!',
179 - 'gnsm_noresults' => 'Errorea: Emaitzarik ez!',
180 - 'gnsm_noincludecats' => 'Errorea: Gutxienez kategoria bat gehitu edo izen bat zehaztu behar duzu!',
181 -);
182 -
183 -/** Finnish (Suomi)
184 - * @author Centerlink
185 - * @author Crt
186 - */
187 -$messages['fi'] = array(
188 - 'gnsm' => 'Google News -sivukartta',
189 - 'gnsm-desc' => 'Tulostaa Atom/RSS-syötteen Google-uutissivukarttana',
190 - 'gnsm_toomanycats' => 'Virhe: Liian monta luokkaa.',
191 - 'gnsm_toofewcats' => 'Virhe: Liian vähän luokkia.',
192 - 'gnsm_noresults' => 'Virhe: Ei tuloksia.',
193 - 'gnsm_noincludecats' => 'Error: Lisää vähintään yksi luokka tai määritä nimiavaruus.',
194 -);
195 -
196 -/** French (Français)
 26+/** Français
19727 * @author Amgine
198 - * @author McDutchie
199 - */
 28+ **/
 29+
20030 $messages['fr'] = array(
201 - 'gnsm' => 'Google nouvelles Sitemap',
202 - 'gnsm-desc' => 'Cre un Atom ou RSS feed comme un plan Sitemap pour Google',
203 - 'gnsm_toomanycats' => 'Erreur: Trop de nombreuses catégories!',
204 - 'gnsm_toofewcats' => 'Erreur: Trop peu de catégories!',
205 - 'gnsm_noresults' => 'Erreur: Pas de résultats!',
206 - 'gnsm_noincludecats' => 'Erreur: Vous devez inclure au moins une catégorie, ou spécifier un espace de noms !',
 31+ 'gnsm' => 'Google nouvelles SiteMap',
 32+ 'gnsm-desc' => 'Cre un Atom ou RSS feed comme un plan Sitemap pour Google.',
 33+ 'gnsm_toomanycats' => 'Erreur: Trop de nombreuses catégories!',
 34+ 'gnsm_toofewcats' => 'Erreur: Trop peu de catégories!',
 35+ 'gnsm_noresults' => 'Erreur: Pas de résultats!',
 36+ 'gnsm_noincludecats' => 'Erreur: Vous devez inclure au moins une catégorie, ou spécifier un nom d\'espace !'
20737 );
208 -
209 -/** Galician (Galego)
210 - * @author Toliño
211 - */
212 -$messages['gl'] = array(
213 - 'gnsm' => 'Mapa do sitio das novas do Google',
214 - 'gnsm-desc' => 'Dá como resultado unha fonte de novas Atom/RSS como un mapa do sitio das novas do Google',
215 - 'gnsm_toomanycats' => 'Erro: hai moitas categorías!',
216 - 'gnsm_toofewcats' => 'Erro: moi poucas categorías!',
217 - 'gnsm_noresults' => 'Erro: non hai resultados!',
218 - 'gnsm_noincludecats' => 'Erro: debe incluír, polo menos, unha categoría ou especificar un espazo de nomes!',
219 -);
220 -
221 -/** Swiss German (Alemannisch)
222 - * @author Als-Holder
223 - */
224 -$messages['gsw'] = array(
225 - 'gnsm' => 'Google Nejigkeite Sytenibersicht',
226 - 'gnsm-desc' => 'Liferet e Atom/RSS-feed as Google Nejigkeite Sytenibersicht',
227 - 'gnsm_toomanycats' => 'Fähler: z vil Kategorie!',
228 - 'gnsm_toofewcats' => 'Fähler: z wenig Kategorie!',
229 - 'gnsm_noresults' => 'Fähler: kei Ergebnis!',
230 - 'gnsm_noincludecats' => 'Fähler: muesch zmindescht ei Kategorii aagee oder e Namensruum feschtlege!',
231 -);
232 -
233 -/** Hebrew (עברית)
234 - * @author YaronSh
235 - */
236 -$messages['he'] = array(
237 - 'gnsm' => 'מפת אתר לפי Google News',
238 - 'gnsm-desc' => 'יצוא הזנת Atom/RSS בתור מפת אתר ל־Google News',
239 - 'gnsm_toomanycats' => 'שגיאה: יותר מדי קטגוריות!',
240 - 'gnsm_toofewcats' => 'שגיאה: מעט מדי קטגוריות!',
241 - 'gnsm_noresults' => 'שגיאה: אין תוצאות!',
242 - 'gnsm_noincludecats' => 'שגיאה: עליך לכלול לפחות קטגוריה אחת או לציין מרחב שם!',
243 -);
244 -
245 -/** Upper Sorbian (Hornjoserbsce)
246 - * @author Michawiki
247 - */
248 -$messages['hsb'] = array(
249 - 'gnsm' => 'Sydłowa přehlad Google Nowinki',
250 - 'gnsm-desc' => 'Wudawa kanal Atom/RSS jako sydłowy přehlad Google Nowinki',
251 - 'gnsm_toomanycats' => 'Zmylk: Přewjele kategorijow!',
252 - 'gnsm_toofewcats' => 'Zmylk: Přemało kategorijow!',
253 - 'gnsm_noresults' => 'Zmylk: Žane wuslědki!',
254 - 'gnsm_noincludecats' => 'Zmylk: Dyrbiš znajmjeńša jednu kategoriju zapřijeć abo mjenowy rum podać!',
255 -);
256 -
257 -/** Hungarian (Magyar)
258 - * @author Glanthor Reviol
259 - */
260 -$messages['hu'] = array(
261 - 'gnsm' => 'Google hírek oldaltérkép',
262 - 'gnsm-desc' => 'Atom/RSS hírcsatornát készít Google hírek oldaltérképként',
263 - 'gnsm_toomanycats' => 'Hiba: túl sok kategória!',
264 - 'gnsm_toofewcats' => 'Hiba: túl kevés kategória!',
265 - 'gnsm_noresults' => 'Hiba: nincs találat!',
266 - 'gnsm_noincludecats' => 'Hiba: legalább egy kategóriát vagy névteret meg kell adnod!',
267 -);
268 -
269 -/** Interlingua (Interlingua)
270 - * @author McDutchie
271 - */
272 -$messages['ia'] = array(
273 - 'gnsm' => 'Sitemap de Google News',
274 - 'gnsm-desc' => 'Converte un syndication Atom/RSS in un Sitemap de Google News',
275 - 'gnsm_toomanycats' => 'Error: Troppo de categorias!',
276 - 'gnsm_toofewcats' => 'Error: Non satis de categorias!',
277 - 'gnsm_noresults' => 'Error: Nulle resultato!',
278 - 'gnsm_noincludecats' => 'Error: Tu debe includer al minus un categoria, o specificar un spatio de nomines!',
279 -);
280 -
281 -/** Indonesian (Bahasa Indonesia)
282 - * @author Iwan Novirion
283 - * @author Kenrick95
284 - */
285 -$messages['id'] = array(
286 - 'gnsm' => 'Petasitus Baru Google',
287 - 'gnsm-desc' => 'Hasil dari Atom/RSS feed sebagai Petasitus Baru Google',
288 - 'gnsm_toomanycats' => 'Kesalahan: Terlalu banyak kategori!',
289 - 'gnsm_toofewcats' => 'Kesalahan: Terlalu sedikit kategori!',
290 - 'gnsm_noresults' => 'Kesalahan: Tidak ada hasil!',
291 - 'gnsm_noincludecats' => 'Kesalahan: Anda perlu mencantumkan paling sedikit satu kategori, atau menyebutkan satu ruang nama!',
292 -);
293 -
294 -/** Italian (Italiano)
295 - * @author Beta16
296 - */
297 -$messages['it'] = array(
298 - 'gnsm_toomanycats' => 'Errore: Numero di categorie eccessivo!',
299 - 'gnsm_toofewcats' => 'Errore: Troppe poche categorie!',
300 - 'gnsm_noresults' => 'Errore: Nessun risultato.',
301 - 'gnsm_noincludecats' => 'Errore: È necessario includere almeno una categoria oppure specificare un namespace!',
302 -);
303 -
304 -/** Japanese (日本語)
305 - * @author Hosiryuhosi
306 - * @author Naohiro19
307 - */
308 -$messages['ja'] = array(
309 - 'gnsm' => 'Google ニュース サイトマップ',
310 - 'gnsm-desc' => 'Google ニュースのサイトマップからAtom/RSSフィードを出力',
311 - 'gnsm_toomanycats' => 'エラー: カテゴリが多すぎです!',
312 - 'gnsm_toofewcats' => 'エラー:カテゴリが少なすぎです!',
313 - 'gnsm_noresults' => 'エラー:結果はありません!',
314 - 'gnsm_noincludecats' => 'エラー:少なくとも1つのカテゴリまたは名前空間を指定する必要があります!',
315 -);
316 -
317 -/** Luxembourgish (Lëtzebuergesch)
318 - * @author Robby
319 - */
320 -$messages['lb'] = array(
321 - 'gnsm' => 'Google News Plang vum Site',
322 - 'gnsm-desc' => 'Produzéiert en Atom/RSS feed als Google News Sitemap',
323 - 'gnsm_toomanycats' => 'Feeler: Zevill Kategorien!',
324 - 'gnsm_toofewcats' => 'Feeler: Ze wéineg Kategorien!',
325 - 'gnsm_noresults' => 'Feeler: Keng Resultater!',
326 - 'gnsm_noincludecats' => 'Feeler: Dir musst mindestens eng Kategorie oder een Nummraum drasetzen!',
327 -);
328 -
329 -/** Macedonian (Македонски)
330 - * @author Bjankuloski06
331 - */
332 -$messages['mk'] = array(
333 - 'gnsm' => 'План на страницата Google Вести',
334 - 'gnsm-desc' => 'Дава Atom/RSS канал како план на страницата Google Вести',
335 - 'gnsm_toomanycats' => 'Грешка: Премногу категории!',
336 - 'gnsm_toofewcats' => 'Грешка: Премалку категории!',
337 - 'gnsm_noresults' => 'Грешка: Нема резултати!',
338 - 'gnsm_noincludecats' => 'Грешка: Треба да вклучите барем една категорија, или да назначите именски простор!',
339 -);
340 -
341 -/** Dutch (Nederlands)
342 - * @author Siebrand
343 - */
344 -$messages['nl'] = array(
345 - 'gnsm' => 'Google Nieuws Sitemap',
346 - 'gnsm-desc' => 'Levert een Atom/RSS-feed als Google Nieuws Sitemap',
347 - 'gnsm_toomanycats' => 'Fout: te veel categorieën!',
348 - 'gnsm_toofewcats' => 'Fout: te weinig categorieën!',
349 - 'gnsm_noresults' => 'Fout: geen resultaten!',
350 - 'gnsm_noincludecats' => 'Fout: u moet tenminste een categorie of naamruimte opgeven!',
351 -);
352 -
353 -/** Norwegian Nynorsk (‪Norsk (nynorsk)‬)
354 - * @author Harald Khan
355 - */
356 -$messages['nn'] = array(
357 - 'gnsm_toomanycats' => 'Feil: For mange kategoriar.',
358 - 'gnsm_toofewcats' => 'Feil: For få kategoriar.',
359 - 'gnsm_noresults' => 'Feil: Ingen resultat',
360 - 'gnsm_noincludecats' => 'Feil: Du lyt inkludera minst éin kategori eller oppgje eit namnerom.',
361 -);
362 -
363 -/** Norwegian (bokmål)‬ (‪Norsk (bokmål)‬)
364 - * @author Nghtwlkr
365 - */
366 -$messages['no'] = array(
367 - 'gnsm' => 'Nettstedskart for Google News',
368 - 'gnsm-desc' => 'Gir ut en Atom/RSS-mating som et nettstedskart for Google News',
369 - 'gnsm_toomanycats' => 'Feil: For mange kategorier!',
370 - 'gnsm_toofewcats' => 'Feil: For få kategorier!',
371 - 'gnsm_noresults' => 'Feil: Ingen resultat!',
372 - 'gnsm_noincludecats' => 'Feil: Du må inkludere minst én kategori eller oppgi et navnerom!',
373 -);
374 -
375 -/** Occitan (Occitan)
376 - * @author Cedric31
377 - */
378 -$messages['oc'] = array(
379 - 'gnsm' => 'Google nòvas Sitemap',
380 - 'gnsm-desc' => 'Crèa un Atom o RSS feed coma un plan Sitemap per Google',
381 - 'gnsm_toomanycats' => 'Error : Tròp de categorias !',
382 - 'gnsm_toofewcats' => 'Error : Pas pro de categorias !',
383 - 'gnsm_noresults' => 'Error : Pas cap de resultat !',
384 - 'gnsm_noincludecats' => 'Error : Vos cal inclure almens una categoria, o especificar un espaci de noms !',
385 -);
386 -
387 -/** Polish (Polski)
388 - * @author Sp5uhe
389 - */
390 -$messages['pl'] = array(
391 - 'gnsm' => 'Mapa serwisu dla Google News',
392 - 'gnsm-desc' => 'Treść kanałów Atom i RSS w formie mapy witryny dla Google News',
393 - 'gnsm_toomanycats' => 'Błąd – zbyt wiele kategorii!',
394 - 'gnsm_toofewcats' => 'Błąd – zbyt mało kategorii!',
395 - 'gnsm_noresults' => 'Błąd – brak wyników!',
396 - 'gnsm_noincludecats' => 'Błąd – musisz wybrać co najmniej jedną kategorię lub określić przestrzeń nazw!',
397 -);
398 -
399 -/** Piedmontese (Piemontèis)
400 - * @author Borichèt
401 - * @author Dragonòt
402 - */
403 -$messages['pms'] = array(
404 - 'gnsm' => 'Pian dël sit dle Neuve ëd Google',
405 - 'gnsm-desc' => 'A scriv un fluss Atom/RSS com pian dël Sit ëd le Neuve ëd Google',
406 - 'gnsm_toomanycats' => 'Eror: Tròpe categorìe!',
407 - 'gnsm_toofewcats' => 'Eror: Tròp pòche categorìe!',
408 - 'gnsm_noresults' => 'Eror: pa gnun arzultà!',
409 - 'gnsm_noincludecats' => 'Eror: A deuv anserì almanch na categorìa, o spessifiché në spassi nominal!',
410 -);
411 -
412 -/** Portuguese (Português)
413 - * @author Hamilton Abreu
414 - */
415 -$messages['pt'] = array(
416 - 'gnsm' => 'Google News Sitemap',
417 - 'gnsm-desc' => 'Converte um feed Atom/RSS para um Google News Sitemap',
418 - 'gnsm_toomanycats' => 'Erro: Categorias a mais!',
419 - 'gnsm_toofewcats' => 'Erro: Categorias a menos!',
420 - 'gnsm_noresults' => 'Erro: Não há resultados!',
421 - 'gnsm_noincludecats' => 'Erro: Tem de incluir pelo menos uma categoria, ou especificar um espaço nominal!',
422 -);
423 -
424 -/** Brazilian Portuguese (Português do Brasil)
425 - * @author Daemorris
426 - */
427 -$messages['pt-br'] = array(
428 - 'gnsm' => 'Mapa de Site de Notícias Google',
429 - 'gnsm-desc' => 'Produz um alimentador Atom/RSS como um Mapa de Site de Notícias Google',
430 - 'gnsm_toomanycats' => 'Erro: Categorias demais!',
431 - 'gnsm_toofewcats' => 'Erro: Categorias de menos!',
432 - 'gnsm_noresults' => 'Erro: Sem resultados!',
433 - 'gnsm_noincludecats' => 'Erro: Você precisa incluir pelo menos uma categoria, ou especificar um espaço nominal!',
434 -);
435 -
436 -/** Romanian (Română)
437 - * @author Stelistcristi
438 - */
439 -$messages['ro'] = array(
440 - 'gnsm_toomanycats' => 'Eroare: Prea multe categorii!',
441 - 'gnsm_toofewcats' => 'Eroare: pre',
442 - 'gnsm_noresults' => 'Eroare: Niciun rezultat!',
443 -);
444 -
445 -/** Russian (Русский)
446 - * @author Александр Сигачёв
447 - */
448 -$messages['ru'] = array(
449 - 'gnsm' => 'Карта сайта для Google News',
450 - 'gnsm-desc' => 'Подготавливает канал Atom/RSS в виде карты сайта для Google News',
451 - 'gnsm_toomanycats' => 'Ошибка. Слишком много категорий!',
452 - 'gnsm_toofewcats' => 'Ошибка. Слишком мало категорий!',
453 - 'gnsm_noresults' => 'Ошибка. Нет данных!',
454 - 'gnsm_noincludecats' => 'Ошибка. Вы должны включить по меньшей мере одну категорию, или указать пространство имён!',
455 -);
456 -
457 -/** Serbian Cyrillic ekavian (Српски (ћирилица))
458 - * @author Михајло Анђелковић
459 - */
460 -$messages['sr-ec'] = array(
461 - 'gnsm_toomanycats' => 'Грешка: Превише категорија!',
462 - 'gnsm_toofewcats' => 'Грешка: Премало категорија!',
463 - 'gnsm_noresults' => 'Грешка: Нема резултата!',
464 -);
465 -
466 -/** Serbian Latin ekavian (Srpski (latinica)) */
467 -$messages['sr-el'] = array(
468 - 'gnsm_toomanycats' => 'Greška: Previše kategorija!',
469 - 'gnsm_toofewcats' => 'Greška: Premalo kategorija!',
470 - 'gnsm_noresults' => 'Greška: Nema rezultata!',
471 -);
472 -
473 -/** Swedish (Svenska)
474 - * @author Fredrik
475 - * @author Per
476 - */
477 -$messages['sv'] = array(
478 - 'gnsm' => 'Webbkarta för Google nyheter',
479 - 'gnsm-desc' => 'Visar ett Atom-/RSS-flöde som en webbkarta för Google nyheter',
480 - 'gnsm_toomanycats' => 'Fel: För många kategorier!',
481 - 'gnsm_toofewcats' => 'Fel: För få kategorier!',
482 - 'gnsm_noresults' => 'Fel: Inget resultat!',
483 - 'gnsm_noincludecats' => 'Fel: Du måste inkludera minst en kategori eller specificera en namnrymd!',
484 -);
485 -
486 -/** Telugu (తెలుగు)
487 - * @author Veeven
488 - */
489 -$messages['te'] = array(
490 - 'gnsm' => 'గూగుల్ వార్తల సైటుపటం',
491 - 'gnsm_toomanycats' => 'పొరపాటు: చాలా ఎక్కువ వర్గాలు!',
492 - 'gnsm_toofewcats' => 'పొరపాటు: చాలా తక్కువ వర్గాలు!',
493 - 'gnsm_noresults' => 'పొరపాటు: ఫలితాలు లేవు!',
494 -);
495 -
496 -/** Thai (ไทย)
497 - * @author Woraponboonkerd
498 - */
499 -$messages['th'] = array(
500 - 'gnsm_toomanycats' => 'เกิดความผิดพลาด: เลือกประเภทมากเกินไป!',
501 - 'gnsm_toofewcats' => 'เกิดความผิดพลาด: เลือกประเภทน้อยเกินไป!',
502 - 'gnsm_noresults' => 'เกิดความผิดพลาด: ไม่พบข้อมูล!',
503 - 'gnsm_noincludecats' => 'เกิดความผิดพลาด: คุณต้องเลือกอย่างน้อยหนึ่งประเภท หรือกำหนด Namespace!',
504 -);
505 -
506 -/** Tagalog (Tagalog)
507 - * @author AnakngAraw
508 - */
509 -$messages['tl'] = array(
510 - 'gnsm' => 'Mapang Pangsityo ng Balitang Google',
511 - 'gnsm-desc' => 'Naglalabas ng pakaing Atom/RSS bilang Mapa sa Sityo ng Balitang Google',
512 - 'gnsm_toomanycats' => 'Mali: Napakaraming mga kategorya!',
513 - 'gnsm_toofewcats' => 'Mali: Napakakaunting mga kategorya!',
514 - 'gnsm_noresults' => 'Mali: Walang mga resulta!',
515 - 'gnsm_noincludecats' => 'Mali: Kailangan mong magsama ng kahit na isang kategorya, o tumukoy ng isang puwang na pampangalan!',
516 -);
517 -
518 -/** Turkish (Türkçe)
519 - * @author Joseph
520 - */
521 -$messages['tr'] = array(
522 - 'gnsm' => 'Google Haberler Site haritası',
523 - 'gnsm-desc' => 'Bir Atom/RSS beslemesini Google Haberler Site haritası olarak çıktılar',
524 - 'gnsm_toomanycats' => 'Hata: Çok fazla kategori!',
525 - 'gnsm_toofewcats' => 'Hata: Çok az kategori!',
526 - 'gnsm_noresults' => 'Hata: Sonuç yok!',
527 - 'gnsm_noincludecats' => 'Hata: En az bir kategori girmeli, ya da bir ad alanı belirtmelisiniz!',
528 -);
529 -
530 -/** Ukrainian (Українська)
531 - * @author Arturyatsko
532 - */
533 -$messages['uk'] = array(
534 - 'gnsm' => 'Карта сайту для Google News',
535 - 'gnsm-desc' => 'Виводить канал Atom/RSS у вигляді карти сайту для Google News',
536 - 'gnsm_toomanycats' => 'Помилка: Надто багато категорій!',
537 - 'gnsm_toofewcats' => 'Помилка: Надто мало категорії!',
538 - 'gnsm_noresults' => 'Помилка: не знайдено!',
539 - 'gnsm_noincludecats' => 'Помилка: Ви повинні включити хоча б одну категорію, або вказати простір імен!',
540 -);
541 -
542 -/** Simplified Chinese (‪中文(简体)‬)
543 - * @author Gaoxuewei
544 - */
545 -$messages['zh-hans'] = array(
546 - 'gnsm' => 'Google 资讯站点地图',
547 - 'gnsm-desc' => '输出一个Google 资讯站点地图的Atom/RSS文件',
548 - 'gnsm_toomanycats' => '错误:分类过多!',
549 - 'gnsm_toofewcats' => '错误:分类过少!',
550 - 'gnsm_noresults' => '错误:没有结果!',
551 - 'gnsm_noincludecats' => '错误:您需要包含至少一个分类,或者指定一个名称空间!',
552 -);
553 -
554 -/** Traditional Chinese (‪中文(繁體)‬) */
555 -$messages['zh-hant'] = array(
556 - 'gnsm' => 'Google 資訊站點地圖',
557 - 'gnsm-desc' => '輸出一個Google 資訊站點地圖的Atom/RSS文件',
558 - 'gnsm_toomanycats' => '錯誤:分類過多!',
559 - 'gnsm_toofewcats' => '錯誤:分類過少!',
560 - 'gnsm_noresults' => '錯誤:沒有結果!',
561 - 'gnsm_noincludecats' => '錯誤:您需要包含至少一個分類,或者指定一個名稱空間!',
562 -);
563 -
Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.php
@@ -1,10 +1,10 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ) {
4 - echo <<<EOT
5 -To install GoogleNewsSitemap extension, an extension special page, put the following line in LocalSettings.php:
6 -require_once( dirname(__FILE__) . '/extensions/GoogleNewsSitemap/GoogleNewsSitemap.php' );
 3+if (!defined('MEDIAWIKI')) {
 4+ 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' );
77 EOT;
8 - exit( 1 );
 8+ exit( 1 );
99 }
1010
1111 /**
@@ -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:GoogleNewsSitemap[/][|category=Catname]
 21+ * This page can be accessed from Special:GNSM[/][|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:GoogleNewsSitemap/[options][...]}}
 25+ * {{Special:GNSM/[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,26 +45,25 @@
4646 * n:en:User:IlyaHaykinson http://en.wikinews.org/wiki/User:IlyaHaykinson
4747 **
4848 * FIXME requests
49 - * use=Mediawiki:GoogleNewsSitemap_Feedname Parameter to allow on-site control of feed
 49+ * use=Mediawiki:GNSM_Feedname Parameter to allow on-site control of feed
5050 **
51 - * @file
52 - * @intogroup Extensions
 51+ * @addtogroup Extensions
 52+ *
5353 * @author Amgine <amgine.saewyc@gmail.com>
5454 * @copyright Copyright © 2009, Amgine
5555 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
5656 */
5757 $wgExtensionCredits['specialpage'][] = array(
5858 'path' => __FILE__,
59 - 'name' => 'GoogleNewsSitemap',
 59+ 'name' => 'GNSM',
6060 'author' => 'Amgine',
 61+ 'description' => 'Outputs xml based on defined criteria',
6162 'descriptionmsg' => 'gnsm-desc',
62 - 'url' => 'http://www.mediawiki.org/wiki/Extension:GoogleNewsSitemap',
 63+ 'url' => 'http://www.mediawiki.org/wiki/Extension:GNSM',
6364 );
6465
65 -$dir = dirname( __FILE__ ) . '/';
66 -$wgExtensionMessagesFiles['GoogleNewsSitemap'] = $dir . 'GoogleNewsSitemap.i18n.php';
67 -$wgExtensionAliasesFiles['GoogleNewsSitemap'] = $dir . 'GoogleNewsSitemap.alias.php';
68 -$wgAutoloadClasses['GoogleNewsSitemap'] = $dir . 'GoogleNewsSitemap_body.php';
69 -$wgAutoloadClasses['FeedSitemapItem'] = $dir . 'FeedSitemapItem.php';
70 -$wgAutoloadClasses['SitemapFeed'] = $dir . 'FeedSitemapItem.php';
71 -$wgSpecialPages['GoogleNewsSitemap'] = 'GoogleNewsSitemap';
 66+$dir = dirname(__FILE__) . '/';
 67+$wgExtensionMessagesFiles['GNSM'] = $dir . 'GoogleNewsSitemap.i18n.php';
 68+$wgExtensionAliasesFiles['GNSM'] = $dir . 'GoogleNewsSitemap.alias.php';
 69+$wgAutoloadClasses['GNSM'] = $dir . 'GoogleNewsSitemap_body.php';
 70+$wgSpecialPages['GNSM'] = 'GNSM';
Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.alias.php
@@ -1,76 +1,42 @@
22 <?php
33 /**
4 - * Aliases for Special:GoogleNewsSitemap
 4+ * Aliases for Special:Editcount
55 *
6 - * @file
7 - * @ingroup Extensions
 6+ * @addtogroup Extensions
87 */
98
10 -$specialPageAliases = array();
 9+/**
 10+ * Deutsch
 11+ * @author Amgine
 12+ **/
 13+$aliases['de'] = array(
 14+ 'GNSM' => array( 'SpezialGNSM' )
 15+);
1116
1217 /** English
1318 * @author Amgine
14 - */
15 -$specialPageAliases['en'] = array(
16 - 'GoogleNewsSitemap' => array( 'GoogleNewsSitemap' ),
 19+ **/
 20+$aliases['en'] = array(
 21+ 'GNSM' => array( 'Google News SiteMap', 'SpecialGNSM' ),
1722 );
1823
19 -/** Arabic (العربية) */
20 -$specialPageAliases['ar'] = array(
21 - 'GoogleNewsSitemap' => array( 'خريطة_موقع_أخبار_جوجل' ),
 24+/** Français
 25+ * @author Amgine
 26+ **/
 27+$aliases['fr'] = array(
 28+ 'GNSM' => array( 'GNSMSpécial' ),
2229 );
2330
24 -/** Egyptian Spoken Arabic (مصرى) */
25 -$specialPageAliases['arz'] = array(
26 - 'GoogleNewsSitemap' => array( 'خريطة_سايت_اخبار_جوجل' ),
 31+/** Nederlands
 32+ * @author Amgine
 33+ **/
 34+$aliases['nl'] = array(
 35+ 'GNSM' => array( 'GNSMSpeciaal' )
2736 );
2837
29 -/** Persian (فارسی) */
30 -$specialPageAliases['fa'] = array(
31 - 'GoogleNewsSitemap' => array( 'نقشه_وب‌گاه_گوگل_نیوز' ),
32 -);
33 -
34 -/** Hungarian (Magyar) */
35 -$specialPageAliases['hu'] = array(
36 - 'GoogleNewsSitemap' => array( 'Google_Hírek_oldaltérkép' ),
37 -);
38 -
39 -/** Interlingua (Interlingua) */
40 -$specialPageAliases['ia'] = array(
41 - 'GoogleNewsSitemap' => array( 'Mappa_de_sito_Google_News' ),
42 -);
43 -
44 -/** Indonesian (Bahasa Indonesia) */
45 -$specialPageAliases['id'] = array(
46 - 'GoogleNewsSitemap' => array( 'Peta_situs_Google_News', 'PetaSitusGoogleNews' ),
47 -);
48 -
49 -/** Japanese (日本語) */
50 -$specialPageAliases['ja'] = array(
51 - 'GoogleNewsSitemap' => array( 'Googleニュースサイトマップ' ),
52 -);
53 -
54 -/** Ladino (Ladino) */
55 -$specialPageAliases['lad'] = array(
56 - 'GoogleNewsSitemap' => array( 'Mapa_de_sitio_de_GoogleJhabberes' ),
57 -);
58 -
59 -/** Malayalam (മലയാളം) */
60 -$specialPageAliases['ml'] = array(
61 - 'GoogleNewsSitemap' => array( 'ഗൂഗിൾ‌‌വാർത്തകൾസൈറ്റ്മാപ്പ്' ),
62 -);
63 -
64 -/** Norwegian (bokmål)‬ (‪Norsk (bokmål)‬) */
65 -$specialPageAliases['no'] = array(
66 - 'GoogleNewsSitemap' => array( 'Google_nyheter-sidekart' ),
67 -);
68 -
69 -/** Polish (Polski) */
70 -$specialPageAliases['pl'] = array(
71 - 'GoogleNewsSitemap' => array( 'Mapa_strony_dla_Google_News' ),
72 -);
73 -
74 -/**
75 - * For backwards compatibility with MediaWiki 1.15 and earlier.
76 - */
77 -$aliases =& $specialPageAliases;
\ No newline at end of file
 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
r78109Followup r78108, revert i18n and Alias changes, no point reverting thosereedy02:25, 9 December 2010
r78110Followup r78108, rename GNSM to GoogleNewsSitemap againreedy02:32, 9 December 2010
r85080MFT r78108, r78179, r78344, r78347, r78350, r78365, r78380, r78425, r78539, r...demon19:09, 31 March 2011

Comments

#Comment by Nikerabbit (talk | contribs)   08:18, 9 December 2010

The whole commit with followups should be reverted, and Jasons changes should be applied manually--there didn't seem to be many real changes.

#Comment by P858snake (talk | contribs)   08:23, 9 December 2010

Reedy has already done it with follow ups, This was discussed and agreeded to happen in the relevant Bz discussion.

#Comment by Nikerabbit (talk | contribs)   08:32, 9 December 2010

I beg to disagree: r1=78114&r2=77420 http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php?r1=78114&r2=77420

And where is the link to the relevant bug?

#Comment by Nikerabbit (talk | contribs)   08:35, 9 December 2010

PS: I hate you code review commenting system!

[http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php?[[Special:Code/MediaWiki/1|r1]]=78114&[[Special:Code/MediaWiki/2|r2]]=77420 http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php?[[Special:Code/MediaWiki/1|r1]]=78114&[[Special:Code/MediaWiki/2|r2]]=77420]

Sorry, I'm unable to add the link. Here it is in parts:

http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
?r1=78114&r2=77420
#Comment by Reedy (talk | contribs)   12:59, 9 December 2010

I agree, there seemed to be little substance in the changes

#Comment by Bryan (talk | contribs)   10:07, 9 December 2010

Also note that the commit message is extremely unhelpful. Code reviewers are not only interested in who wrote a certain changeset, but also in what actually changed.

#Comment by Reedy (talk | contribs)   12:57, 9 December 2010

bugzilla:21919

Doesn't follow #c38

Most of the comments/fixme are on Special:Code/MediaWiki/76544

#Comment by Gigs (talk | contribs)   21:53, 9 December 2010

Hi.

The two major changes are changing from raw parameter parsing to wgRequest, and using an XML library to do the XML output. As part of that I untangled a lot of deeply nested control structure and some pretty evil things like raw output using PHP tags. It may not seem to be much substance, but it did address two of the big issues with the original code.

The SQL construction method and complexity is obviously a glaring problem that still remains to be done, but I do plan to tackle that next.

I agree with all the changes that reedy has added subsequent to this revision. This commit wasn't intended to be "ready to go live", it's just an interim version so that people can see where I'm heading and we can benefit from collaboration.

#Comment by Reedy (talk | contribs)   22:10, 9 December 2010

Just thinking, it might be worth you asking for Commit access, so you can commit your own work? :)

#Comment by Kim Bruning (talk | contribs)   01:04, 10 December 2010

Seconded. :-)

#Comment by Gigs (talk | contribs)   22:16, 9 December 2010

Already asked. Waiting to hear back.

Status & tagging log