RSSFeedLinks


Proposed PHP code for a skin.php file:

## Place <meta> links to RSS and Atom feeds in the HTML Header.
##
## To enable the feeds, use the following in your local/config.php file:
##
##   if ($action == 'rss' || $action == 'atom') {
##     @include_once("$FarmD/scripts/feeds.php"); }
##
SDV($EnableSitewideFeed, FALSE);  # Link to Site/AllRecentChanges,
                                  # otherwise link to a group-specific feed
SDV($EnableRssLink, TRUE);
SDV($EnableAtomLink, TRUE);
global $HTMLHeaderFmt;
if (@$EnableSitewideFeed == TRUE) {
  $FeedSourcePath = '$SiteGroup/AllRecentChanges';
  $FeedTitleGroup = '';
} else {
  $FeedSourcePath = '$Group/RecentChanges';
  $FeedTitleGroup = ' : $Group -';
}
if ($EnableRssLink) {
  $HTMLHeaderFmt[rsslink] =
    "<link rel='alternate' title='\$WikiTitle$FeedTitleGroup RSS Feed'
      href='\$ScriptUrl/$FeedSourcePath?action=rss'
      type='application/rss+xml' />\n  ";
}
if ($EnableAtomLink) {
  $HTMLHeaderFmt[atomlink] =
    "<link rel='alternate' title='\$WikiTitle$FeedTitleGroup Atom Feed'
      href='\$ScriptUrl/$FeedSourcePath?action=atom'
      type='application/atom+xml' />\n  ";
}

An example set of links generated by this code:

  <link rel='alternate' title='Your Site : Main - RSS Feed'
      href='http://example.com/wiki/Main/RecentChanges?action=rss'
      type='application/rss+xml' />
  <link rel='alternate' title='Your Site : Main - Atom Feed'
      href='http://example.com/wiki/Main/RecentChanges?action=atom'
      type='application/atom+xml' />

The links result in, for example this Firefox Live Bookmark behavior:


 0: 00.00 00.00 config start
 1: 00.01 00.01 config end
 2: 00.21 00.20 MarkupToHTML begin
 3: 00.22 00.22 MarkupToHTML end
 4: 00.23 00.22 MarkupToHTML begin
 5: 00.24 00.23 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
 6: 00.24 00.23 ReadApprovedUrls SiteAdmin.ApprovedUrls end
 7: 00.25 00.24 MarkupToHTML end
 8: 00.25 00.24 MarkupToHTML begin
 9: 00.25 00.24 MarkupToHTML end
10: 00.25 00.24 now
Peak memory: 3,751,800 bytes