[英]Custom RSS feed in Dokuwiki
I'm using Dokuwiki to populate a site with a known set of pages. 我正在使用Dokuwiki用一组已知的页面填充网站。 Say,
foo_1
through foo_9
. 说,
foo_1
到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: 我想按这些页面的特定顺序提供完整的RSS提要:
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
使用默认的联合项目是不可能的(它始终使用最新项目的排序顺序),因此我想我需要创建
feed.php
的自定义副本
The problem is, I'm not a good enough PHP developer to know what I need to change. 问题是,我不是一个足够优秀的PHP开发人员,我不知道需要更改什么。 In
feed.php
on line 134 the function rss_buildItems
looks like what I'd want to tweak. 在第134行的
feed.php
,功能rss_buildItems
看起来像我想要调整的内容。 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). 本质上,我想向其传递一个简单的项目数组,以正确的顺序列出(假设可以正常工作),然后删除收集信息的调用(在我看来,第288行的功能是
getRecents()
,但对此我也有些困惑)。 So, I would need: 因此,我需要:
If anybody could get me started, or has any other ideas that might be easier, I'd be most appreciative. 如果有人可以让我入门,或者有其他可能更轻松的想法,我将非常感激。
I solved this by making a copy of the file feed.php
, then taking line 288: 我通过复制文件
feed.php
来解决此问题,然后走第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. 似乎工作很棒。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.