首先,添加一个RSS模板,文件名为:index_rss.htm,将这个RSS模板文件放到/templets/plus/目录下。文件内容为下面的代码:
<?xml version="1.0" encoding="{dede:global.cfg_soft_lang /}" ?><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='50' orderby='pubdate' titlelen='200'}<item><title><![CDATA[[field:title/]]]></title><link>[field:arcurl/]</link><category>[field:typename/]</category><pubdate>[field:pubdate function='strftime("%a,%d%b%Y%H:%M:%S +0800",@me)'/]</pubdate><description><![CDATA[[field:array runphp='yes']@me = (strpos(@me['litpic'],'defaultpic') ? "": "<a [email=href='%7B@me[%22arcurl%22]%7D']href='{@me["arcurl"]}'[/email] target='_blank'><img [email=src='%7B@me[%22litpic%22]%7D']src='{@me["litpic"]}'[/email] border='0' /><br />");[/field:array][field:description function='html2text(@me)'/] ... ]]></description></item>{/dede:arclist}</channel></rss>
<?phprequire_once (dirname(__FILE__) . "/include/common.inc.php");require_once DEDEINC."/arc.partview.class.php";$pv = new PartView();$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/plus/index_rss.htm");header("Content-type:application/xml");$pv->Display();?>
<link rel="alternate" type="application/rss+xml" title="{dede:global.cfg_webname/}" href="/rss.php"/>
如果本文对你有帮助,欢迎打赏本站