Dokuwiki 中的自定义 RSS 提要

发布于 2024-08-02 04:26:55 字数 708 浏览 1 评论 0原文

我正在使用 Dokuwiki 用一组已知的页面填充网站。比如说,foo_1foo_9。这些页面的内容会改变,但名称和位置永远不会改变。

我想以这些页面的特定顺序提供完整内容的 RSS 提要:

foo_1
foo_2
foo_3
...
foo_9

使用默认联合项目 这是不可能的(它总是使用顶部最新项目的排序顺序),所以我想我需要创建 feed.php 的自定义副本

问题是,我不是一个足够优秀的 PHP 开发人员,不知道我需要更改什么。在 feed.php 的第 134 行,函数 rss_buildItems 看起来像我想要调整的内容。本质上,我想向它传递一个简单的项目数组,以正确的顺序列出(假设这可行),然后删除收集信息的调用(在我看来,函数 < code>getRecents(),但我对此也有点困惑)。因此,我需要:

  1. 我想要列出的内容的 ID 或其他相关页面数据。
  2. 数组的格式。
  3. 封锁的行以停止基于日期的列出方法。

如果有人能让我开始,或者有任何其他可能更容易的想法,我将不胜感激。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回忆躺在深渊里 2024-08-09 04:26:55

我通过复制文件 feed.php 解决了这个问题,然后取出第 288 行:

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

并将其替换为与此类似的内容:

$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"
                     )                  
                 ); 

似乎效果很好。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文