[dokuwiki] RSS/ multiple ns

  • From: ll.snark@xxxxxxxxx
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 5 Nov 2011 16:03:31 +0100

Hi all,

I don't know if this is the right place to propose additionnal features to
dokuwiki...

I needed feed.php to use multiple namespaces (not a namespace and its
subnamespaces, but several namespaces at the same level).

The only changes needed seem to be in the file inc/changelog.php

Here is the diff output (the only modified function is in function
_handleRecent

278,281c278,288
<     if (($ns) && (strpos($recent['id'],$ns.':') !== 0)) return false;
<
<     // exclude subnamespaces
<     if (($flags & RECENTS_SKIP_SUBSPACES) && (getNS($recent['id']) !=
$ns)) return false;
---
>     $printme=false;
>     foreach (split(",",$ns) as $onens) {
>         $onens=trim($onens);
>         if ($flags & RECENTS_SKIP_SUBSPACES) {
>           if (getNS($recent['id']) == $onens) $printme=true;
>         }
>         else {
>           if (strlen($onens)==0 || strpos($recent['id'],$onens.':') ===
0) $printme=true;
>         }
>     }
>     if (!$printme) return false;


Now I can use feed.php this way :
feed.php?mode=recent&ns=stu,ens
and namespaces stu and ens will be processed (and items ordered by date,
not by namespace)

This does not work with the list or search mode as the corresponding
functions has not been changed.


Please let me know if my post is in the wrong place.

Other related posts:

  • » [dokuwiki] RSS/ multiple ns - ll . snark