服务报价 | 域名主机 | 网络营销 | 软件工具| [加入收藏]
 热线电话: #
当前位置: 主页 > php教程 > dedecms教程 >

dedecms织梦怎么添加RSS订阅功能

时间:2016-02-03 11:06来源: 作者: 点击:
dedecms织梦订阅好像是现在很流行的字眼,很多人都会在网站上添加RSS订阅,如果你也想要在网站上添加一个RSS订阅功能的话,也可以来试试这种方法。 新建rss.php传到根目录: ?php req

dedecms织梦订阅好像是现在很流行的字眼,很多人都会在网站上添加RSS订阅,如果你也想要在网站上添加一个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.最模板zuimoban.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.最模板zuimoban.com[field:arcurl/]</guid>
<description><![CDATA[[field:description function='html2text(@me)'/] ... ]]></description>
</item>
{/dede:arclist}
</channel>
</rss>
在上传的时候把里面的www.最模板zuimoban.com换成你自己的域名,然后在后天的模板管理中找自己网站模板中的RSS链接换成http://你的域名/rss.php的形式,然后生成一次就可以看到效果了。

(责任编辑:最模板)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
栏目列表
热点内容