tags:

views:

228

answers:

1

I'm using Dokuwiki to populate a site with a known set of pages. Say, foo_1 through foo_9. The content of those pages will change, but the names and locations never will.

I want to provide a full-content RSS feed in a particular order of just those pages:

foo_1
foo_2
foo_3
...
foo_9

Using the default syndication items it's not possible (it always uses the sort order of newest items at top), so I was thinking I'll need to create a customized copy of feed.php

The problem is, I'm not a good enough PHP developer to know what I need to change. In feed.php on line 134 the function rss_buildItems looks like what I'd want to tweak. Essentially, I'd like to pass it a simple array of the items to list in the correct order (assuming that would work), and then remove the call that gathers the information (that appears to me to be on line 288 the function getRecents(), but I'm a bit confused about that as well). So, I would need:

  1. The ID or other relevant page data for what I want to list.
  2. The format of the array.
  3. The lines to block out to stop the date-based method of listing.

If anybody could get me started, or has any other ideas that might be easier, I'd be most appreciative.

A: 

I solved this by making a copy of the file feed.php, then taking line 288:

$recents = getRecents(0,$opt['items'],$opt['namespace'],$flags);

And replacing it with something similar to this:

$recents = array(array(  "date" => "",
               "ip" =>  "::1", 
       "type" => "E",
       "id" => "foo",
       "user" => "user",
       "sum" => "",
       "extra" => "",
       "perms" => "1"
       ),
     array(  "date" => "",
       "ip" =>  "::1", 
       "type" => "E",
       "id" => "bar",
       "user" => "user",
       "sum" => "",
       "extra" => "",
       "perms" => "1"
      )       
       );

Seems to work great.

Martin McClellan