[pmwiki-users] pmwiki-2.1.beta14 released, improved RSS and Atom feeds

Patrick R. Michaud pmichaud at pobox.com
Tue Dec 13 08:03:31 CST 2005


On Tue, Dec 13, 2005 at 11:24:38AM +0100, Roman wrote:
> > The new script is highly configurable, new elements can be easily
> > added to feeds via the $FeedFmt array.  Elements in $FeedFmt look like
> >
> >        $FeedFmt['atom']['feed']['rights'] = 'All Rights Reserved';
> 
> Is there a way how to customize feeds to use change summary as an item
> <description> instead of first 600 characters of of page contents?
> $ChangeSummary seems to be undefined when generating feed.

Since the change summaries are considered part of the history,
obtaining a change summary (currently) requires reading the last
history entry from the pagestore.  So:

    $FeedFmt['rss']['item']['description'] = 'FeedChangeSum';

    function FeedChangeSum($pagename, &$page, $tag) {
      $last = $page['time'];
      $p = ReadPage($pagename, $last);
      $csum = htmlspecialchars(@$p["csum:$last"]);
      if (!$csum) return '';
      return "<$tag>$csum</$tag>";
    }

Pm




More information about the pmwiki-users mailing list