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.00 config end
 2: 00.12 00.11 MarkupToHTML begin
 3: 00.13 00.12 MarkupToHTML end
 4: 00.14 00.12 MarkupToHTML begin
 5: 00.15 00.13 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
 6: 00.15 00.14 ReadApprovedUrls SiteAdmin.ApprovedUrls end
 7: 00.16 00.14 MarkupToHTML end
 8: 00.16 00.14 MarkupToHTML begin
 9: 00.16 00.14 MarkupToHTML end
10: 00.17 00.15 now
Peak memory: 3,400,552 bytes