Index: trunk/extensions/RSS/RSSParser.php |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | # Get a maximal length for item texts |
77 | 77 | if ( isset( $args['item-max-length'] ) ) { |
78 | 78 | $this->ItemMaxLength = $args['item-max-length']; |
79 | | - } elseif ( isset( $wgRSSItemMaxLength ) && is_numeric( $wgRSSItemMaxLength ) ) { |
| 79 | + } elseif ( is_numeric( $wgRSSItemMaxLength ) ) { |
80 | 80 | $this->ItemMaxLength = $wgRSSItemMaxLength; |
81 | 81 | } |
82 | 82 | |
— | — | @@ -328,6 +328,7 @@ |
329 | 329 | * @param $frame the frame param to pass to recursiveTagParse() |
330 | 330 | */ |
331 | 331 | function renderFeed( $parser, $frame ) { |
| 332 | + global $wgRSSTrackingCategory; |
332 | 333 | |
333 | 334 | $renderedFeed = ''; |
334 | 335 | |
— | — | @@ -352,6 +353,11 @@ |
353 | 354 | $renderedFeed = $this->sandboxParse( $renderedFeed ); |
354 | 355 | |
355 | 356 | } |
| 357 | + if ( $wgRSSTrackingCategory === true ) { |
| 358 | + $parser->addTrackingCategory( 'rss-tracking-category' ); |
| 359 | + } elseif ( is_string( $wgRSSTrackingCategory ) ) { |
| 360 | + $parser->addTrackingCategory( $wgRSSTrackingCategory ); |
| 361 | + } |
356 | 362 | |
357 | 363 | return $renderedFeed; |
358 | 364 | } |
Index: trunk/extensions/RSS/RSS.i18n.php |
— | — | @@ -14,6 +14,7 @@ |
15 | 15 | |
16 | 16 | $messages['en'] = array( |
17 | 17 | 'rss-desc' => 'Displays RSS feeds on MediaWiki pages in a standard or in user-definable formats using template pages', |
| 18 | + 'rss-tracking-category' => 'RSS', |
18 | 19 | 'rss-error' => 'Failed to load RSS feed from $1: $2', |
19 | 20 | 'rss-empty' => 'Failed to load RSS feed from $1!', |
20 | 21 | 'rss-fetch-nourl' => 'Fetch called without a URL!', |
— | — | @@ -35,6 +36,7 @@ |
36 | 37 | */ |
37 | 38 | $messages['qqq'] = array( |
38 | 39 | 'rss-invalid-url' => '$1 is the invalid URL for the RSS feed', |
| 40 | + 'rss-tracking-category' => 'The name of a category for all pages which use the <rss> parser extension tag. The category is automatically added unless the feature is disabled.', |
39 | 41 | 'rss-feed' => "; $1 |
40 | 42 | : ''not to be localised'' |
41 | 43 | : The RSS extension substitutes this placeholder with the name of a template page. The content of this template page determines the final layout of the RSS feed on the rendered wiki page. The Extension:RSS currently uses 'MediaWiki:Rss-feed' as default for $1. This means that the content of [[MediaWiki:Rss-feed]] determines how RSS feed items are rendered. |
Index: trunk/extensions/RSS/RSS.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | * |
6 | 6 | * @file |
7 | 7 | * @ingroup Extensions |
8 | | - * @version 2.12 |
| 8 | + * @version 2.14 |
9 | 9 | * @author mutante, Daniel Kinzler, Rdb, Mafs, Thomas Gries, Alxndr, Chris Reigrut, K001 |
10 | 10 | * @author Kellan Elliott-McCrea <kellan@protest.net> -- author of MagpieRSS |
11 | 11 | * @author Jeroen De Dauw |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | * @link http://www.mediawiki.org/wiki/Extension:RSS Documentation |
16 | 16 | */ |
17 | 17 | |
18 | | -define( "EXTENSION_RSS_VERSION", "2.12 20120307" ); |
| 18 | +define( "EXTENSION_RSS_VERSION", "2.14 20120309" ); |
19 | 19 | |
20 | 20 | if ( !defined( 'MEDIAWIKI' ) ) { |
21 | 21 | die( "This is not a valid entry point.\n" ); |
— | — | @@ -102,3 +102,16 @@ |
103 | 103 | // If you want to see images in feed items, then you need to globally allow |
104 | 104 | // image tags in your wiki by using the MediaWiki parameter; default: false |
105 | 105 | // $wgAllowImageTag = true; |
| 106 | + |
| 107 | +// Parameter to enable the automatic tracking category |
| 108 | +// for all pages using this parser extension |
| 109 | +// |
| 110 | +// Category name [[MediaWiki:Rss-tracking-category]] (default) |
| 111 | +// $wgRSSTrackingCategory = true; |
| 112 | +// |
| 113 | +// you can assign a specific category name [[MediaWiki:Rss-mycategory]] |
| 114 | +// $wgRSSTrackingCategory = 'rss-mycategory'; |
| 115 | +// |
| 116 | +// you can disable the use of a tracking category |
| 117 | +// $wgRSSTrackingCategory = false; |
| 118 | +$wgRSSTrackingCategory = true; |