[pmwiki-users] WebFeeds recipe

Patrick R. Michaud pmichaud at pobox.com
Wed Feb 14 12:30:51 CST 2007


On Wed, Feb 14, 2007 at 05:39:55PM +0100, sgp wrote:
> Patrick R. Michaud wrote:
> 
> > Yes, the documentation is wrong.  Here's a version
> > that I _think_ will work:
> > 
> >     function MarkupExcerpt($pagename) {
> >       $page = RetrieveAuthPage($pagename, 'read', false);
> >       return substr(@$page['text'], 0, 200);
> >     }
> > 
> >     $FmtPV['$MarkupExcerpt'] = 'MarkupExcerpt($pn)';
> >     $FeedFmt['rss']['item']['description'] = '$MarkupExcerpt';
> > 
> 
> It's not working for me on 2.2beta31, in my local/News.Feed I added
> if ('Feed' == $name && $action == 'rss') {
>   include_once('scripts/feeds.php');   # RSS 2.0
>   function MarkupExcerpt($pagename) {
>     $page = RetrieveAuthPage($pagename, 'read', false);
>     return substr(@$page['text'], 0, 200);
>   }
>   $FmtPV['$MarkupExcerpt'] = 'MarkupExcerpt($pn)';
>   $FeedFmt['rss']['item']['description'] = '$MarkupExcerpt';
>   $FeedFmt['rss']['item']['title'] = '{*$Group} / {*$Title}';
> }
> 
> The I subscribed my feed aggregator to
> http://www.site.com/pmwiki/pmwiki.php?n=News.Feed?action=rss
> but the feed is empty (page News.Feed does have on entry).

 -- The code would need to go into local/News.Feed.php (note the 
    required .php extension).

 -- You don't need to check 'Feed' == $name, since we already know
    that this is the News.Feed page.  (And $name isn't pre-defined anyway,
    so the condition is likely failing.)

Pm



More information about the pmwiki-users mailing list