本篇文档由[[http://www.ipsky.org|caii]]于2007年6月份陆续翻译而成。 ====== XML 合成 ====== [[DokuWiki]]通过[[this>feed.php]]文件,可将一些数据制成XML种子。 ===== 参数 ===== 如何产生这种种子,受各种URL参数的影响。 ^ 参数 ^ 有效值 ^ 默认值 ^ 描述 ^ | 类型 | rss, rss1, rss2, atom, atom1 | rss1 | 这是种子使用的文档类型 | | 模式 | recent, list | recent | 应该输出什么:[[recent_changes|最近更改]]或者文档列表? | | num | //任何整数// | [[config:recent|最近的]] 选项 | 应该包括多少项目?(列表模式中忽略该参数)| | ns | //a [[namespace]]// | * | 输出哪个命名空间? | | linkto | page, rev, diff | diff | 项目链接到哪里? | | minor | true,false | false | 是否显示微小变化? | 要注意,[[config:recent|最近变化]] 是"num"参数的默认值,不是最大值。用户可以给"num"输入任何的高值。但是,[[recent_changes|最近更改]]仅仅列出每个页面的最新更改,所以结果数限制在由"us"指定的命名空间文档数目。((见[[http://forum.dokuwiki.org/post/3092|本论坛的帖子]]。)) [[config:recent]]选项制定"mode"="list"返回的结果数((见[[http://forum.dokuwiki.org/post/3092|本论坛的帖子]]。)) ===== 例子===== * [[this>feed.php?type=rss2&num=5]]返回5项最近修改的[[http://backend.userland.com/rss|RSS 2.0]]种子。 * [[this>feed.php?mode=list&type=atom&linkto=page&ns=wiki]]列出wiki命名空间的所有页面,作为所有项目都直接链接到页面的[[http://intertwingly.net/wiki/pie/FrontPage|ATOM 0.3]] 种子。 ===== 用户名/密码 ===== 在启用[[ACL]]并限制页面由授权用户查看时,请记住必须给RSS阅读器传递用户名和密码,例如: %%''http://example.com/dokuwiki/feed.php?u=username&p=password''%% 否则,RSS阅读器将因为这些查看限制,而不能显示任何最新的更改或者列出属于受限命名空间的文档。 ===== FEED生成器 ===== 可使用优秀的由Kai Blankenhorn开发的[[http://www.bitfolge.de/rsscreator-en.html|Feed Creator Class]]来实现XML合同功能。 The XML Syndication feature was implemented by using the excellent by Kai Blankenhorn. 要注意:如果你想要RSS FEED的时间戳是正确的,你必须编辑文件 .../inc/feedcreator.class.php 来设置你的时区偏移量,在文件大约150行处: *************************************************************************** * A little setup * **************************************************************************/ // your local timezone, set to "" to disable or for GMT ''define("TIME_ZONE","+01:00");'' Note: As of the 2006-11-06 release, DokuWiki will automatically detect the timezone. :-o ===== Question ===== RSS doesn't work with my wiki. When RSS icon is clicked, it goes to the feed.php page but there is no content. It just says "This topic does not exist yet". I'm lost. Please help. Thanks. (clockwork) its the same with me... isn`t there a way to simply get an *.rss out of my wiki, or am i too stupid to find the manual somewhere round here? > Did you guys probably misconfigure your rewrite-rules? So it tries to find a page called "feed.php"? Try turning off rewriting in .htaccess to see wheter this is your problem. > It would be nice to have the possibility of replacing the underscores by blanks. At the moment, quiet long rss entries are generated which can make problems with rss viewers/plugins which do not break the pageID into different lines. Is passing the username and password (&u=...&p=...) on the feed url a security problem? Or am I missing something? Does the syndication protocol encrypt these requests by default? The feeds don't work with Google Reader :-?:-x