[pmwiki-users] Trouble with rss feeds

Ian MacGregor ardchoille42 at gmail.com
Mon Sep 3 01:38:56 CDT 2012

I'm using the Blog.RecentChanges page as a trail for an rss feed. My blog
posts are named 2012-09-02-PageNameHere.

My config.php contains this:

##  The feeds.php script enables ?action=rss, ?action=atom, ?action=rdf,
##  and ?action=dc, for generation of syndication feeds in various formats.
if ($action == 'rss')  include_once("scripts/feeds.php");  # RSS 2.0
# if ($action == 'atom') include_once("scripts/feeds.php");  # Atom 1.0
# if ($action == 'dc')   include_once("scripts/feeds.php");  # Dublin Core
# if ($action == 'rdf')  include_once("scripts/feeds.php");  # RSS 1.0

## Specify default feed options
if ($action == 'rss')
     SDVA($_REQUEST, array(
       'group' => 'Blog',
       'name' => '????-??-??-*',
       'order' => '-time'));

## Function to include the body text in the rss feed
function MarkupExcerpt($pagename) {
      $page = RetrieveAuthPage($pagename, 'read', false);
      return substr(@$page['text'], 0, 200);

## Add items to the feed
$FeedFmt['rss']['feed']['rights'] = 'All Rights Reserved';
$FeedFmt['rss']['item']['title'] = '{$Title}';
$FmtPV['$MarkupExcerpt'] = 'MarkupExcerpt($pn)';
$FeedFmt['rss']['item']['description'] = '$MarkupExcerpt';

Each blog page starts with:
(:title Blog Layout Update :)
(:Summary: Blog layout update :)
I've redesigned the blog layout to be easier to navigate. I've also added
archives so older blog entries will always be available.

The feed is working great except that it's also pulling in the top of each
page (:toc-float:) (:title Blog Layout Update :) (:Summary: Blog layout
update :), due to the MarkupExcerpt function,  and I don't want those in my
rss feed.

What do I need to do in order to have the rss feed not include things like
(:toc-float:) (:title Blog Layout Update :) (:Summary: Blog layout update
:) in the rss feed? I'm assuming I need to edit the Markup Excerpt function
in some way.
Ian MacGregor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20120902/786dae03/attachment.html>

More information about the pmwiki-users mailing list