本文主要讲解《dedecmss如何添加RSS订阅功能》的详细内容
添加代码如下:
<?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/rss.htm"); header("Content-type:application/xml"); $pv->Display(); ?> 4、进入主题目录:/templates/default,新建rss.htm 添加代码如下:
<?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>[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>[field:arcurl/]</guid> <description><![CDATA[[field:description function='html2text(@me)'/]...]]></description> </item> {/dede:arclist} </channel> </rss>5、登陆dedecmss管理后台,模板管理,head.htm,将里面RSS链接修改为: http://www.dede58.com/rss.php(根据自己的域名替换) 织梦58相关文章推荐阅读:DEDECMS自定义表单如何限制垃圾信息同IP24小时只能发布一次DEDECMS文章添加跳转属性后打开出现空白的BUG解决方法DEDECMS采集文档审核后生成文档以采集时间显示
本网刊登的文章均仅代表作者个人观点,并不代表本网立场。文中的论述和观点,敬请读者注意判断。
2021-02-08
2021-02-24
2021-02-24
2021-02-08
2021-02-08
2021-02-08
2021-02-08
2021-02-08