Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -1482,12 +1482,23 @@ |
1483 | 1483 | # Recent changes feed should appear on every page (except recentchanges, |
1484 | 1484 | # that would be redundant). Put it after the per-page feed to avoid |
1485 | 1485 | # changing existing behavior. It's still available, probably via a |
1486 | | - # menu in your browser. |
1487 | | - |
| 1486 | + # menu in your browser. Some sites might have a different feed they'd |
| 1487 | + # like to promote instead of the RC feed (maybe like a "Recent New Articles" |
| 1488 | + # or "Breaking news" one). For this, we see if $wgOverrideSiteFeed is defined. |
| 1489 | + # If so, use it instead. |
| 1490 | + |
| 1491 | + global $wgOverrideSiteFeed, $wgSitename; |
1488 | 1492 | $rctitle = SpecialPage::getTitleFor( 'Recentchanges' ); |
1489 | | - if ( $wgTitle->getPrefixedText() != $rctitle->getPrefixedText() ) { |
1490 | | - global $wgSitename; |
1491 | | - |
| 1493 | + |
| 1494 | + if ( isset( $wgOverrideSiteFeed['rss'] ) || isset( $wgOverrideSiteFeed['atom'] ) ) { |
| 1495 | + foreach ( $wgOverrideSiteFeed as $type => $feedUrl ) { |
| 1496 | + $tags[] = $this->feedLink ( |
| 1497 | + $type, |
| 1498 | + htmlspecialchars( $feedUrl ), |
| 1499 | + wfMsg( "site-{$type}-feed", $wgSitename ) ); |
| 1500 | + } |
| 1501 | + } |
| 1502 | + else if ( $wgTitle->getPrefixedText() != $rctitle->getPrefixedText() ) { |
1492 | 1503 | $tags[] = $this->feedLink( |
1493 | 1504 | 'rss', |
1494 | 1505 | $rctitle->getFullURL( 'feed=rss' ), |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2389,6 +2389,13 @@ |
2390 | 2390 | * pages larger than this size. */ |
2391 | 2391 | $wgFeedDiffCutoff = 32768; |
2392 | 2392 | |
| 2393 | +/** Override the site's default RSS/ATOM feed for recentchanges that appears on |
| 2394 | + * every page. Some sites might have a different feed they'd like to promote |
| 2395 | + * instead of the RC feed (maybe like a "Recent New Articles" or "Breaking news" one). |
| 2396 | + * Ex: $wgSiteFeed['format'] = "http://example.com/somefeed.xml"; Format can be one |
| 2397 | + * of either 'rss' or 'atom'. |
| 2398 | + */ |
| 2399 | +$wgOverrideSiteFeed = array(); |
2393 | 2400 | |
2394 | 2401 | /** |
2395 | 2402 | * Additional namespaces. If the namespaces defined in Language.php and |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -25,6 +25,9 @@ |
26 | 26 | empt all content namespaces.) |
27 | 27 | * $wgForwardSearchUrl has been removed entirely. Documented setting since 1.4 |
28 | 28 | has been $wgSearchForwardUrl. |
| 29 | +* (bug 15040) $wgOverrideSiteFeed has been added. Setting either $wgSiteFeed['rss'] |
| 30 | + or 'atom' to a URL will override the default Recent Changes feed that appears on |
| 31 | + all pages. |
29 | 32 | |
30 | 33 | === New features in 1.14 === |
31 | 34 | |