装好dedecms后,点击左上角的rss功能,发现404错误,进入后台目录一看,发现rss文件就不存在,无奈,自己给dedecms添加rss订阅功能(代码来自网络,经检验正确!)
新建rss.php传到根目录:
<?php
require_once (dirname(__FILE__) . "/include/common.inc.php");
require_once DEDEINC."/arc.partview.class.php";
$pv = new PartView();
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/default/rssmap.htm");
header("Content-type:application/xml");
$pv->Display();
?>
新建rss.htm传至/templates/default目录下:
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
<title>{dede:global.cfg_webname/}</title>
<link>{dede:global.cfg_basehost/}</link>
<description>{dede:global.cfg_description/}</description>
<language>zh-cn</language>
<generator>{dede:global.cfg_webname/}</generator>
<webmaster>{dede:global.cfg_adminemail/}</webmaster>
{dede:arclist row='20' col='1' titlelen='100' orderby='pubdate'}
<item>
<link>http://www.zzvips.com[field:arcurl/]</link>
<title><![CDATA[[field:title function='html2text(@me)'/]]]></title>
<author>[field:writer/]</author>
<category>[field:typename/]</category>
<pubDate>[field:pubdate function='strftime("%a, %d %b %Y %H:%M:%S +0800",@me)'/]</pubDate>
<guid>http://www.zzvips.com[field:arcurl/]</guid>
<description><![CDATA[[field:description function='html2text(@me)'/] ... ]]></description>
</item>
{/dede:arclist}
</channel>
</rss>
把域名改成你的域名,另外在后台-》模板管理-》head.htm里卖弄修改rss链接为:http://域名/rss.php