[dokuwiki] Re: quick - syndication question - is specific $ID possible/practical?

  • From: Robin Getz <robin.getz@xxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 6 Jan 2011 17:49:23 -0500

On Thu 6 Jan 2011 17:18, Michael Hamann pondered:
> Hi,
> 
> Excerpts from Robin Getz's message of 2011-01-06 22:33:43 +0100:
> > I can see from http://www.dokuwiki.org/syndication, that I can look at the 
> > entire site, or specific namespace, but I couldn't figure out how to set
> > it up for a specific page...
> > 
> > From looking at feed.php - it doesn't seem to be possible today.
> 
> See http://bugs.dokuwiki.org/index.php?do=details&task_id=1607, the
> event(s) exist since 2009-11-10 ('FEED_MODE_UNKNOWN' and
> 'FEED_DATA_PROCESS'), but the documentation on dokuwiki.org seems to be
> missing. If nobody else is faster I'll add that documentation during the
> next days.

Thanks for the pointer.
Although I was hoping not to have to create a plugin for this - since it would 
(IMHO) seem like a pretty common thing to do for users.

> > I looked, and determined that it is since:
> > 
> > inc/changelog.php:_handleRecent() includes:
> > 
> >     // filter namespace
> >     if (($ns) && (strpos($recent['id'],$ns.':') !== 0)) return false;
> > 
> > if I'm looking for a specific page "foo:bar", nothing will
> > match "foo:bar:" 
> > 
> > If I change it to:
> > 
> > diff --git a/inc/changelog.php b/inc/changelog.php
> > index bb00df7..38bdefa 100644
> > --- a/inc/changelog.php
> > +++ b/inc/changelog.php
> > @@ -263,7 +263,7 @@ function _handleRecent($line,$ns,$flags,&$seen){
> >      if(isHiddenPage($recent['id'])) return false;
> > 
> >      // filter namespace
> > -    if (($ns) && (strpos($recent['id'],$ns.':') !== 0)) return false;
> > +    if (($ns) && (strpos($recent['id'],$ns) !== 0)) return false;
> > 
> > It does work - (I can subscribe to specific pages) - but I know that
> > is wrong, since it will also match "foo:bar*" --  I also wasn't sure 
> > what the expected results were for foo/bar.txt (the "bar" page),
> > and /foo/bar/baz.txt (the "bar" namespace).
> 
> I think we need a special mode for individual pages and although this is
> possible as action plugin I think it makes sense to include it in
> DokuWiki as it is the equivalent to "Old revisions". I think a different 
> mode makes sense because there are also changelog files for individual
> pages that should be used.

I'm have not dug into the changelog files yet, but I would think that my 
suggested change above would be OK if the ":" was added to the var higher up 
in the stack (like the caller to getRecentsSince, and getRecents - which will 
know if they want a namespace, or a page id...???

There are not that many.

getRecentsSince()
    * /lib/exe/xmlrpc.php ->  line 771
    * /lib/exe/xmlrpc.php -> line 804
    * /lib/exe/indexer.php -> line 362

getRecents()
    * /lib/plugins/revert/admin.php ->  line 135
    * /inc/html.php -> line 589
    * /inc/html.php -> line 592
    * /feed.php -> line 314

That should allow the page specific changelog files to be used if some changes 
were made to _handleRecent() (if page_exists($ns) {...} )

-- 
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: