For MediaWiki (recent comments | status changes | tags | authors | states | release notes | statistics)
Index: trunk/phase3/includes/OutputPage.php =================================================================== --- trunk/phase3/includes/OutputPage.php (revision 38830) +++ trunk/phase3/includes/OutputPage.php (revision 38831) @@ -1482,12 +1482,23 @@ # Recent changes feed should appear on every page (except recentchanges, # that would be redundant). Put it after the per-page feed to avoid # changing existing behavior. It's still available, probably via a - # menu in your browser. - + # menu in your browser. Some sites might have a different feed they'd + # like to promote instead of the RC feed (maybe like a "Recent New Articles" + # or "Breaking news" one). For this, we see if $wgOverrideSiteFeed is defined. + # If so, use it instead. + + global $wgOverrideSiteFeed, $wgSitename; $rctitle = SpecialPage::getTitleFor( 'Recentchanges' ); - if ( $wgTitle->getPrefixedText() != $rctitle->getPrefixedText() ) { - global $wgSitename; - + + if ( isset( $wgOverrideSiteFeed['rss'] ) || isset( $wgOverrideSiteFeed['atom'] ) ) { + foreach ( $wgOverrideSiteFeed as $type => $feedUrl ) { + $tags[] = $this->feedLink ( + $type, + htmlspecialchars( $feedUrl ), + wfMsg( "site-{$type}-feed", $wgSitename ) ); + } + } + else if ( $wgTitle->getPrefixedText() != $rctitle->getPrefixedText() ) { $tags[] = $this->feedLink( 'rss', $rctitle->getFullURL( 'feed=rss' ), Index: trunk/phase3/includes/DefaultSettings.php =================================================================== --- trunk/phase3/includes/DefaultSettings.php (revision 38830) +++ trunk/phase3/includes/DefaultSettings.php (revision 38831) @@ -2389,6 +2389,13 @@ * pages larger than this size. */ $wgFeedDiffCutoff = 32768; +/** Override the site's default RSS/ATOM feed for recentchanges that appears on + * every page. Some sites might have a different feed they'd like to promote + * instead of the RC feed (maybe like a "Recent New Articles" or "Breaking news" one). + * Ex: $wgSiteFeed['format'] = "http://example.com/somefeed.xml"; Format can be one + * of either 'rss' or 'atom'. + */ +$wgOverrideSiteFeed = array(); /** * Additional namespaces. If the namespaces defined in Language.php and Index: trunk/phase3/RELEASE-NOTES =================================================================== --- trunk/phase3/RELEASE-NOTES (revision 38830) +++ trunk/phase3/RELEASE-NOTES (revision 38831) @@ -25,6 +25,9 @@ empt all content namespaces.) * $wgForwardSearchUrl has been removed entirely. Documented setting since 1.4 has been $wgSearchForwardUrl. +* (bug 15040) $wgOverrideSiteFeed has been added. Setting either $wgSiteFeed['rss'] + or 'atom' to a URL will override the default Recent Changes feed that appears on + all pages. === New features in 1.14 ===