r65196 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65195‎ | r65196 | r65197 >
Date:22:39, 17 April 2010
Author:siebrand
Status:deferred
Tags:
Comment:
Rename to remove "Special" prefix from filenames. Update Translate accordingly.
Modified paths:
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.alias.php (added) (history)
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.i18n.php (added) (history)
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.php (added) (history)
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php (added) (history)
  • /trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.alias.php (deleted) (history)
  • /trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.i18n.php (deleted) (history)
  • /trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.php (deleted) (history)
  • /trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap_body.php (deleted) (history)
  • /trunk/extensions/Translate/groups/mediawiki-defines.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap_body.php
@@ -1,664 +0,0 @@
2 -<?php
3 -if (!defined('MEDIAWIKI')) die();
4 -
5 -/**
6 - * Class GoogleNewsSitemap creates Atom/RSS feeds for Wikinews
7 - **
8 - * Simple feed using Atom/RSS coupled to DynamicPageList category searching.
9 - *
10 - * To use: http://wiki.url/Special:GoogleNewsSitemap/<feedType>?[paramter=value][...]
11 - *
12 - * Implemented parameters are marked with an @
13 - **
14 - * 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
25 - * usenamespace = bool ; default = false
26 - * usecurid = bool ; default = false
27 - * suppresserrors = bool ; default = false
28 - **/
29 -
30 -class GoogleNewsSitemap extends IncludableSpecialPage {
31 -
32 -
33 - /**
34 - * FIXME: Some of this might need a config eventually
35 - * @var string
36 - **/
37 - var $Title = '';
38 - var $Description = '';
39 - var $Url = '';
40 - var $Date = '';
41 - var $Author = '';
42 - var $pubDate = '';
43 - var $keywords = '';
44 - var $lastMod = '';
45 - var $priority = '';
46 -
47 - /**
48 - * Script default values - correctly spelt, naming standard.
49 - **/
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
55 - var $wgDPLallowUnlimitedCategories = false; // Allow unlimited categories
56 -
57 -
58 - /**
59 - * @var array Parameters array
60 - **/
61 - var $params = array();
62 - var $categories = array();
63 - var $notCategories = array();
64 -
65 - /**
66 - * Constructor
67 - **/
68 - public function __construct() {
69 - parent::__construct( 'GoogleNewsSitemap' );
70 - }
71 -
72 - /**
73 - * main()
74 - **/
75 - public function execute( $par ) {
76 - global $wgUser;
77 - global $wgLang;
78 - global $wgContLang;
79 - global $wgRequest, $wgOut;
80 - global $wgSitename, $wgServer, $wgScriptPath;
81 - wfLoadExtensionMessages( 'GoogleNewsSitemap' );
82 - global $wgFeedClasses, $wgLocaltimezone;
83 -
84 - // Not sure how clean $wgLocaltimezone is
85 - // In fact, it's default setting is null...
86 - if ( null == $wgLocaltimezone )
87 - $wgLocaltimezone = date_default_timezone_get();
88 - date_default_timezone_set( $wgLocaltimezone );
89 - //$url = __FILE__;
90 -
91 - $this->dpl_parm( $par );
92 -
93 -
94 - $wgFeedClasses[] = array( 'sitemap' => 'SitemapFeed' );
95 -
96 - if ( 'sitemap' == $this->params['feed'] ){
97 - $feed = new SitemapFeed(
98 - $wgServer.$wgScriptPath,
99 - date( DATE_ATOM )
100 - );
101 - }else{
102 - // FIXME: These should be configurable at some point
103 - $feed = new $wgFeedClasses[ $this->params['feed'] ](
104 - $wgSitename,
105 - $wgSitename . ' ' . $this->params['feed'] . ' feed',
106 - $wgServer.$wgScriptPath,
107 - date( DATE_ATOM ),
108 - $wgSitename
109 - );
110 - }
111 -
112 - $feed->outHeader();
113 -
114 - // main routine to output items
115 - if ( isset( $this->param['error'] ) ){
116 - echo $this->param['error'];
117 - }else{
118 - $dbr = wfGetDB( DB_SLAVE );
119 - $sql = $this->dpl_buildSQL();
120 - //Debug line
121 - //echo "\n<p>$sql</p>\n";
122 - $res = $dbr->query ( $sql );
123 -
124 - // FIXME: figure out how to fail with no results gracefully
125 - if ( $dbr->numRows( $res ) == 0 ){
126 - $feed->outFooter();
127 - if ( false == $this->params['suppressErrors'] )
128 - return htmlspecialchars( wfMsg( 'gnsm_noresults' ) );
129 - else
130 - return '';
131 - }
132 -
133 - while ($row = $dbr->fetchObject( $res ) ) {
134 - $title = Title::makeTitle( $row->page_namespace, $row->page_title);
135 -
136 - if ( $title ){
137 - //This is printing things in places it shouldn't
138 - // print $this->params['nameSpace'];
139 -
140 - $titleText = ( true == $this->params['nameSpace'] ) ? $title->getPrefixedText() : $title->getText();
141 -
142 - if ( 'sitemap' == $this->params['feed'] ){
143 -
144 - $this->pubDate = isset( $row->cl_timestamp ) ? $row->cl_timestamp : date( DATE_ATOM );
145 - $feedArticle = new Article( $title );
146 -
147 - $feedItem = new FeedSitemapItem(
148 - trim( $title->getFullURL() ),
149 - wfTimeStamp( TS_ISO_8601, $this->pubDate ),
150 - $this->getKeywords( $title ),
151 - wfTimeStamp( TS_ISO_8601, $feedArticle->getTouched() ),
152 - $feed->getPriority( $this->priority )
153 - );
154 -
155 - }elseif ( ('atom' == $this->params['feed'] ) || ( 'rss' == $this->params['feed'] ) ){
156 -
157 - $this->Date = isset( $row->cl_timestamp ) ? $row->cl_timestamp : date( DATE_ATOM );
158 - if ( isset( $row->comment ) ){
159 - $comments = htmlspecialchars( $row->comment );
160 - }else{
161 - $talkpage = $title->getTalkPage();
162 - $comments = $talkpage->getFullURL();
163 - }
164 - $titleText = (true === $this->params['nameSpace'] ) ? $title->getPrefixedText() : $title->getText();
165 - $feedItem = new FeedItem(
166 - $titleText,
167 - $this->feedItemDesc( $row ),
168 - $title->getFullURL(),
169 - $this->Date,
170 - $this->feedItemAuthor( $row ),
171 - $comments);
172 - }
173 - $feed->outItem( $feedItem );
174 - }
175 - }
176 - }
177 - $feed->outFooter();
178 - }
179 -
180 - /**
181 - * Build sql
182 - **/
183 - public function dpl_buildSQL(){
184 -
185 - $sqlSelectFrom = 'SELECT page_namespace, page_title, page_id, c1.cl_timestamp FROM ' . $this->params['dbr']->tableName( 'page' );
186 -
187 - if ( $this->params['nameSpace'] ){
188 - $sqlWhere = ' WHERE page_namespace=' . $this->params['iNameSpace'] . ' ';
189 - }else{
190 - $sqlWhere = ' WHERE 1=1 ';
191 - }
192 -
193 - // If flagged revisions is in use, check which options selected.
194 - // FIXME: double check the default options in function::dpl_parm; what should it default to?
195 - if( function_exists('efLoadFlaggedRevs') ) {
196 - $flaggedPages = $this->params['dbr']->tableName( 'flaggedpages' );
197 - $filterSet = array( 'only', 'exclude' );
198 - # Either involves the same JOIN here...
199 - if( in_array( $this->params['stable'], $filterSet ) || in_array( $this->params['quality'], $filterSet ) ) {
200 - $sqlSelectFrom .= " LEFT JOIN $flaggedPages ON page_id = fp_page_id";
201 - }
202 - switch( $this->params['stable'] ){
203 - case 'only':
204 - $sqlWhere .= ' AND fp_stable IS NOT NULL ';
205 - break;
206 - case 'exclude':
207 - $sqlWhere .= ' AND fp_stable IS NULL ';
208 - break;
209 - }
210 - switch( $this->params['quality'] ){
211 - case 'only':
212 - $sqlWhere .= ' AND fp_quality >= 1';
213 - break;
214 - case 'exclude':
215 - $sqlWhere .= ' AND fp_quality = 0';
216 - break;
217 - }
218 - }
219 -
220 - switch ( $this->params['redirects'] )
221 - {
222 - case 'only':
223 - $sqlWhere .= ' AND page_is_redirect = 1 ';
224 - break;
225 - case 'exclude':
226 - $sqlWhere .= ' AND page_is_redirect = 0 ';
227 - break;
228 - }
229 -
230 - $currentTableNumber = 0;
231 -
232 - for ( $i = 0; $i < $this->params['catCount']; $i++ ){
233 -
234 - $sqlSelectFrom .= ' INNER JOIN ' . $this->params['dbr']->tableName( 'categorylinks' );
235 - $sqlSelectFrom .= ' AS c' . ( $currentTableNumber + 1 ) . ' ON page_id = c';
236 - $sqlSelectFrom .= ( $currentTableNumber + 1 ) . '.cl_from AND c' . ( $currentTableNumber + 1 );
237 -
238 - $sqlSelectFrom .= '.cl_to=' . $this->params['dbr']->addQuotes( $this->categories[$i]->getDBkey() );
239 -
240 - $currentTableNumber++;
241 - }
242 -
243 - for ( $i = 0; $i < $this->params['notCatCount']; $i++ ){
244 - //echo "notCategory parameter $i<br />\n";
245 - $sqlSelectFrom .= ' LEFT OUTER JOIN ' . $this->params['dbr']->tableName( 'categorylinks' );
246 - $sqlSelectFrom .= ' AS c' . ( $currentTableNumber + 1 ) . ' ON page_id = c' . ( $currentTableNumber + 1 );
247 - $sqlSelectFrom .= '.cl_from AND c' . ( $currentTableNumber + 1 );
248 - $sqlSelectFrom .= '.cl_to=' . $this->params['dbr']->addQuotes( $this->notCategories[$i]->getDBkey() );
249 -
250 - $sqlWhere .= ' AND c' . ( $currentTableNumber + 1 ) . '.cl_to IS NULL';
251 -
252 - $currentTableNumber++;
253 - }
254 -
255 - if ('lastedit' == $this->params['orderMethod'] )
256 - $sqlWhere .= ' ORDER BY page_touched ';
257 - else
258 - $sqlWhere .= ' ORDER BY c1.cl_timestamp ';
259 -
260 - if ( 'descending' == $this->params['order'] )
261 - $sqlWhere .= 'DESC';
262 - else
263 - $sqlWhere .= 'ASC';
264 -
265 - // FIXME: Note: this is not a boolean type check - will also trap count = 0 which may
266 - // accidentally give unlimited returns
267 - if ( 0 < $this->params['count'] ){
268 - $sqlWhere .= ' LIMIT ' . $this->params['count'];
269 - }
270 -
271 - //debug line
272 - //echo "<p>$sqlSelectFrom$sqlWhere;</p>\n";
273 -
274 - return $sqlSelectFrom . $sqlWhere;
275 - }
276 -
277 - /**
278 - * Parse parameters
279 - **
280 - * FIXME this includes a lot of DynamicPageList cruft in need of thinning.
281 - **/
282 - public function dpl_parm( $par ){
283 - global $wgContLang;
284 - global $wgRequest;
285 -
286 - $params = $wgRequest->getValues();
287 - // FIXME: note: if ( false === $count ) then no count has ever been set
288 - // however, there's still no guarantee $count <> zero || NULL
289 - $this->params['count'] = $this->wgDPLmaxResultCount;
290 -
291 - $this->params['orderMethod'] = 'categoryadd';
292 - $this->params['order'] = 'descending';
293 - $this->params['redirects'] = 'exclude';
294 - $this->params['stable'] = $this->params['quality'] = 'only';
295 -
296 - $this->params['nameSpace'] = false;
297 - $this->params['iNameSpace'] = 0;
298 -
299 - $this->params['useNameSpace'] = false;
300 - $this->params['useCurId'] = false;
301 -
302 - $this->params['suppressErrors'] = false;
303 -
304 - $this->params['feed'] = 'atom';
305 - $feedType = explode( '/', $par, 2);
306 - switch( strtolower($feedType[0])){
307 - case 'rss':
308 - $this->params['feed'] = 'rss';
309 - break;
310 - case 'sitemap':
311 - $this->params['feed'] = 'sitemap';
312 - break;
313 - default:
314 - $this->params['feed'] = 'atom';
315 - break;
316 - }
317 -
318 - $parser = new Parser;
319 - $poptions = new ParserOptions;
320 -
321 - foreach ( $params as $key=>$value ){
322 - switch ( $key ){
323 - case 'category':
324 - $title = Title::newFromText( $parser->transformMsg( $value, $poptions ) );
325 -
326 - if ( is_object( $title ) ){
327 - $this->categories[] = $title;
328 - }else{
329 - echo "Explode on category.\n";
330 - continue;
331 - }
332 - break;
333 - case 'notcategory':
334 - //echo "Got notcategory $value\n";
335 - $title = Title::newFromText( $parser->transformMsg( $value, $poptions ) );
336 - if ( is_object( $title ) )
337 - $this->notCategories[] = $title;
338 - else{
339 - echo 'Explode on notCategory.';
340 - continue;
341 - }
342 - break;
343 - case 'namespace':
344 - if ( $value == intval( $value ) ){
345 - $this->params['iNameSpace'] = intval( $value );
346 - if ( 0 <= $this->params['iNameSpace'] ){
347 - $this->params['nameSpace'] = true;
348 - }else{
349 - $this->params['nameSpace'] = false;
350 - }
351 - }else{
352 - $ns = $wgContLang->getNsIndex( $value );
353 - if ( null !== $ns ){
354 - $this->params['iNameSpace'] = $ns;
355 - $this->params['nameSpace'] = true;
356 - }
357 - }
358 - break;
359 - case 'count':
360 - if ( ( $this->wgDPLminResultCount < $value ) && ( $value < $this->wgDPLmaxResultCount ) ){
361 - $this->params['count'] = intval( $value );
362 - }
363 - break;
364 - case 'order';
365 - switch ( $value ){
366 - case 'ascending':
367 - $this->params['order'] = 'ascending';
368 - break;
369 - case 'descending':
370 - default:
371 - $this->params['order'] = 'descending';
372 - break;
373 - }
374 - break;
375 - case 'ordermethod';
376 - switch ( $value ){
377 - case 'lastedit':
378 - $this->params['orderMethod'] = 'lastedit';
379 - break;
380 - case 'categoryadd':
381 - default:
382 - $this->params['orderMethod'] = 'categoryadd';
383 - break;
384 - }
385 - break;
386 - case 'redirects';
387 - switch ( $value ){
388 - case 'include':
389 - $this->params['redirects'] = 'include';
390 - break;
391 - case 'only':
392 - $this->params['redirects'] = 'only';
393 - break;
394 - case 'exclude':
395 - default:
396 - $this->params['redirects'] = 'exclude';
397 - break;
398 - }
399 - break;
400 - case 'stablepages':
401 - switch ( $value ){
402 - case 'include':
403 - $this->params['stable'] = 'include';
404 - break;
405 - case 'exclude':
406 - $this->params['stable'] = 'exclude';
407 - break;
408 - case 'only':
409 - default:
410 - $this->params['stable'] = 'only';
411 - break;
412 - }
413 - break;
414 - case 'qualitypages':
415 - switch ( $value ){
416 - case 'include':
417 - $this->params['quality'] = 'include';
418 - break;
419 - case 'only':
420 - $this->params['quality'] = 'only';
421 - break;
422 - case 'exclude':
423 - default:
424 - $this->params['quality'] = 'exclude';
425 - break;
426 - }
427 - break;
428 - case 'suppresserrors':
429 - // note: if previously set to true, remains true. malformed does not reset to false.
430 - if ( 'true' == $value ) $this->params['suppressErrors'] = true;
431 - break;
432 - case 'usenamespace':
433 - // note: if previously set to false, remains false. Malformed does not reset to true.
434 - if ( 'false' == $value ) $this->params['useNameSpace'] = false;
435 - break;
436 - case 'usecurid':
437 - // note: if previously set to true, remains true. Malformed does not reset to false.
438 - if ( 'true' == $value ) $this->params['useCurId'] = true;
439 - break;
440 - default:
441 - }
442 - }
443 -
444 - $this->params['catCount'] = count( $this->categories );
445 - $this->params['notCatCount'] = count( $this->notCategories );
446 - $totalCatCount = $this->params['catCount'] + $this->params['notCatCount'];
447 -
448 - if (( $this->params['catCount'] < 1 && false == $this->params['nameSpace'] ) || ( $totalCatCount < $this->wgDPlminCategories )){
449 - //echo "Boom on catCount\n";
450 - $parser = new Parser;
451 - $poptions = new ParserOptions;
452 - $feed = Title::newFromText( $parser->transformMsg( 'Published', $poptions ) );
453 - if ( is_object( $feed ) ){
454 - $this->categories[] = $feed;
455 - $this->params['catCount'] = count( $this->categories );
456 - }else{
457 - echo "\$feed is not an object.\n";
458 - continue;
459 - }
460 - }
461 -
462 - if ( ( $totalCatCount > $this->wgDPlmaxCategories ) && ( !$this->wgDPLallowUnlimitedCategories ) ){
463 - $this->params['error'] = htmlspecialchars( wfMsg( 'intersection_toomanycats' ) ); // "!!too many categories!!";
464 - }
465 -
466 - //disallow showing date if the query doesn't have an inclusion category parameter
467 - if ( $this->params['count'] < 1 )
468 - $this->params['addFirstCategoryDate'] = false;
469 -
470 - $this->params['dbr'] = wfGetDB( DB_SLAVE );
471 - return;
472 - }
473 -
474 - function feedItemAuthor( $row ) {
475 - return isset( $row->user_text ) ? $row->user_text : 'Wikinews';
476 - }
477 -
478 - function feedItemDesc( $row ) {
479 - return isset( $row->comment ) ? htmlspecialchars( $row->comment ) : '';
480 - }
481 -
482 - function getKeywords ( $title ){
483 - $cats = $title->getParentCategories();
484 - $str = '';
485 - #the following code is based (stolen) from r56954 of flagged revs.
486 - $catMap = Array();
487 - $catMask = Array();
488 - $msg = wfMsg( 'gnsm_categorymap' );
489 - if ( !wfEmptyMsg( 'gnsm_categorymap', $msg ) ) {
490 - $list = explode( "\n*", "\n$msg");
491 - foreach($list as $item) {
492 - $mapping = explode('|', $item, 2);
493 - if ( count( $mapping ) == 2 ) {
494 - if ( trim( $mapping[1] ) == '__MASK__') {
495 - $catMask[trim($mapping[0])] = true;
496 - } else {
497 - $catMap[trim($mapping[0])] = trim($mapping[1]);
498 - }
499 - }
500 - }
501 - }
502 - foreach ( $cats as $key => $val ){
503 - $cat = str_replace( '_', ' ', trim( substr( $key, strpos( $key, ':' ) + 1 ) ) );
504 - if (!isset($catMask[$cat])) {
505 - if (isset($catMap[$cat])) {
506 - $str .= ', ' . str_replace( '_', ' ', trim ( $catMap[$cat] ) );
507 - } else {
508 - $str .= ', ' . $cat;
509 - }
510 - }
511 - }
512 - $str = substr( $str, 2 ); #to remove leading ', '
513 - return $str;
514 - }
515 -
516 -}
517 -
518 -/**
519 - * FeedSitemapItem Class
520 - **
521 - * Base class for basic SiteMap support, for building url containers.
522 - **/
523 -class FeedSitemapItem{
524 - /**
525 - * Var string
526 - **/
527 - var $url = '';
528 - var $pubDate = '';
529 - var $keywords = '';
530 - var $lastMod = '';
531 - var $priority = '';
532 -
533 - function __construct( $url, $pubDate, $keywords = '', $lastMod = '', $priority = ''){
534 - $this->url = $url;
535 - $this->pubDate = $pubDate;
536 - $this->keywords = $keywords;
537 - $this->lastMod = $lastMod;
538 - $this->priority = $priority;
539 - }
540 -
541 - public function xmlEncode( $string ){
542 - $string = str_replace( "\r\n", "\n", $string );
543 - $string = preg_replace( '/[\x00-\x08\x0b\x0c\x0e-\x1f]/', '', $string );
544 - return htmlspecialchars( $string );
545 - }
546 -
547 - public function getUrl(){
548 - return $this->url;
549 - }
550 -
551 - public function getPriority(){
552 - return $this->priority;
553 - }
554 -
555 - public function getLastMod(){
556 - return $this->lastMod;
557 - }
558 -
559 - public function getKeywords (){
560 - return $this->xmlEncode( $this->keywords );
561 - }
562 -
563 - public function getPubDate(){
564 - return $this->pubDate;
565 - }
566 -
567 - function formatTime( $ts ) {
568 - // need to use RFC 822 time format at least for rss2.0
569 - return gmdate( 'Y-m-d\TH:i:s', wfTimestamp( TS_UNIX, $ts ) );
570 - }
571 -
572 - /**
573 - * Setup and send HTTP headers. Don't send any content;
574 - * content might end up being cached and re-sent with
575 - * these same headers later.
576 - *
577 - * This should be called from the outHeader() method,
578 - * but can also be called separately.
579 - *
580 - * @public
581 - **/
582 - function httpHeaders() {
583 - global $wgOut;
584 - # We take over from $wgOut, excepting its cache header info
585 - $wgOut->disable();
586 - $mimetype = $this->contentType();
587 - header( "Content-type: $mimetype; charset=UTF-8" );
588 - $wgOut->sendCacheControl();
589 -
590 - }
591 -
592 - function outXmlHeader(){
593 - global $wgStylePath, $wgStyleVersion;
594 -
595 - $this->httpHeaders();
596 - echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
597 - }
598 -
599 - /**
600 - * Return an internet media type to be sent in the headers.
601 - *
602 - * @return string
603 - * @private
604 - **/
605 - function contentType() {
606 - global $wgRequest;
607 - $ctype = $wgRequest->getVal('ctype','application/xml');
608 - $allowedctypes = array('application/xml','text/xml','application/rss+xml','application/atom+xml');
609 - return (in_array($ctype, $allowedctypes) ? $ctype : 'application/xml');
610 - }
611 -
612 -}
613 -
614 -class SitemapFeed extends FeedSitemapItem{
615 - /**
616 - * Output feed headers
617 - **/
618 - function outHeader(){
619 - $this->outXmlHeader();
620 - ?>
621 -<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
622 - xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
623 - <?php
624 - }
625 - /**
626 - * Output a SiteMap 0.9 item
627 - * @param FeedSitemapItem item to be output
628 - **/
629 - function outItem( $item ) {
630 - ?>
631 -<url>
632 -<loc>
633 - <?php print $item->getUrl() ?>
634 -</loc>
635 -<news:news>
636 - <news:publication_date>
637 - <?php print $item->getPubDate() ?>
638 - </news:publication_date>
639 - <?php if( $item->getKeywords() ){
640 - echo '<news:keywords>' . $item->getKeywords() . "</news:keywords>\n";
641 - }
642 - ?>
643 -</news:news>
644 - <?php if( $item->getLastMod() ){ ?>
645 -<lastmod>
646 - <?php print $item->getLastMod(); ?>
647 -</lastmod>
648 - <?php }?>
649 - <?php if( $item->getPriority() ){ ?>
650 -<priority>
651 - <? print $item->getPriority(); ?>
652 -</priority>
653 - <?php }?>
654 -</url>
655 - <?php
656 - }
657 -
658 - /**
659 - * Output SiteMap 0.9 footer
660 - **/
661 - function outFooter(){
662 - echo '</urlset>';
663 - }
664 -
665 -}
Index: trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.i18n.php
@@ -1,437 +0,0 @@
2 -<?php
3 -/**
4 - * Internationalisation file for extension special page GoogleNewsSitemap
5 - * New version of DynamicPageList extension for use by Wikinews projects
6 - *
7 - * @addtogroup Extensions
8 - **/
9 -
10 -$messages= array();
11 -
12 -/** English
13 - * @author Amgine
14 - **/
15 -
16 -$messages['en'] = array(
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!',
24 -);
25 -
26 -/** Afrikaans (Afrikaans)
27 - * @author Naudefj
28 - */
29 -$messages['af'] = array(
30 - 'gnsm' => 'Google Nuus Sitemap',
31 - 'gnsm-desc' => 'Eksporteer \'n Atom/RSS-voer as \'n Google "News Sitemap"',
32 - 'gnsm_toomanycats' => 'Fout: Te veel kategorieë!',
33 - 'gnsm_toofewcats' => 'Fout: Te min kategorieë!',
34 - 'gnsm_noresults' => 'Fout: Geen resultate!',
35 - 'gnsm_noincludecats' => "Fout: U moet ten minste een kategorie insluit, of spesifiseer 'n naamspasie!",
36 -);
37 -
38 -/** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
39 - * @author EugeneZelenko
40 - * @author Jim-by
41 - */
42 -$messages['be-tarask'] = array(
43 - 'gnsm' => 'Мапа сайту Google News',
44 - 'gnsm-desc' => 'Выводзіць стужкі Atom/RSS у выглядзе мапы сайту Google News',
45 - 'gnsm_toomanycats' => 'Памылка: зашмат катэгорыяў!',
46 - 'gnsm_toofewcats' => 'Памылка: занадта мала катэгорыяў!',
47 - 'gnsm_noresults' => 'Памылка: няма вынікаў!',
48 - 'gnsm_noincludecats' => 'Памылка: Вам неабходна дадаць хаця б адну катэгорыю, альбо пазначыць прастору назваў!',
49 -);
50 -
51 -/** Breton (Brezhoneg)
52 - * @author Fulup
53 - * @author Y-M D
54 - */
55 -$messages['br'] = array(
56 - 'gnsm' => "Steuñvenn lec'hienn Keleier Google",
57 - 'gnsm-desc' => "Krouiñ a ra ul lanvad Atom/RSS evel steuñvenn ul lec'hienn Keleier Google",
58 - 'gnsm_toomanycats' => 'Fazi : Re a rummadoù !',
59 - 'gnsm_toofewcats' => 'Fazi : Re nebeut a rummadoù !',
60 - 'gnsm_noresults' => "Fazi : Disoc'h ebet !",
61 - 'gnsm_noincludecats' => "Fazi : Ret eo deoc'h merkañ ur rummad da nebeutañ, pe spisaat un esaouenn anv!",
62 -);
63 -
64 -/** Bosnian (Bosanski)
65 - * @author CERminator
66 - */
67 -$messages['bs'] = array(
68 - 'gnsm' => 'Google News mapa stranice',
69 - 'gnsm-desc' => 'Daje izlaz atom/RSS fida kao Google News mapa stranice',
70 - 'gnsm_toomanycats' => 'Greška: Previše kategorija!',
71 - 'gnsm_toofewcats' => 'Greška: Premalo kategorija!',
72 - 'gnsm_noresults' => 'Greška: Nema rezultata!',
73 - 'gnsm_noincludecats' => 'Greška: Morate uključiti najmanje jednu kategoriju ili navesti imenski prostor!',
74 -);
75 -
76 -/** Catalan (Català)
77 - * @author Paucabot
78 - */
79 -$messages['ca'] = array(
80 - 'gnsm' => 'Mapa del lloc Google News',
81 - 'gnsm_toomanycats' => 'Error: Massa categories!',
82 - 'gnsm_toofewcats' => 'Error: Massa poques categories!',
83 - 'gnsm_noresults' => 'Error: Cap resultat!',
84 - 'gnsm_noincludecats' => "Error: Heu d'incloure almenys una categoria o especificar un espai de noms!",
85 -);
86 -
87 -/** German (Deutsch)
88 - * @author Kghbln
89 - */
90 -$messages['de'] = array(
91 - 'gnsm' => 'Sitemap für Google News',
92 - 'gnsm-desc' => 'Gibt Atom/RSS-Feeds in Form einer Sitemap für Google News aus.',
93 - 'gnsm_toomanycats' => 'Fehler: Zu viele Kategorien!',
94 - 'gnsm_toofewcats' => 'Fehler: Zu wenig Kategorien!',
95 - 'gnsm_noresults' => 'Fehler: Keine Ergebnisse vorhanden!',
96 - 'gnsm_noincludecats' => 'Fehler: Du musst mindestens eine Kategorie oder einen Namensraum angeben!',
97 -);
98 -
99 -/** Lower Sorbian (Dolnoserbski)
100 - * @author Michawiki
101 - */
102 -$messages['dsb'] = array(
103 - 'gnsm' => 'Sedłowy pśeglěd Google Nowosći',
104 - 'gnsm-desc' => 'Wudawa kanal Atom/RSS ako sedłowy pśeglěd Google Nowosći',
105 - 'gnsm_toomanycats' => 'Zmólka: Pśewjele kategorijow!',
106 - 'gnsm_toofewcats' => 'Zmólka: Pśemało kategorijow!',
107 - 'gnsm_noresults' => 'Zmólka: Žedne wuslědki!',
108 - 'gnsm_noincludecats' => 'Zmólka: Musyš nanejmjenjej jadnu kategoriju zapśěgnuś abo mjenjowy rum pódaś!',
109 -);
110 -
111 -/** Greek (Ελληνικά)
112 - * @author Περίεργος
113 - */
114 -$messages['el'] = array(
115 - 'gnsm' => 'Χάρτης Ειδήσεων της Google',
116 - 'gnsm-desc' => 'Βγάζει το Χάρτη Ειδήσεων της Google ως Atom/RSS',
117 - 'gnsm_toomanycats' => 'Σφάλμα: Υπερβολικά πολλές κατηγορίες!',
118 - 'gnsm_toofewcats' => 'Σφάλμα: Υπερβολικά λίγες κατηγορίες!',
119 - 'gnsm_noresults' => 'Σφάλμα: Δεν υπάρχουν αποτελέσματα!',
120 - 'gnsm_noincludecats' => 'Σφάλμα: Χρειάζεται να συμπεριλάβετε τουλάχιστον μια κατηγορία, ή να προσδιορίσετε μια περιοχή ονομάτων!',
121 -);
122 -
123 -/** Spanish (Español)
124 - * @author Translationista
125 - */
126 -$messages['es'] = array(
127 - 'gnsm' => 'Mapa del sitio Google Noticias',
128 - 'gnsm-desc' => 'Genera una fuenteAtom/RSS como un mapa de sitio de Google Noticias',
129 - 'gnsm_toomanycats' => 'Error: ¡Demasiadas categorías!',
130 - 'gnsm_toofewcats' => 'Error: ¡Muy pocas categorías!',
131 - 'gnsm_noresults' => 'Error: ¡No hay resultados!',
132 - 'gnsm_noincludecats' => 'Error: ¡Es necesario incluir al menos una categoría o especificar un espacio de nombres!',
133 -);
134 -
135 -/** Basque (Euskara)
136 - * @author An13sa
137 - */
138 -$messages['eu'] = array(
139 - 'gnsm' => 'Google News Gunearen mapa',
140 - 'gnsm-desc' => 'Atom/RSS iturria zehazten du Google News Gunearen maparentzat',
141 - 'gnsm_toomanycats' => 'Errorea: Kategoria gehiegi!',
142 - 'gnsm_toofewcats' => 'Errorea: Kategoria gutxiegi!',
143 - 'gnsm_noresults' => 'Errorea: Emaitzarik ez!',
144 - 'gnsm_noincludecats' => 'Errorea: Gutxienez kategoria bat gehitu edo izen bat zehaztu behar duzu!',
145 -);
146 -
147 -/** Finnish (Suomi)
148 - * @author Centerlink
149 - * @author Crt
150 - */
151 -$messages['fi'] = array(
152 - 'gnsm' => 'Google News -sivukartta',
153 - 'gnsm-desc' => 'Tulostaa Atom/RSS-syötteen Google-uutissivukarttana',
154 - 'gnsm_toomanycats' => 'Virhe: Liian monta luokkaa.',
155 - 'gnsm_toofewcats' => 'Virhe: Liian vähän luokkia.',
156 - 'gnsm_noresults' => 'Virhe: Ei tuloksia.',
157 - 'gnsm_noincludecats' => 'Error: Lisää vähintään yksi luokka tai määritä nimiavaruus.',
158 -);
159 -
160 -/** French (Français)
161 - * @author Amgine
162 - * @author McDutchie
163 - */
164 -$messages['fr'] = array(
165 - 'gnsm' => 'Google nouvelles Sitemap',
166 - 'gnsm-desc' => 'Cre un Atom ou RSS feed comme un plan Sitemap pour Google',
167 - 'gnsm_toomanycats' => 'Erreur: Trop de nombreuses catégories!',
168 - 'gnsm_toofewcats' => 'Erreur: Trop peu de catégories!',
169 - 'gnsm_noresults' => 'Erreur: Pas de résultats!',
170 - 'gnsm_noincludecats' => 'Erreur: Vous devez inclure au moins une catégorie, ou spécifier un espace de noms !',
171 -);
172 -
173 -/** Galician (Galego)
174 - * @author Toliño
175 - */
176 -$messages['gl'] = array(
177 - 'gnsm' => 'Mapa do sitio das novas do Google',
178 - 'gnsm-desc' => 'Dá como resultado unha fonte de novas Atom/RSS como un mapa do sitio das novas do Google',
179 - 'gnsm_toomanycats' => 'Erro: hai moitas categorías!',
180 - 'gnsm_toofewcats' => 'Erro: moi poucas categorías!',
181 - 'gnsm_noresults' => 'Erro: non hai resultados!',
182 - 'gnsm_noincludecats' => 'Erro: debe incluír, polo menos, unha categoría ou especificar un espazo de nomes!',
183 -);
184 -
185 -/** Swiss German (Alemannisch)
186 - * @author Als-Holder
187 - */
188 -$messages['gsw'] = array(
189 - 'gnsm' => 'Google Nejigkeite Sytenibersicht',
190 - 'gnsm-desc' => 'Liferet e Atom/RSS-feed as Google Nejigkeite Sytenibersicht',
191 - 'gnsm_toomanycats' => 'Fähler: z vil Kategorie!',
192 - 'gnsm_toofewcats' => 'Fähler: z wenig Kategorie!',
193 - 'gnsm_noresults' => 'Fähler: kei Ergebnis!',
194 - 'gnsm_noincludecats' => 'Fähler: muesch zmindescht ei Kategorii aagee oder e Namensruum feschtlege!',
195 -);
196 -
197 -/** Upper Sorbian (Hornjoserbsce)
198 - * @author Michawiki
199 - */
200 -$messages['hsb'] = array(
201 - 'gnsm' => 'Sydłowa přehlad Google Nowinki',
202 - 'gnsm-desc' => 'Wudawa kanal Atom/RSS jako sydłowy přehlad Google Nowinki',
203 - 'gnsm_toomanycats' => 'Zmylk: Přewjele kategorijow!',
204 - 'gnsm_toofewcats' => 'Zmylk: Přemało kategorijow!',
205 - 'gnsm_noresults' => 'Zmylk: Žane wuslědki!',
206 - 'gnsm_noincludecats' => 'Zmylk: Dyrbiš znajmjeńša jednu kategoriju zapřijeć abo mjenowy rum podać!',
207 -);
208 -
209 -/** Hungarian (Magyar)
210 - * @author Glanthor Reviol
211 - */
212 -$messages['hu'] = array(
213 - 'gnsm' => 'Google hírek oldaltérkép',
214 - 'gnsm-desc' => 'Atom/RSS hírcsatornát készít Google hírek oldaltérképként',
215 - 'gnsm_toomanycats' => 'Hiba: túl sok kategória!',
216 - 'gnsm_toofewcats' => 'Hiba: túl kevés kategória!',
217 - 'gnsm_noresults' => 'Hiba: nincs találat!',
218 - 'gnsm_noincludecats' => 'Hiba: legalább egy kategóriát vagy névteret meg kell adnod!',
219 -);
220 -
221 -/** Interlingua (Interlingua)
222 - * @author McDutchie
223 - */
224 -$messages['ia'] = array(
225 - 'gnsm' => 'Sitemap de Google News',
226 - 'gnsm-desc' => 'Converte un syndication Atom/RSS in un Sitemap de Google News',
227 - 'gnsm_toomanycats' => 'Error: Troppo de categorias!',
228 - 'gnsm_toofewcats' => 'Error: Non satis de categorias!',
229 - 'gnsm_noresults' => 'Error: Nulle resultato!',
230 - 'gnsm_noincludecats' => 'Error: Tu debe includer al minus un categoria, o specificar un spatio de nomines!',
231 -);
232 -
233 -/** Indonesian (Bahasa Indonesia)
234 - * @author Iwan Novirion
235 - * @author Kenrick95
236 - */
237 -$messages['id'] = array(
238 - 'gnsm' => 'Petasitus Baru Google',
239 - 'gnsm-desc' => 'Hasil dari Atom/RSS feed sebagai Petasitus Baru Google',
240 - 'gnsm_toomanycats' => 'Kesalahan: Terlalu banyak kategori!',
241 - 'gnsm_toofewcats' => 'Kesalahan: Terlalu sedikit kategori!',
242 - 'gnsm_noresults' => 'Kesalahan: Tidak ada hasil!',
243 - 'gnsm_noincludecats' => 'Kesalahan: Anda perlu mencantumkan paling sedikit satu kategori, atau menyebutkan satu ruang nama!',
244 -);
245 -
246 -/** Italian (Italiano)
247 - * @author Beta16
248 - */
249 -$messages['it'] = array(
250 - 'gnsm_toomanycats' => 'Errore: Numero di categorie eccessivo!',
251 - 'gnsm_toofewcats' => 'Errore: Troppe poche categorie!',
252 - 'gnsm_noresults' => 'Errore: Nessun risultato.',
253 - 'gnsm_noincludecats' => 'Errore: È necessario includere almeno una categoria oppure specificare un namespace!',
254 -);
255 -
256 -/** Japanese (日本語)
257 - * @author Hosiryuhosi
258 - * @author Naohiro19
259 - */
260 -$messages['ja'] = array(
261 - 'gnsm' => 'Google ニュース サイトマップ',
262 - 'gnsm-desc' => 'Google ニュースのサイトマップからAtom/RSSフィードを出力',
263 - 'gnsm_toomanycats' => 'エラー: カテゴリが多すぎです!',
264 - 'gnsm_toofewcats' => 'エラー:カテゴリが少なすぎです!',
265 - 'gnsm_noresults' => 'エラー:結果はありません!',
266 - 'gnsm_noincludecats' => 'エラー:少なくとも1つのカテゴリまたは名前空間を指定する必要があります!',
267 -);
268 -
269 -/** Luxembourgish (Lëtzebuergesch)
270 - * @author Robby
271 - */
272 -$messages['lb'] = array(
273 - 'gnsm' => 'Google News Plang vum Site',
274 - 'gnsm-desc' => 'Produzéiert en Atom/RSS feed als Google News Sitemap',
275 - 'gnsm_toomanycats' => 'Feeler: Zevill Kategorien!',
276 - 'gnsm_toofewcats' => 'Feeler: Ze wéineg Kategorien!',
277 - 'gnsm_noresults' => 'Feeler: Keng Resultater!',
278 - 'gnsm_noincludecats' => 'Feeler: Dir musst mindestens eng Kategorie oder een Nummraum drasetzen!',
279 -);
280 -
281 -/** Macedonian (Македонски)
282 - * @author Bjankuloski06
283 - */
284 -$messages['mk'] = array(
285 - 'gnsm' => 'План на страницата Google Вести',
286 - 'gnsm-desc' => 'Дава Atom/RSS канал како план на страницата Google Вести',
287 - 'gnsm_toomanycats' => 'Грешка: Премногу категории!',
288 - 'gnsm_toofewcats' => 'Грешка: Премалку категории!',
289 - 'gnsm_noresults' => 'Грешка: Нема резултати!',
290 - 'gnsm_noincludecats' => 'Грешка: Треба да вклучите барем една категорија, или да назначите именски простор!',
291 -);
292 -
293 -/** Dutch (Nederlands)
294 - * @author Siebrand
295 - */
296 -$messages['nl'] = array(
297 - 'gnsm' => 'Google Nieuws Sitemap',
298 - 'gnsm-desc' => 'Levert een Atom/RSS-feed als Google Nieuws Sitemap',
299 - 'gnsm_toomanycats' => 'Fout: te veel categorieën!',
300 - 'gnsm_toofewcats' => 'Fout: te weinig categorieën!',
301 - 'gnsm_noresults' => 'Fout: geen resultaten!',
302 - 'gnsm_noincludecats' => 'Fout: u moet tenminste een categorie of naamruimte opgeven!',
303 -);
304 -
305 -/** Norwegian Nynorsk (‪Norsk (nynorsk)‬)
306 - * @author Harald Khan
307 - */
308 -$messages['nn'] = array(
309 - 'gnsm_toomanycats' => 'Feil: For mange kategoriar.',
310 - 'gnsm_toofewcats' => 'Feil: For få kategoriar.',
311 - 'gnsm_noresults' => 'Feil: Ingen resultat',
312 - 'gnsm_noincludecats' => 'Feil: Du lyt inkludera minst éin kategori eller oppgje eit namnerom.',
313 -);
314 -
315 -/** Norwegian (bokmål)‬ (‪Norsk (bokmål)‬)
316 - * @author Nghtwlkr
317 - */
318 -$messages['no'] = array(
319 - 'gnsm' => 'Nettstedskart for Google News',
320 - 'gnsm-desc' => 'Gir ut en Atom/RSS-mating som et nettstedskart for Google News',
321 - 'gnsm_toomanycats' => 'Feil: For mange kategorier!',
322 - 'gnsm_toofewcats' => 'Feil: For få kategorier!',
323 - 'gnsm_noresults' => 'Feil: Ingen resultat!',
324 - 'gnsm_noincludecats' => 'Feil: Du må inkludere minst én kategori eller oppgi et navnerom!',
325 -);
326 -
327 -/** Polish (Polski)
328 - * @author Sp5uhe
329 - */
330 -$messages['pl'] = array(
331 - 'gnsm_toomanycats' => 'Błąd – zbyt wiele kategorii!',
332 - 'gnsm_toofewcats' => 'Błąd – zbyt mało kategorii!',
333 - 'gnsm_noresults' => 'Błąd – brak wyników!',
334 -);
335 -
336 -/** Piedmontese (Piemontèis)
337 - * @author Borichèt
338 - * @author Dragonòt
339 - */
340 -$messages['pms'] = array(
341 - 'gnsm' => 'Pian dël sit dle Neuve ëd Google',
342 - 'gnsm-desc' => 'A scriv un fluss Atom/RSS com pian dël Sit ëd le Neuve ëd Google',
343 - 'gnsm_toomanycats' => 'Eror: Tròpe categorìe!',
344 - 'gnsm_toofewcats' => 'Eror: Tròp pòche categorìe!',
345 - 'gnsm_noresults' => 'Eror: pa gnun arzultà!',
346 - 'gnsm_noincludecats' => 'Eror: A deuv anserì almanch na categorìa, o spessifiché në spassi nominal!',
347 -);
348 -
349 -/** Portuguese (Português)
350 - * @author Hamilton Abreu
351 - */
352 -$messages['pt'] = array(
353 - 'gnsm' => 'Google News Sitemap',
354 - 'gnsm-desc' => 'Converte um feed Atom/RSS para um Google News Sitemap',
355 - 'gnsm_toomanycats' => 'Erro: Categorias a mais!',
356 - 'gnsm_toofewcats' => 'Erro: Categorias a menos!',
357 - 'gnsm_noresults' => 'Erro: Não há resultados!',
358 - 'gnsm_noincludecats' => 'Erro: Tem de incluir pelo menos uma categoria, ou especificar um espaço nominal!',
359 -);
360 -
361 -/** Brazilian Portuguese (Português do Brasil)
362 - * @author Daemorris
363 - */
364 -$messages['pt-br'] = array(
365 - 'gnsm' => 'Mapa de Site de Notícias Google',
366 - 'gnsm-desc' => 'Produz um alimentador Atom/RSS como um Mapa de Site de Notícias Google',
367 - 'gnsm_toomanycats' => 'Erro: Categorias demais!',
368 - 'gnsm_toofewcats' => 'Erro: Categorias de menos!',
369 - 'gnsm_noresults' => 'Erro: Sem resultados!',
370 - 'gnsm_noincludecats' => 'Erro: Você precisa incluir pelo menos uma categoria, ou especificar um espaço nominal!',
371 -);
372 -
373 -/** Russian (Русский)
374 - * @author Александр Сигачёв
375 - */
376 -$messages['ru'] = array(
377 - 'gnsm' => 'Карта сайта для Google News',
378 - 'gnsm-desc' => 'Подготавливает канал Atom/RSS в виде карты сайта для Google News',
379 - 'gnsm_toomanycats' => 'Ошибка. Слишком много категорий!',
380 - 'gnsm_toofewcats' => 'Ошибка. Слишком мало категорий!',
381 - 'gnsm_noresults' => 'Ошибка. Нет данных!',
382 - 'gnsm_noincludecats' => 'Ошибка. Вы должны включить по меньшей мере одну категорию, или указать пространство имён!',
383 -);
384 -
385 -/** Swedish (Svenska)
386 - * @author Per
387 - */
388 -$messages['sv'] = array(
389 - 'gnsm_toomanycats' => 'Fel: För många kategorier!',
390 - 'gnsm_toofewcats' => 'Fel: För få kategorier!',
391 - 'gnsm_noresults' => 'Fel: Inget resultat!',
392 - 'gnsm_noincludecats' => 'Fel: Du måste inkludera minst en kategori eller specificera en namnrymd!',
393 -);
394 -
395 -/** Telugu (తెలుగు)
396 - * @author Veeven
397 - */
398 -$messages['te'] = array(
399 - 'gnsm' => 'గూగుల్ వార్తల సైటుపటం',
400 - 'gnsm_toomanycats' => 'పొరపాటు: చాలా ఎక్కువ వర్గాలు!',
401 - 'gnsm_toofewcats' => 'పొరపాటు: చాలా తక్కువ వర్గాలు!',
402 - 'gnsm_noresults' => 'పొరపాటు: ఫలితాలు లేవు!',
403 -);
404 -
405 -/** Thai (ไทย)
406 - * @author Woraponboonkerd
407 - */
408 -$messages['th'] = array(
409 - 'gnsm_toomanycats' => 'เกิดความผิดพลาด: เลือกประเภทมากเกินไป!',
410 - 'gnsm_toofewcats' => 'เกิดความผิดพลาด: เลือกประเภทน้อยเกินไป!',
411 - 'gnsm_noresults' => 'เกิดความผิดพลาด: ไม่พบข้อมูล!',
412 - 'gnsm_noincludecats' => 'เกิดความผิดพลาด: คุณต้องเลือกอย่างน้อยหนึ่งประเภท หรือกำหนด Namespace!',
413 -);
414 -
415 -/** Turkish (Türkçe)
416 - * @author Joseph
417 - */
418 -$messages['tr'] = array(
419 - 'gnsm' => 'Google Haberler Site haritası',
420 - 'gnsm-desc' => 'Bir Atom/RSS beslemesini Google Haberler Site haritası olarak çıktılar',
421 - 'gnsm_toomanycats' => 'Hata: Çok fazla kategori!',
422 - 'gnsm_toofewcats' => 'Hata: Çok az kategori!',
423 - 'gnsm_noresults' => 'Hata: Sonuç yok!',
424 - 'gnsm_noincludecats' => 'Hata: En az bir kategori girmeli, ya da bir ad alanı belirtmelisiniz!',
425 -);
426 -
427 -/** Simplified Chinese (‪中文(简体)‬)
428 - * @author Gaoxuewei
429 - */
430 -$messages['zh-hans'] = array(
431 - 'gnsm' => 'Google 资讯站点地图',
432 - 'gnsm-desc' => '输出一个Google 资讯站点地图的Atom/RSS文件',
433 - 'gnsm_toomanycats' => '错误:分类过多!',
434 - 'gnsm_toofewcats' => '错误:分类过少!',
435 - 'gnsm_noresults' => '错误:没有结果!',
436 - 'gnsm_noincludecats' => '错误:您需要包含至少一个分类,或者指定一个名称空间!',
437 -);
438 -
Index: trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.php
@@ -1,68 +0,0 @@
2 -<?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/SpecialGoogleNewsSitemap.php' );
7 -EOT;
8 - exit( 1 );
9 -}
10 -
11 -/**
12 - * Outputs feed xml
13 - **
14 - * A Special Page extension to produce:
15 - * Google News sitemap output - http://www.google.com/support/news_pub/bin/answer.py?hl=en&answer=74288
16 - * - http://www.sitemaps.org/protocol.php
17 - * RSS feed output - 2.0 http://www.rssboard.org/rss-specification
18 - * - 0.92 http://www.rssboard.org/rss-0-9-2
19 - * Atom feed output - 2005 http://tools.ietf.org/html/rfc4287
20 - **
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][...]}}
26 - **
27 - * This program is free software; you can redistribute it and/or modify it
28 - * under the terms of the GNU General Public License as published by the Free
29 - * Software Foundation; either version 2 of the License, or (at your option)
30 - * any later version.
31 - *
32 - * This program is distributed in the hope that it will be useful, but WITHOUT
33 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
34 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
35 - * more details.
36 - *
37 - * You should have received a copy of the GNU General Public License along with
38 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
39 - * Place - Suite 330, Boston, MA 02111-1307, USA.
40 - * http://www.gnu.org/copyleft/gpl.html
41 - **
42 - * Contributors
43 - * This script is based on Extension:DynamicPageList (Wikimedia), originally
44 - * developed by:
45 - * wikt:en:User:Amgine http://en.wiktionary.org/wiki/User:Amgine
46 - * n:en:User:IlyaHaykinson http://en.wikinews.org/wiki/User:IlyaHaykinson
47 - **
48 - * FIXME requests
49 - * use=Mediawiki:GoogleNewsSitemap_Feedname Parameter to allow on-site control of feed
50 - **
51 - * @addtogroup Extensions
52 - *
53 - * @author Amgine <amgine.saewyc@gmail.com>
54 - * @copyright Copyright © 2009, Amgine
55 - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
56 - */
57 -$wgExtensionCredits['specialpage'][] = array(
58 - 'path' => __FILE__,
59 - 'name' => 'GoogleNewsSitemap',
60 - 'author' => 'Amgine',
61 - 'descriptionmsg' => 'gnsm-desc',
62 - 'url' => 'http://www.mediawiki.org/wiki/Extension:GoogleNewsSitemap',
63 -);
64 -
65 -$dir = dirname(__FILE__) . '/';
66 -$wgExtensionMessagesFiles['GoogleNewsSitemap'] = $dir . 'SpecialGoogleNewsSitemap.i18n.php';
67 -$wgExtensionAliasesFiles['GoogleNewsSitemap'] = $dir . 'SpecialGoogleNewsSitemap.alias.php';
68 -$wgAutoloadClasses['GoogleNewsSitemap'] = $dir . 'SpecialGoogleNewsSitemap_body.php';
69 -$wgSpecialPages['GoogleNewsSitemap'] = 'GoogleNewsSitemap';
Index: trunk/extensions/GoogleNewsSitemap/SpecialGoogleNewsSitemap.alias.php
@@ -1,36 +0,0 @@
2 -<?php
3 -/**
4 - * Aliases for Special:GoogleNewsSitemap
5 - *
6 - * @addtogroup Extensions
7 - */
8 -
9 -$aliases = array();
10 -
11 -/** English
12 - * @author Amgine
13 - **/
14 -$aliases['en'] = array(
15 - 'GoogleNewsSitemap' => array( 'GoogleNewsSitemap' ),
16 -);
17 -
18 -/** Arabic (العربية) */
19 -$aliases['ar'] = array(
20 - 'GoogleNewsSitemap' => array( 'خريطة_موقع_أخبار_جوجل' ),
21 -);
22 -
23 -/** Egyptian Spoken Arabic (مصرى) */
24 -$aliases['arz'] = array(
25 - 'GoogleNewsSitemap' => array( 'خريطة_موقع_أخبار_جوجل' ),
26 -);
27 -
28 -/** Interlingua (Interlingua) */
29 -$aliases['ia'] = array(
30 - 'GoogleNewsSitemap' => array( 'Mappa de sito Google News' ),
31 -);
32 -
33 -/** Malayalam (മലയാളം) */
34 -$aliases['ml'] = array(
35 - 'GoogleNewsSitemap' => array( 'ഗൂഗിൾ‌‌വാർത്തകൾസൈറ്റ്മാപ്പ്' ),
36 -);
37 -
Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
@@ -0,0 +1,664 @@
 2+<?php
 3+if (!defined('MEDIAWIKI')) die();
 4+
 5+/**
 6+ * Class GoogleNewsSitemap creates Atom/RSS feeds for Wikinews
 7+ **
 8+ * Simple feed using Atom/RSS coupled to DynamicPageList category searching.
 9+ *
 10+ * To use: http://wiki.url/Special:GoogleNewsSitemap/<feedType>?[paramter=value][...]
 11+ *
 12+ * Implemented parameters are marked with an @
 13+ **
 14+ * 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
 25+ * usenamespace = bool ; default = false
 26+ * usecurid = bool ; default = false
 27+ * suppresserrors = bool ; default = false
 28+ **/
 29+
 30+class GoogleNewsSitemap extends IncludableSpecialPage {
 31+
 32+
 33+ /**
 34+ * FIXME: Some of this might need a config eventually
 35+ * @var string
 36+ **/
 37+ var $Title = '';
 38+ var $Description = '';
 39+ var $Url = '';
 40+ var $Date = '';
 41+ var $Author = '';
 42+ var $pubDate = '';
 43+ var $keywords = '';
 44+ var $lastMod = '';
 45+ var $priority = '';
 46+
 47+ /**
 48+ * Script default values - correctly spelt, naming standard.
 49+ **/
 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
 55+ var $wgDPLallowUnlimitedCategories = false; // Allow unlimited categories
 56+
 57+
 58+ /**
 59+ * @var array Parameters array
 60+ **/
 61+ var $params = array();
 62+ var $categories = array();
 63+ var $notCategories = array();
 64+
 65+ /**
 66+ * Constructor
 67+ **/
 68+ public function __construct() {
 69+ parent::__construct( 'GoogleNewsSitemap' );
 70+ }
 71+
 72+ /**
 73+ * main()
 74+ **/
 75+ public function execute( $par ) {
 76+ global $wgUser;
 77+ global $wgLang;
 78+ global $wgContLang;
 79+ global $wgRequest, $wgOut;
 80+ global $wgSitename, $wgServer, $wgScriptPath;
 81+ wfLoadExtensionMessages( 'GoogleNewsSitemap' );
 82+ global $wgFeedClasses, $wgLocaltimezone;
 83+
 84+ // Not sure how clean $wgLocaltimezone is
 85+ // In fact, it's default setting is null...
 86+ if ( null == $wgLocaltimezone )
 87+ $wgLocaltimezone = date_default_timezone_get();
 88+ date_default_timezone_set( $wgLocaltimezone );
 89+ //$url = __FILE__;
 90+
 91+ $this->dpl_parm( $par );
 92+
 93+
 94+ $wgFeedClasses[] = array( 'sitemap' => 'SitemapFeed' );
 95+
 96+ if ( 'sitemap' == $this->params['feed'] ){
 97+ $feed = new SitemapFeed(
 98+ $wgServer.$wgScriptPath,
 99+ date( DATE_ATOM )
 100+ );
 101+ }else{
 102+ // FIXME: These should be configurable at some point
 103+ $feed = new $wgFeedClasses[ $this->params['feed'] ](
 104+ $wgSitename,
 105+ $wgSitename . ' ' . $this->params['feed'] . ' feed',
 106+ $wgServer.$wgScriptPath,
 107+ date( DATE_ATOM ),
 108+ $wgSitename
 109+ );
 110+ }
 111+
 112+ $feed->outHeader();
 113+
 114+ // main routine to output items
 115+ if ( isset( $this->param['error'] ) ){
 116+ echo $this->param['error'];
 117+ }else{
 118+ $dbr = wfGetDB( DB_SLAVE );
 119+ $sql = $this->dpl_buildSQL();
 120+ //Debug line
 121+ //echo "\n<p>$sql</p>\n";
 122+ $res = $dbr->query ( $sql );
 123+
 124+ // FIXME: figure out how to fail with no results gracefully
 125+ if ( $dbr->numRows( $res ) == 0 ){
 126+ $feed->outFooter();
 127+ if ( false == $this->params['suppressErrors'] )
 128+ return htmlspecialchars( wfMsg( 'gnsm_noresults' ) );
 129+ else
 130+ return '';
 131+ }
 132+
 133+ while ($row = $dbr->fetchObject( $res ) ) {
 134+ $title = Title::makeTitle( $row->page_namespace, $row->page_title);
 135+
 136+ if ( $title ){
 137+ //This is printing things in places it shouldn't
 138+ // print $this->params['nameSpace'];
 139+
 140+ $titleText = ( true == $this->params['nameSpace'] ) ? $title->getPrefixedText() : $title->getText();
 141+
 142+ if ( 'sitemap' == $this->params['feed'] ){
 143+
 144+ $this->pubDate = isset( $row->cl_timestamp ) ? $row->cl_timestamp : date( DATE_ATOM );
 145+ $feedArticle = new Article( $title );
 146+
 147+ $feedItem = new FeedSitemapItem(
 148+ trim( $title->getFullURL() ),
 149+ wfTimeStamp( TS_ISO_8601, $this->pubDate ),
 150+ $this->getKeywords( $title ),
 151+ wfTimeStamp( TS_ISO_8601, $feedArticle->getTouched() ),
 152+ $feed->getPriority( $this->priority )
 153+ );
 154+
 155+ }elseif ( ('atom' == $this->params['feed'] ) || ( 'rss' == $this->params['feed'] ) ){
 156+
 157+ $this->Date = isset( $row->cl_timestamp ) ? $row->cl_timestamp : date( DATE_ATOM );
 158+ if ( isset( $row->comment ) ){
 159+ $comments = htmlspecialchars( $row->comment );
 160+ }else{
 161+ $talkpage = $title->getTalkPage();
 162+ $comments = $talkpage->getFullURL();
 163+ }
 164+ $titleText = (true === $this->params['nameSpace'] ) ? $title->getPrefixedText() : $title->getText();
 165+ $feedItem = new FeedItem(
 166+ $titleText,
 167+ $this->feedItemDesc( $row ),
 168+ $title->getFullURL(),
 169+ $this->Date,
 170+ $this->feedItemAuthor( $row ),
 171+ $comments);
 172+ }
 173+ $feed->outItem( $feedItem );
 174+ }
 175+ }
 176+ }
 177+ $feed->outFooter();
 178+ }
 179+
 180+ /**
 181+ * Build sql
 182+ **/
 183+ public function dpl_buildSQL(){
 184+
 185+ $sqlSelectFrom = 'SELECT page_namespace, page_title, page_id, c1.cl_timestamp FROM ' . $this->params['dbr']->tableName( 'page' );
 186+
 187+ if ( $this->params['nameSpace'] ){
 188+ $sqlWhere = ' WHERE page_namespace=' . $this->params['iNameSpace'] . ' ';
 189+ }else{
 190+ $sqlWhere = ' WHERE 1=1 ';
 191+ }
 192+
 193+ // If flagged revisions is in use, check which options selected.
 194+ // FIXME: double check the default options in function::dpl_parm; what should it default to?
 195+ if( function_exists('efLoadFlaggedRevs') ) {
 196+ $flaggedPages = $this->params['dbr']->tableName( 'flaggedpages' );
 197+ $filterSet = array( 'only', 'exclude' );
 198+ # Either involves the same JOIN here...
 199+ if( in_array( $this->params['stable'], $filterSet ) || in_array( $this->params['quality'], $filterSet ) ) {
 200+ $sqlSelectFrom .= " LEFT JOIN $flaggedPages ON page_id = fp_page_id";
 201+ }
 202+ switch( $this->params['stable'] ){
 203+ case 'only':
 204+ $sqlWhere .= ' AND fp_stable IS NOT NULL ';
 205+ break;
 206+ case 'exclude':
 207+ $sqlWhere .= ' AND fp_stable IS NULL ';
 208+ break;
 209+ }
 210+ switch( $this->params['quality'] ){
 211+ case 'only':
 212+ $sqlWhere .= ' AND fp_quality >= 1';
 213+ break;
 214+ case 'exclude':
 215+ $sqlWhere .= ' AND fp_quality = 0';
 216+ break;
 217+ }
 218+ }
 219+
 220+ switch ( $this->params['redirects'] )
 221+ {
 222+ case 'only':
 223+ $sqlWhere .= ' AND page_is_redirect = 1 ';
 224+ break;
 225+ case 'exclude':
 226+ $sqlWhere .= ' AND page_is_redirect = 0 ';
 227+ break;
 228+ }
 229+
 230+ $currentTableNumber = 0;
 231+
 232+ for ( $i = 0; $i < $this->params['catCount']; $i++ ){
 233+
 234+ $sqlSelectFrom .= ' INNER JOIN ' . $this->params['dbr']->tableName( 'categorylinks' );
 235+ $sqlSelectFrom .= ' AS c' . ( $currentTableNumber + 1 ) . ' ON page_id = c';
 236+ $sqlSelectFrom .= ( $currentTableNumber + 1 ) . '.cl_from AND c' . ( $currentTableNumber + 1 );
 237+
 238+ $sqlSelectFrom .= '.cl_to=' . $this->params['dbr']->addQuotes( $this->categories[$i]->getDBkey() );
 239+
 240+ $currentTableNumber++;
 241+ }
 242+
 243+ for ( $i = 0; $i < $this->params['notCatCount']; $i++ ){
 244+ //echo "notCategory parameter $i<br />\n";
 245+ $sqlSelectFrom .= ' LEFT OUTER JOIN ' . $this->params['dbr']->tableName( 'categorylinks' );
 246+ $sqlSelectFrom .= ' AS c' . ( $currentTableNumber + 1 ) . ' ON page_id = c' . ( $currentTableNumber + 1 );
 247+ $sqlSelectFrom .= '.cl_from AND c' . ( $currentTableNumber + 1 );
 248+ $sqlSelectFrom .= '.cl_to=' . $this->params['dbr']->addQuotes( $this->notCategories[$i]->getDBkey() );
 249+
 250+ $sqlWhere .= ' AND c' . ( $currentTableNumber + 1 ) . '.cl_to IS NULL';
 251+
 252+ $currentTableNumber++;
 253+ }
 254+
 255+ if ('lastedit' == $this->params['orderMethod'] )
 256+ $sqlWhere .= ' ORDER BY page_touched ';
 257+ else
 258+ $sqlWhere .= ' ORDER BY c1.cl_timestamp ';
 259+
 260+ if ( 'descending' == $this->params['order'] )
 261+ $sqlWhere .= 'DESC';
 262+ else
 263+ $sqlWhere .= 'ASC';
 264+
 265+ // FIXME: Note: this is not a boolean type check - will also trap count = 0 which may
 266+ // accidentally give unlimited returns
 267+ if ( 0 < $this->params['count'] ){
 268+ $sqlWhere .= ' LIMIT ' . $this->params['count'];
 269+ }
 270+
 271+ //debug line
 272+ //echo "<p>$sqlSelectFrom$sqlWhere;</p>\n";
 273+
 274+ return $sqlSelectFrom . $sqlWhere;
 275+ }
 276+
 277+ /**
 278+ * Parse parameters
 279+ **
 280+ * FIXME this includes a lot of DynamicPageList cruft in need of thinning.
 281+ **/
 282+ public function dpl_parm( $par ){
 283+ global $wgContLang;
 284+ global $wgRequest;
 285+
 286+ $params = $wgRequest->getValues();
 287+ // FIXME: note: if ( false === $count ) then no count has ever been set
 288+ // however, there's still no guarantee $count <> zero || NULL
 289+ $this->params['count'] = $this->wgDPLmaxResultCount;
 290+
 291+ $this->params['orderMethod'] = 'categoryadd';
 292+ $this->params['order'] = 'descending';
 293+ $this->params['redirects'] = 'exclude';
 294+ $this->params['stable'] = $this->params['quality'] = 'only';
 295+
 296+ $this->params['nameSpace'] = false;
 297+ $this->params['iNameSpace'] = 0;
 298+
 299+ $this->params['useNameSpace'] = false;
 300+ $this->params['useCurId'] = false;
 301+
 302+ $this->params['suppressErrors'] = false;
 303+
 304+ $this->params['feed'] = 'atom';
 305+ $feedType = explode( '/', $par, 2);
 306+ switch( strtolower($feedType[0])){
 307+ case 'rss':
 308+ $this->params['feed'] = 'rss';
 309+ break;
 310+ case 'sitemap':
 311+ $this->params['feed'] = 'sitemap';
 312+ break;
 313+ default:
 314+ $this->params['feed'] = 'atom';
 315+ break;
 316+ }
 317+
 318+ $parser = new Parser;
 319+ $poptions = new ParserOptions;
 320+
 321+ foreach ( $params as $key=>$value ){
 322+ switch ( $key ){
 323+ case 'category':
 324+ $title = Title::newFromText( $parser->transformMsg( $value, $poptions ) );
 325+
 326+ if ( is_object( $title ) ){
 327+ $this->categories[] = $title;
 328+ }else{
 329+ echo "Explode on category.\n";
 330+ continue;
 331+ }
 332+ break;
 333+ case 'notcategory':
 334+ //echo "Got notcategory $value\n";
 335+ $title = Title::newFromText( $parser->transformMsg( $value, $poptions ) );
 336+ if ( is_object( $title ) )
 337+ $this->notCategories[] = $title;
 338+ else{
 339+ echo 'Explode on notCategory.';
 340+ continue;
 341+ }
 342+ break;
 343+ case 'namespace':
 344+ if ( $value == intval( $value ) ){
 345+ $this->params['iNameSpace'] = intval( $value );
 346+ if ( 0 <= $this->params['iNameSpace'] ){
 347+ $this->params['nameSpace'] = true;
 348+ }else{
 349+ $this->params['nameSpace'] = false;
 350+ }
 351+ }else{
 352+ $ns = $wgContLang->getNsIndex( $value );
 353+ if ( null !== $ns ){
 354+ $this->params['iNameSpace'] = $ns;
 355+ $this->params['nameSpace'] = true;
 356+ }
 357+ }
 358+ break;
 359+ case 'count':
 360+ if ( ( $this->wgDPLminResultCount < $value ) && ( $value < $this->wgDPLmaxResultCount ) ){
 361+ $this->params['count'] = intval( $value );
 362+ }
 363+ break;
 364+ case 'order';
 365+ switch ( $value ){
 366+ case 'ascending':
 367+ $this->params['order'] = 'ascending';
 368+ break;
 369+ case 'descending':
 370+ default:
 371+ $this->params['order'] = 'descending';
 372+ break;
 373+ }
 374+ break;
 375+ case 'ordermethod';
 376+ switch ( $value ){
 377+ case 'lastedit':
 378+ $this->params['orderMethod'] = 'lastedit';
 379+ break;
 380+ case 'categoryadd':
 381+ default:
 382+ $this->params['orderMethod'] = 'categoryadd';
 383+ break;
 384+ }
 385+ break;
 386+ case 'redirects';
 387+ switch ( $value ){
 388+ case 'include':
 389+ $this->params['redirects'] = 'include';
 390+ break;
 391+ case 'only':
 392+ $this->params['redirects'] = 'only';
 393+ break;
 394+ case 'exclude':
 395+ default:
 396+ $this->params['redirects'] = 'exclude';
 397+ break;
 398+ }
 399+ break;
 400+ case 'stablepages':
 401+ switch ( $value ){
 402+ case 'include':
 403+ $this->params['stable'] = 'include';
 404+ break;
 405+ case 'exclude':
 406+ $this->params['stable'] = 'exclude';
 407+ break;
 408+ case 'only':
 409+ default:
 410+ $this->params['stable'] = 'only';
 411+ break;
 412+ }
 413+ break;
 414+ case 'qualitypages':
 415+ switch ( $value ){
 416+ case 'include':
 417+ $this->params['quality'] = 'include';
 418+ break;
 419+ case 'only':
 420+ $this->params['quality'] = 'only';
 421+ break;
 422+ case 'exclude':
 423+ default:
 424+ $this->params['quality'] = 'exclude';
 425+ break;
 426+ }
 427+ break;
 428+ case 'suppresserrors':
 429+ // note: if previously set to true, remains true. malformed does not reset to false.
 430+ if ( 'true' == $value ) $this->params['suppressErrors'] = true;
 431+ break;
 432+ case 'usenamespace':
 433+ // note: if previously set to false, remains false. Malformed does not reset to true.
 434+ if ( 'false' == $value ) $this->params['useNameSpace'] = false;
 435+ break;
 436+ case 'usecurid':
 437+ // note: if previously set to true, remains true. Malformed does not reset to false.
 438+ if ( 'true' == $value ) $this->params['useCurId'] = true;
 439+ break;
 440+ default:
 441+ }
 442+ }
 443+
 444+ $this->params['catCount'] = count( $this->categories );
 445+ $this->params['notCatCount'] = count( $this->notCategories );
 446+ $totalCatCount = $this->params['catCount'] + $this->params['notCatCount'];
 447+
 448+ if (( $this->params['catCount'] < 1 && false == $this->params['nameSpace'] ) || ( $totalCatCount < $this->wgDPlminCategories )){
 449+ //echo "Boom on catCount\n";
 450+ $parser = new Parser;
 451+ $poptions = new ParserOptions;
 452+ $feed = Title::newFromText( $parser->transformMsg( 'Published', $poptions ) );
 453+ if ( is_object( $feed ) ){
 454+ $this->categories[] = $feed;
 455+ $this->params['catCount'] = count( $this->categories );
 456+ }else{
 457+ echo "\$feed is not an object.\n";
 458+ continue;
 459+ }
 460+ }
 461+
 462+ if ( ( $totalCatCount > $this->wgDPlmaxCategories ) && ( !$this->wgDPLallowUnlimitedCategories ) ){
 463+ $this->params['error'] = htmlspecialchars( wfMsg( 'intersection_toomanycats' ) ); // "!!too many categories!!";
 464+ }
 465+
 466+ //disallow showing date if the query doesn't have an inclusion category parameter
 467+ if ( $this->params['count'] < 1 )
 468+ $this->params['addFirstCategoryDate'] = false;
 469+
 470+ $this->params['dbr'] = wfGetDB( DB_SLAVE );
 471+ return;
 472+ }
 473+
 474+ function feedItemAuthor( $row ) {
 475+ return isset( $row->user_text ) ? $row->user_text : 'Wikinews';
 476+ }
 477+
 478+ function feedItemDesc( $row ) {
 479+ return isset( $row->comment ) ? htmlspecialchars( $row->comment ) : '';
 480+ }
 481+
 482+ function getKeywords ( $title ){
 483+ $cats = $title->getParentCategories();
 484+ $str = '';
 485+ #the following code is based (stolen) from r56954 of flagged revs.
 486+ $catMap = Array();
 487+ $catMask = Array();
 488+ $msg = wfMsg( 'gnsm_categorymap' );
 489+ if ( !wfEmptyMsg( 'gnsm_categorymap', $msg ) ) {
 490+ $list = explode( "\n*", "\n$msg");
 491+ foreach($list as $item) {
 492+ $mapping = explode('|', $item, 2);
 493+ if ( count( $mapping ) == 2 ) {
 494+ if ( trim( $mapping[1] ) == '__MASK__') {
 495+ $catMask[trim($mapping[0])] = true;
 496+ } else {
 497+ $catMap[trim($mapping[0])] = trim($mapping[1]);
 498+ }
 499+ }
 500+ }
 501+ }
 502+ foreach ( $cats as $key => $val ){
 503+ $cat = str_replace( '_', ' ', trim( substr( $key, strpos( $key, ':' ) + 1 ) ) );
 504+ if (!isset($catMask[$cat])) {
 505+ if (isset($catMap[$cat])) {
 506+ $str .= ', ' . str_replace( '_', ' ', trim ( $catMap[$cat] ) );
 507+ } else {
 508+ $str .= ', ' . $cat;
 509+ }
 510+ }
 511+ }
 512+ $str = substr( $str, 2 ); #to remove leading ', '
 513+ return $str;
 514+ }
 515+
 516+}
 517+
 518+/**
 519+ * FeedSitemapItem Class
 520+ **
 521+ * Base class for basic SiteMap support, for building url containers.
 522+ **/
 523+class FeedSitemapItem{
 524+ /**
 525+ * Var string
 526+ **/
 527+ var $url = '';
 528+ var $pubDate = '';
 529+ var $keywords = '';
 530+ var $lastMod = '';
 531+ var $priority = '';
 532+
 533+ function __construct( $url, $pubDate, $keywords = '', $lastMod = '', $priority = ''){
 534+ $this->url = $url;
 535+ $this->pubDate = $pubDate;
 536+ $this->keywords = $keywords;
 537+ $this->lastMod = $lastMod;
 538+ $this->priority = $priority;
 539+ }
 540+
 541+ public function xmlEncode( $string ){
 542+ $string = str_replace( "\r\n", "\n", $string );
 543+ $string = preg_replace( '/[\x00-\x08\x0b\x0c\x0e-\x1f]/', '', $string );
 544+ return htmlspecialchars( $string );
 545+ }
 546+
 547+ public function getUrl(){
 548+ return $this->url;
 549+ }
 550+
 551+ public function getPriority(){
 552+ return $this->priority;
 553+ }
 554+
 555+ public function getLastMod(){
 556+ return $this->lastMod;
 557+ }
 558+
 559+ public function getKeywords (){
 560+ return $this->xmlEncode( $this->keywords );
 561+ }
 562+
 563+ public function getPubDate(){
 564+ return $this->pubDate;
 565+ }
 566+
 567+ function formatTime( $ts ) {
 568+ // need to use RFC 822 time format at least for rss2.0
 569+ return gmdate( 'Y-m-d\TH:i:s', wfTimestamp( TS_UNIX, $ts ) );
 570+ }
 571+
 572+ /**
 573+ * Setup and send HTTP headers. Don't send any content;
 574+ * content might end up being cached and re-sent with
 575+ * these same headers later.
 576+ *
 577+ * This should be called from the outHeader() method,
 578+ * but can also be called separately.
 579+ *
 580+ * @public
 581+ **/
 582+ function httpHeaders() {
 583+ global $wgOut;
 584+ # We take over from $wgOut, excepting its cache header info
 585+ $wgOut->disable();
 586+ $mimetype = $this->contentType();
 587+ header( "Content-type: $mimetype; charset=UTF-8" );
 588+ $wgOut->sendCacheControl();
 589+
 590+ }
 591+
 592+ function outXmlHeader(){
 593+ global $wgStylePath, $wgStyleVersion;
 594+
 595+ $this->httpHeaders();
 596+ echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
 597+ }
 598+
 599+ /**
 600+ * Return an internet media type to be sent in the headers.
 601+ *
 602+ * @return string
 603+ * @private
 604+ **/
 605+ function contentType() {
 606+ global $wgRequest;
 607+ $ctype = $wgRequest->getVal('ctype','application/xml');
 608+ $allowedctypes = array('application/xml','text/xml','application/rss+xml','application/atom+xml');
 609+ return (in_array($ctype, $allowedctypes) ? $ctype : 'application/xml');
 610+ }
 611+
 612+}
 613+
 614+class SitemapFeed extends FeedSitemapItem{
 615+ /**
 616+ * Output feed headers
 617+ **/
 618+ function outHeader(){
 619+ $this->outXmlHeader();
 620+ ?>
 621+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
 622+ xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
 623+ <?php
 624+ }
 625+ /**
 626+ * Output a SiteMap 0.9 item
 627+ * @param FeedSitemapItem item to be output
 628+ **/
 629+ function outItem( $item ) {
 630+ ?>
 631+<url>
 632+<loc>
 633+ <?php print $item->getUrl() ?>
 634+</loc>
 635+<news:news>
 636+ <news:publication_date>
 637+ <?php print $item->getPubDate() ?>
 638+ </news:publication_date>
 639+ <?php if( $item->getKeywords() ){
 640+ echo '<news:keywords>' . $item->getKeywords() . "</news:keywords>\n";
 641+ }
 642+ ?>
 643+</news:news>
 644+ <?php if( $item->getLastMod() ){ ?>
 645+<lastmod>
 646+ <?php print $item->getLastMod(); ?>
 647+</lastmod>
 648+ <?php }?>
 649+ <?php if( $item->getPriority() ){ ?>
 650+<priority>
 651+ <? print $item->getPriority(); ?>
 652+</priority>
 653+ <?php }?>
 654+</url>
 655+ <?php
 656+ }
 657+
 658+ /**
 659+ * Output SiteMap 0.9 footer
 660+ **/
 661+ function outFooter(){
 662+ echo '</urlset>';
 663+ }
 664+
 665+}
Property changes on: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
___________________________________________________________________
Name: svn:eol-style
1666 + native
Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.i18n.php
@@ -0,0 +1,437 @@
 2+<?php
 3+/**
 4+ * Internationalisation file for extension special page GoogleNewsSitemap
 5+ * New version of DynamicPageList extension for use by Wikinews projects
 6+ *
 7+ * @addtogroup Extensions
 8+ **/
 9+
 10+$messages= array();
 11+
 12+/** English
 13+ * @author Amgine
 14+ **/
 15+
 16+$messages['en'] = array(
 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!',
 24+);
 25+
 26+/** Afrikaans (Afrikaans)
 27+ * @author Naudefj
 28+ */
 29+$messages['af'] = array(
 30+ 'gnsm' => 'Google Nuus Sitemap',
 31+ 'gnsm-desc' => 'Eksporteer \'n Atom/RSS-voer as \'n Google "News Sitemap"',
 32+ 'gnsm_toomanycats' => 'Fout: Te veel kategorieë!',
 33+ 'gnsm_toofewcats' => 'Fout: Te min kategorieë!',
 34+ 'gnsm_noresults' => 'Fout: Geen resultate!',
 35+ 'gnsm_noincludecats' => "Fout: U moet ten minste een kategorie insluit, of spesifiseer 'n naamspasie!",
 36+);
 37+
 38+/** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
 39+ * @author EugeneZelenko
 40+ * @author Jim-by
 41+ */
 42+$messages['be-tarask'] = array(
 43+ 'gnsm' => 'Мапа сайту Google News',
 44+ 'gnsm-desc' => 'Выводзіць стужкі Atom/RSS у выглядзе мапы сайту Google News',
 45+ 'gnsm_toomanycats' => 'Памылка: зашмат катэгорыяў!',
 46+ 'gnsm_toofewcats' => 'Памылка: занадта мала катэгорыяў!',
 47+ 'gnsm_noresults' => 'Памылка: няма вынікаў!',
 48+ 'gnsm_noincludecats' => 'Памылка: Вам неабходна дадаць хаця б адну катэгорыю, альбо пазначыць прастору назваў!',
 49+);
 50+
 51+/** Breton (Brezhoneg)
 52+ * @author Fulup
 53+ * @author Y-M D
 54+ */
 55+$messages['br'] = array(
 56+ 'gnsm' => "Steuñvenn lec'hienn Keleier Google",
 57+ 'gnsm-desc' => "Krouiñ a ra ul lanvad Atom/RSS evel steuñvenn ul lec'hienn Keleier Google",
 58+ 'gnsm_toomanycats' => 'Fazi : Re a rummadoù !',
 59+ 'gnsm_toofewcats' => 'Fazi : Re nebeut a rummadoù !',
 60+ 'gnsm_noresults' => "Fazi : Disoc'h ebet !",
 61+ 'gnsm_noincludecats' => "Fazi : Ret eo deoc'h merkañ ur rummad da nebeutañ, pe spisaat un esaouenn anv!",
 62+);
 63+
 64+/** Bosnian (Bosanski)
 65+ * @author CERminator
 66+ */
 67+$messages['bs'] = array(
 68+ 'gnsm' => 'Google News mapa stranice',
 69+ 'gnsm-desc' => 'Daje izlaz atom/RSS fida kao Google News mapa stranice',
 70+ 'gnsm_toomanycats' => 'Greška: Previše kategorija!',
 71+ 'gnsm_toofewcats' => 'Greška: Premalo kategorija!',
 72+ 'gnsm_noresults' => 'Greška: Nema rezultata!',
 73+ 'gnsm_noincludecats' => 'Greška: Morate uključiti najmanje jednu kategoriju ili navesti imenski prostor!',
 74+);
 75+
 76+/** Catalan (Català)
 77+ * @author Paucabot
 78+ */
 79+$messages['ca'] = array(
 80+ 'gnsm' => 'Mapa del lloc Google News',
 81+ 'gnsm_toomanycats' => 'Error: Massa categories!',
 82+ 'gnsm_toofewcats' => 'Error: Massa poques categories!',
 83+ 'gnsm_noresults' => 'Error: Cap resultat!',
 84+ 'gnsm_noincludecats' => "Error: Heu d'incloure almenys una categoria o especificar un espai de noms!",
 85+);
 86+
 87+/** German (Deutsch)
 88+ * @author Kghbln
 89+ */
 90+$messages['de'] = array(
 91+ 'gnsm' => 'Sitemap für Google News',
 92+ 'gnsm-desc' => 'Gibt Atom/RSS-Feeds in Form einer Sitemap für Google News aus.',
 93+ 'gnsm_toomanycats' => 'Fehler: Zu viele Kategorien!',
 94+ 'gnsm_toofewcats' => 'Fehler: Zu wenig Kategorien!',
 95+ 'gnsm_noresults' => 'Fehler: Keine Ergebnisse vorhanden!',
 96+ 'gnsm_noincludecats' => 'Fehler: Du musst mindestens eine Kategorie oder einen Namensraum angeben!',
 97+);
 98+
 99+/** Lower Sorbian (Dolnoserbski)
 100+ * @author Michawiki
 101+ */
 102+$messages['dsb'] = array(
 103+ 'gnsm' => 'Sedłowy pśeglěd Google Nowosći',
 104+ 'gnsm-desc' => 'Wudawa kanal Atom/RSS ako sedłowy pśeglěd Google Nowosći',
 105+ 'gnsm_toomanycats' => 'Zmólka: Pśewjele kategorijow!',
 106+ 'gnsm_toofewcats' => 'Zmólka: Pśemało kategorijow!',
 107+ 'gnsm_noresults' => 'Zmólka: Žedne wuslědki!',
 108+ 'gnsm_noincludecats' => 'Zmólka: Musyš nanejmjenjej jadnu kategoriju zapśěgnuś abo mjenjowy rum pódaś!',
 109+);
 110+
 111+/** Greek (Ελληνικά)
 112+ * @author Περίεργος
 113+ */
 114+$messages['el'] = array(
 115+ 'gnsm' => 'Χάρτης Ειδήσεων της Google',
 116+ 'gnsm-desc' => 'Βγάζει το Χάρτη Ειδήσεων της Google ως Atom/RSS',
 117+ 'gnsm_toomanycats' => 'Σφάλμα: Υπερβολικά πολλές κατηγορίες!',
 118+ 'gnsm_toofewcats' => 'Σφάλμα: Υπερβολικά λίγες κατηγορίες!',
 119+ 'gnsm_noresults' => 'Σφάλμα: Δεν υπάρχουν αποτελέσματα!',
 120+ 'gnsm_noincludecats' => 'Σφάλμα: Χρειάζεται να συμπεριλάβετε τουλάχιστον μια κατηγορία, ή να προσδιορίσετε μια περιοχή ονομάτων!',
 121+);
 122+
 123+/** Spanish (Español)
 124+ * @author Translationista
 125+ */
 126+$messages['es'] = array(
 127+ 'gnsm' => 'Mapa del sitio Google Noticias',
 128+ 'gnsm-desc' => 'Genera una fuenteAtom/RSS como un mapa de sitio de Google Noticias',
 129+ 'gnsm_toomanycats' => 'Error: ¡Demasiadas categorías!',
 130+ 'gnsm_toofewcats' => 'Error: ¡Muy pocas categorías!',
 131+ 'gnsm_noresults' => 'Error: ¡No hay resultados!',
 132+ 'gnsm_noincludecats' => 'Error: ¡Es necesario incluir al menos una categoría o especificar un espacio de nombres!',
 133+);
 134+
 135+/** Basque (Euskara)
 136+ * @author An13sa
 137+ */
 138+$messages['eu'] = array(
 139+ 'gnsm' => 'Google News Gunearen mapa',
 140+ 'gnsm-desc' => 'Atom/RSS iturria zehazten du Google News Gunearen maparentzat',
 141+ 'gnsm_toomanycats' => 'Errorea: Kategoria gehiegi!',
 142+ 'gnsm_toofewcats' => 'Errorea: Kategoria gutxiegi!',
 143+ 'gnsm_noresults' => 'Errorea: Emaitzarik ez!',
 144+ 'gnsm_noincludecats' => 'Errorea: Gutxienez kategoria bat gehitu edo izen bat zehaztu behar duzu!',
 145+);
 146+
 147+/** Finnish (Suomi)
 148+ * @author Centerlink
 149+ * @author Crt
 150+ */
 151+$messages['fi'] = array(
 152+ 'gnsm' => 'Google News -sivukartta',
 153+ 'gnsm-desc' => 'Tulostaa Atom/RSS-syötteen Google-uutissivukarttana',
 154+ 'gnsm_toomanycats' => 'Virhe: Liian monta luokkaa.',
 155+ 'gnsm_toofewcats' => 'Virhe: Liian vähän luokkia.',
 156+ 'gnsm_noresults' => 'Virhe: Ei tuloksia.',
 157+ 'gnsm_noincludecats' => 'Error: Lisää vähintään yksi luokka tai määritä nimiavaruus.',
 158+);
 159+
 160+/** French (Français)
 161+ * @author Amgine
 162+ * @author McDutchie
 163+ */
 164+$messages['fr'] = array(
 165+ 'gnsm' => 'Google nouvelles Sitemap',
 166+ 'gnsm-desc' => 'Cre un Atom ou RSS feed comme un plan Sitemap pour Google',
 167+ 'gnsm_toomanycats' => 'Erreur: Trop de nombreuses catégories!',
 168+ 'gnsm_toofewcats' => 'Erreur: Trop peu de catégories!',
 169+ 'gnsm_noresults' => 'Erreur: Pas de résultats!',
 170+ 'gnsm_noincludecats' => 'Erreur: Vous devez inclure au moins une catégorie, ou spécifier un espace de noms !',
 171+);
 172+
 173+/** Galician (Galego)
 174+ * @author Toliño
 175+ */
 176+$messages['gl'] = array(
 177+ 'gnsm' => 'Mapa do sitio das novas do Google',
 178+ 'gnsm-desc' => 'Dá como resultado unha fonte de novas Atom/RSS como un mapa do sitio das novas do Google',
 179+ 'gnsm_toomanycats' => 'Erro: hai moitas categorías!',
 180+ 'gnsm_toofewcats' => 'Erro: moi poucas categorías!',
 181+ 'gnsm_noresults' => 'Erro: non hai resultados!',
 182+ 'gnsm_noincludecats' => 'Erro: debe incluír, polo menos, unha categoría ou especificar un espazo de nomes!',
 183+);
 184+
 185+/** Swiss German (Alemannisch)
 186+ * @author Als-Holder
 187+ */
 188+$messages['gsw'] = array(
 189+ 'gnsm' => 'Google Nejigkeite Sytenibersicht',
 190+ 'gnsm-desc' => 'Liferet e Atom/RSS-feed as Google Nejigkeite Sytenibersicht',
 191+ 'gnsm_toomanycats' => 'Fähler: z vil Kategorie!',
 192+ 'gnsm_toofewcats' => 'Fähler: z wenig Kategorie!',
 193+ 'gnsm_noresults' => 'Fähler: kei Ergebnis!',
 194+ 'gnsm_noincludecats' => 'Fähler: muesch zmindescht ei Kategorii aagee oder e Namensruum feschtlege!',
 195+);
 196+
 197+/** Upper Sorbian (Hornjoserbsce)
 198+ * @author Michawiki
 199+ */
 200+$messages['hsb'] = array(
 201+ 'gnsm' => 'Sydłowa přehlad Google Nowinki',
 202+ 'gnsm-desc' => 'Wudawa kanal Atom/RSS jako sydłowy přehlad Google Nowinki',
 203+ 'gnsm_toomanycats' => 'Zmylk: Přewjele kategorijow!',
 204+ 'gnsm_toofewcats' => 'Zmylk: Přemało kategorijow!',
 205+ 'gnsm_noresults' => 'Zmylk: Žane wuslědki!',
 206+ 'gnsm_noincludecats' => 'Zmylk: Dyrbiš znajmjeńša jednu kategoriju zapřijeć abo mjenowy rum podać!',
 207+);
 208+
 209+/** Hungarian (Magyar)
 210+ * @author Glanthor Reviol
 211+ */
 212+$messages['hu'] = array(
 213+ 'gnsm' => 'Google hírek oldaltérkép',
 214+ 'gnsm-desc' => 'Atom/RSS hírcsatornát készít Google hírek oldaltérképként',
 215+ 'gnsm_toomanycats' => 'Hiba: túl sok kategória!',
 216+ 'gnsm_toofewcats' => 'Hiba: túl kevés kategória!',
 217+ 'gnsm_noresults' => 'Hiba: nincs találat!',
 218+ 'gnsm_noincludecats' => 'Hiba: legalább egy kategóriát vagy névteret meg kell adnod!',
 219+);
 220+
 221+/** Interlingua (Interlingua)
 222+ * @author McDutchie
 223+ */
 224+$messages['ia'] = array(
 225+ 'gnsm' => 'Sitemap de Google News',
 226+ 'gnsm-desc' => 'Converte un syndication Atom/RSS in un Sitemap de Google News',
 227+ 'gnsm_toomanycats' => 'Error: Troppo de categorias!',
 228+ 'gnsm_toofewcats' => 'Error: Non satis de categorias!',
 229+ 'gnsm_noresults' => 'Error: Nulle resultato!',
 230+ 'gnsm_noincludecats' => 'Error: Tu debe includer al minus un categoria, o specificar un spatio de nomines!',
 231+);
 232+
 233+/** Indonesian (Bahasa Indonesia)
 234+ * @author Iwan Novirion
 235+ * @author Kenrick95
 236+ */
 237+$messages['id'] = array(
 238+ 'gnsm' => 'Petasitus Baru Google',
 239+ 'gnsm-desc' => 'Hasil dari Atom/RSS feed sebagai Petasitus Baru Google',
 240+ 'gnsm_toomanycats' => 'Kesalahan: Terlalu banyak kategori!',
 241+ 'gnsm_toofewcats' => 'Kesalahan: Terlalu sedikit kategori!',
 242+ 'gnsm_noresults' => 'Kesalahan: Tidak ada hasil!',
 243+ 'gnsm_noincludecats' => 'Kesalahan: Anda perlu mencantumkan paling sedikit satu kategori, atau menyebutkan satu ruang nama!',
 244+);
 245+
 246+/** Italian (Italiano)
 247+ * @author Beta16
 248+ */
 249+$messages['it'] = array(
 250+ 'gnsm_toomanycats' => 'Errore: Numero di categorie eccessivo!',
 251+ 'gnsm_toofewcats' => 'Errore: Troppe poche categorie!',
 252+ 'gnsm_noresults' => 'Errore: Nessun risultato.',
 253+ 'gnsm_noincludecats' => 'Errore: È necessario includere almeno una categoria oppure specificare un namespace!',
 254+);
 255+
 256+/** Japanese (日本語)
 257+ * @author Hosiryuhosi
 258+ * @author Naohiro19
 259+ */
 260+$messages['ja'] = array(
 261+ 'gnsm' => 'Google ニュース サイトマップ',
 262+ 'gnsm-desc' => 'Google ニュースのサイトマップからAtom/RSSフィードを出力',
 263+ 'gnsm_toomanycats' => 'エラー: カテゴリが多すぎです!',
 264+ 'gnsm_toofewcats' => 'エラー:カテゴリが少なすぎです!',
 265+ 'gnsm_noresults' => 'エラー:結果はありません!',
 266+ 'gnsm_noincludecats' => 'エラー:少なくとも1つのカテゴリまたは名前空間を指定する必要があります!',
 267+);
 268+
 269+/** Luxembourgish (Lëtzebuergesch)
 270+ * @author Robby
 271+ */
 272+$messages['lb'] = array(
 273+ 'gnsm' => 'Google News Plang vum Site',
 274+ 'gnsm-desc' => 'Produzéiert en Atom/RSS feed als Google News Sitemap',
 275+ 'gnsm_toomanycats' => 'Feeler: Zevill Kategorien!',
 276+ 'gnsm_toofewcats' => 'Feeler: Ze wéineg Kategorien!',
 277+ 'gnsm_noresults' => 'Feeler: Keng Resultater!',
 278+ 'gnsm_noincludecats' => 'Feeler: Dir musst mindestens eng Kategorie oder een Nummraum drasetzen!',
 279+);
 280+
 281+/** Macedonian (Македонски)
 282+ * @author Bjankuloski06
 283+ */
 284+$messages['mk'] = array(
 285+ 'gnsm' => 'План на страницата Google Вести',
 286+ 'gnsm-desc' => 'Дава Atom/RSS канал како план на страницата Google Вести',
 287+ 'gnsm_toomanycats' => 'Грешка: Премногу категории!',
 288+ 'gnsm_toofewcats' => 'Грешка: Премалку категории!',
 289+ 'gnsm_noresults' => 'Грешка: Нема резултати!',
 290+ 'gnsm_noincludecats' => 'Грешка: Треба да вклучите барем една категорија, или да назначите именски простор!',
 291+);
 292+
 293+/** Dutch (Nederlands)
 294+ * @author Siebrand
 295+ */
 296+$messages['nl'] = array(
 297+ 'gnsm' => 'Google Nieuws Sitemap',
 298+ 'gnsm-desc' => 'Levert een Atom/RSS-feed als Google Nieuws Sitemap',
 299+ 'gnsm_toomanycats' => 'Fout: te veel categorieën!',
 300+ 'gnsm_toofewcats' => 'Fout: te weinig categorieën!',
 301+ 'gnsm_noresults' => 'Fout: geen resultaten!',
 302+ 'gnsm_noincludecats' => 'Fout: u moet tenminste een categorie of naamruimte opgeven!',
 303+);
 304+
 305+/** Norwegian Nynorsk (‪Norsk (nynorsk)‬)
 306+ * @author Harald Khan
 307+ */
 308+$messages['nn'] = array(
 309+ 'gnsm_toomanycats' => 'Feil: For mange kategoriar.',
 310+ 'gnsm_toofewcats' => 'Feil: For få kategoriar.',
 311+ 'gnsm_noresults' => 'Feil: Ingen resultat',
 312+ 'gnsm_noincludecats' => 'Feil: Du lyt inkludera minst éin kategori eller oppgje eit namnerom.',
 313+);
 314+
 315+/** Norwegian (bokmål)‬ (‪Norsk (bokmål)‬)
 316+ * @author Nghtwlkr
 317+ */
 318+$messages['no'] = array(
 319+ 'gnsm' => 'Nettstedskart for Google News',
 320+ 'gnsm-desc' => 'Gir ut en Atom/RSS-mating som et nettstedskart for Google News',
 321+ 'gnsm_toomanycats' => 'Feil: For mange kategorier!',
 322+ 'gnsm_toofewcats' => 'Feil: For få kategorier!',
 323+ 'gnsm_noresults' => 'Feil: Ingen resultat!',
 324+ 'gnsm_noincludecats' => 'Feil: Du må inkludere minst én kategori eller oppgi et navnerom!',
 325+);
 326+
 327+/** Polish (Polski)
 328+ * @author Sp5uhe
 329+ */
 330+$messages['pl'] = array(
 331+ 'gnsm_toomanycats' => 'Błąd – zbyt wiele kategorii!',
 332+ 'gnsm_toofewcats' => 'Błąd – zbyt mało kategorii!',
 333+ 'gnsm_noresults' => 'Błąd – brak wyników!',
 334+);
 335+
 336+/** Piedmontese (Piemontèis)
 337+ * @author Borichèt
 338+ * @author Dragonòt
 339+ */
 340+$messages['pms'] = array(
 341+ 'gnsm' => 'Pian dël sit dle Neuve ëd Google',
 342+ 'gnsm-desc' => 'A scriv un fluss Atom/RSS com pian dël Sit ëd le Neuve ëd Google',
 343+ 'gnsm_toomanycats' => 'Eror: Tròpe categorìe!',
 344+ 'gnsm_toofewcats' => 'Eror: Tròp pòche categorìe!',
 345+ 'gnsm_noresults' => 'Eror: pa gnun arzultà!',
 346+ 'gnsm_noincludecats' => 'Eror: A deuv anserì almanch na categorìa, o spessifiché në spassi nominal!',
 347+);
 348+
 349+/** Portuguese (Português)
 350+ * @author Hamilton Abreu
 351+ */
 352+$messages['pt'] = array(
 353+ 'gnsm' => 'Google News Sitemap',
 354+ 'gnsm-desc' => 'Converte um feed Atom/RSS para um Google News Sitemap',
 355+ 'gnsm_toomanycats' => 'Erro: Categorias a mais!',
 356+ 'gnsm_toofewcats' => 'Erro: Categorias a menos!',
 357+ 'gnsm_noresults' => 'Erro: Não há resultados!',
 358+ 'gnsm_noincludecats' => 'Erro: Tem de incluir pelo menos uma categoria, ou especificar um espaço nominal!',
 359+);
 360+
 361+/** Brazilian Portuguese (Português do Brasil)
 362+ * @author Daemorris
 363+ */
 364+$messages['pt-br'] = array(
 365+ 'gnsm' => 'Mapa de Site de Notícias Google',
 366+ 'gnsm-desc' => 'Produz um alimentador Atom/RSS como um Mapa de Site de Notícias Google',
 367+ 'gnsm_toomanycats' => 'Erro: Categorias demais!',
 368+ 'gnsm_toofewcats' => 'Erro: Categorias de menos!',
 369+ 'gnsm_noresults' => 'Erro: Sem resultados!',
 370+ 'gnsm_noincludecats' => 'Erro: Você precisa incluir pelo menos uma categoria, ou especificar um espaço nominal!',
 371+);
 372+
 373+/** Russian (Русский)
 374+ * @author Александр Сигачёв
 375+ */
 376+$messages['ru'] = array(
 377+ 'gnsm' => 'Карта сайта для Google News',
 378+ 'gnsm-desc' => 'Подготавливает канал Atom/RSS в виде карты сайта для Google News',
 379+ 'gnsm_toomanycats' => 'Ошибка. Слишком много категорий!',
 380+ 'gnsm_toofewcats' => 'Ошибка. Слишком мало категорий!',
 381+ 'gnsm_noresults' => 'Ошибка. Нет данных!',
 382+ 'gnsm_noincludecats' => 'Ошибка. Вы должны включить по меньшей мере одну категорию, или указать пространство имён!',
 383+);
 384+
 385+/** Swedish (Svenska)
 386+ * @author Per
 387+ */
 388+$messages['sv'] = array(
 389+ 'gnsm_toomanycats' => 'Fel: För många kategorier!',
 390+ 'gnsm_toofewcats' => 'Fel: För få kategorier!',
 391+ 'gnsm_noresults' => 'Fel: Inget resultat!',
 392+ 'gnsm_noincludecats' => 'Fel: Du måste inkludera minst en kategori eller specificera en namnrymd!',
 393+);
 394+
 395+/** Telugu (తెలుగు)
 396+ * @author Veeven
 397+ */
 398+$messages['te'] = array(
 399+ 'gnsm' => 'గూగుల్ వార్తల సైటుపటం',
 400+ 'gnsm_toomanycats' => 'పొరపాటు: చాలా ఎక్కువ వర్గాలు!',
 401+ 'gnsm_toofewcats' => 'పొరపాటు: చాలా తక్కువ వర్గాలు!',
 402+ 'gnsm_noresults' => 'పొరపాటు: ఫలితాలు లేవు!',
 403+);
 404+
 405+/** Thai (ไทย)
 406+ * @author Woraponboonkerd
 407+ */
 408+$messages['th'] = array(
 409+ 'gnsm_toomanycats' => 'เกิดความผิดพลาด: เลือกประเภทมากเกินไป!',
 410+ 'gnsm_toofewcats' => 'เกิดความผิดพลาด: เลือกประเภทน้อยเกินไป!',
 411+ 'gnsm_noresults' => 'เกิดความผิดพลาด: ไม่พบข้อมูล!',
 412+ 'gnsm_noincludecats' => 'เกิดความผิดพลาด: คุณต้องเลือกอย่างน้อยหนึ่งประเภท หรือกำหนด Namespace!',
 413+);
 414+
 415+/** Turkish (Türkçe)
 416+ * @author Joseph
 417+ */
 418+$messages['tr'] = array(
 419+ 'gnsm' => 'Google Haberler Site haritası',
 420+ 'gnsm-desc' => 'Bir Atom/RSS beslemesini Google Haberler Site haritası olarak çıktılar',
 421+ 'gnsm_toomanycats' => 'Hata: Çok fazla kategori!',
 422+ 'gnsm_toofewcats' => 'Hata: Çok az kategori!',
 423+ 'gnsm_noresults' => 'Hata: Sonuç yok!',
 424+ 'gnsm_noincludecats' => 'Hata: En az bir kategori girmeli, ya da bir ad alanı belirtmelisiniz!',
 425+);
 426+
 427+/** Simplified Chinese (‪中文(简体)‬)
 428+ * @author Gaoxuewei
 429+ */
 430+$messages['zh-hans'] = array(
 431+ 'gnsm' => 'Google 资讯站点地图',
 432+ 'gnsm-desc' => '输出一个Google 资讯站点地图的Atom/RSS文件',
 433+ 'gnsm_toomanycats' => '错误:分类过多!',
 434+ 'gnsm_toofewcats' => '错误:分类过少!',
 435+ 'gnsm_noresults' => '错误:没有结果!',
 436+ 'gnsm_noincludecats' => '错误:您需要包含至少一个分类,或者指定一个名称空间!',
 437+);
 438+
Property changes on: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.i18n.php
___________________________________________________________________
Name: svn:eol-style
1439 + native
Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.php
@@ -0,0 +1,68 @@
 2+<?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' );
 7+EOT;
 8+ exit( 1 );
 9+}
 10+
 11+/**
 12+ * Outputs feed xml
 13+ **
 14+ * A Special Page extension to produce:
 15+ * Google News sitemap output - http://www.google.com/support/news_pub/bin/answer.py?hl=en&answer=74288
 16+ * - http://www.sitemaps.org/protocol.php
 17+ * RSS feed output - 2.0 http://www.rssboard.org/rss-specification
 18+ * - 0.92 http://www.rssboard.org/rss-0-9-2
 19+ * Atom feed output - 2005 http://tools.ietf.org/html/rfc4287
 20+ **
 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][...]}}
 26+ **
 27+ * This program is free software; you can redistribute it and/or modify it
 28+ * under the terms of the GNU General Public License as published by the Free
 29+ * Software Foundation; either version 2 of the License, or (at your option)
 30+ * any later version.
 31+ *
 32+ * This program is distributed in the hope that it will be useful, but WITHOUT
 33+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 34+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 35+ * more details.
 36+ *
 37+ * You should have received a copy of the GNU General Public License along with
 38+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 39+ * Place - Suite 330, Boston, MA 02111-1307, USA.
 40+ * http://www.gnu.org/copyleft/gpl.html
 41+ **
 42+ * Contributors
 43+ * This script is based on Extension:DynamicPageList (Wikimedia), originally
 44+ * developed by:
 45+ * wikt:en:User:Amgine http://en.wiktionary.org/wiki/User:Amgine
 46+ * n:en:User:IlyaHaykinson http://en.wikinews.org/wiki/User:IlyaHaykinson
 47+ **
 48+ * FIXME requests
 49+ * use=Mediawiki:GoogleNewsSitemap_Feedname Parameter to allow on-site control of feed
 50+ **
 51+ * @addtogroup Extensions
 52+ *
 53+ * @author Amgine <amgine.saewyc@gmail.com>
 54+ * @copyright Copyright © 2009, Amgine
 55+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 56+ */
 57+$wgExtensionCredits['specialpage'][] = array(
 58+ 'path' => __FILE__,
 59+ 'name' => 'GoogleNewsSitemap',
 60+ 'author' => 'Amgine',
 61+ 'descriptionmsg' => 'gnsm-desc',
 62+ 'url' => 'http://www.mediawiki.org/wiki/Extension:GoogleNewsSitemap',
 63+);
 64+
 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+$wgSpecialPages['GoogleNewsSitemap'] = 'GoogleNewsSitemap';
Property changes on: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.php
___________________________________________________________________
Name: svn:eol-style
170 + native
Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.alias.php
@@ -0,0 +1,36 @@
 2+<?php
 3+/**
 4+ * Aliases for Special:GoogleNewsSitemap
 5+ *
 6+ * @addtogroup Extensions
 7+ */
 8+
 9+$aliases = array();
 10+
 11+/** English
 12+ * @author Amgine
 13+ **/
 14+$aliases['en'] = array(
 15+ 'GoogleNewsSitemap' => array( 'GoogleNewsSitemap' ),
 16+);
 17+
 18+/** Arabic (العربية) */
 19+$aliases['ar'] = array(
 20+ 'GoogleNewsSitemap' => array( 'خريطة_موقع_أخبار_جوجل' ),
 21+);
 22+
 23+/** Egyptian Spoken Arabic (مصرى) */
 24+$aliases['arz'] = array(
 25+ 'GoogleNewsSitemap' => array( 'خريطة_موقع_أخبار_جوجل' ),
 26+);
 27+
 28+/** Interlingua (Interlingua) */
 29+$aliases['ia'] = array(
 30+ 'GoogleNewsSitemap' => array( 'Mappa de sito Google News' ),
 31+);
 32+
 33+/** Malayalam (മലയാളം) */
 34+$aliases['ml'] = array(
 35+ 'GoogleNewsSitemap' => array( 'ഗൂഗിൾ‌‌വാർത്തകൾസൈറ്റ്മാപ്പ്' ),
 36+);
 37+
Property changes on: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.alias.php
___________________________________________________________________
Name: svn:eol-style
138 + native
Index: trunk/extensions/Translate/groups/mediawiki-defines.txt
@@ -497,8 +497,7 @@
498498 Google News Sitemap
499499 descmsg = gnsm-desc
500500 ignored = gnsm_categorymap
501 -file = GoogleNewsSitemap/SpecialGoogleNewsSitemap.i18n.php
502 -aliasfile = GoogleNewsSitemap/SpecialGoogleNewsSitemap.alias.php
 501+aliasfile = GoogleNewsSitemap/GoogleNewsSitemap.alias.php
503502
504503 Go To Category
505504

Status & tagging log