代码以下:
<?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(); ?>
保留该文件到站点根目录下。
然后,再制造一个rss.htm模板输出文件,把下面的代码拷贝到个中:
代码以下:
<?xml version="1.0" encoding="gb2312" ?> <rss version="2.0"> <channel> <title>{dede:global.cfg_webname/}</title> <link>{dede:global.cfg_basehost/}</link> <description>{dede:global.cfg_description/}</description> copyright dedecms <language>zh-cn</language> <generator>{dede:global.cfg_webname/}</generator> <webmaster>{dede:global.cfg_adminemail/}</webmaster> {dede:arclist row='60' col='1' titlelen='100' orderby='pubdate'} <item> <link>http://www.jb51.net[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.jb51.net[field:arcurl/]</guid> <description><![CDATA[[field:description function='html2text(@me)'/] ... <b>文章分类</b>:[field:typename/]<a href="http://www.jb51.net[field:arcurl/]" target="_blank">浏览全文</a> | <a href="http://www.jb51.net/plus/recommend.php?aid=[field:id/]" target="_blank">邮件引荐</a> | <a href="http://www.jb51.net[field:arcurl/]" target="_blank">批评复兴</a>]]></description> 织梦好,好织梦 </item> {/dede:arclist} </channel> </rss>
假如你本身的站点运用时,请把网址替换为你的网址即可。保留该文件与index.htm主页模板雷同的目录下,上岸治理背景,清算一下缓存,更新下html就有了
---------------------------------------------
以上是动态输入,要想变成静态输出的话还要按下面说的做
--------------------------------------
第一步:翻开 频道模子 下的 单页文档治理
点击 增添一个页面
根据上图去建个如许的单页面文件就好了,然则名字不能用“全站RSS静输出” 最好运用英文名字,自已能够随意起的,点一下保留别的的不要管它
末了更新一下缓存,最幸亏全站更新一下就好了
rss的定阅 我是把dede中的原文件rssmap.html 从新做了一下,然后掩盖原始的文件 原始的文件在data文件夹中
下面供应一些热点的rss定阅代码供人人参考运用
<p class="indexContent"> <p><a href="http://www.google.com/reader/view/feed/http://www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_sub_google.gif" style="border:0px;" alt="经由过程Google定阅本站" /></a></p> <p><a href="http://www.zhuaxia.com/add_channel.php?url=www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="images/o_sub_zhuaxia.gif" style="border:0px;" alt="经由过程抓虾定阅本站" /></a></p>
织梦内容治理体系
<p><a href="http://www.xianguo.com/subscribe.php?url=www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_sub_xianguo.gif" style="border:0px;" alt="经由过程鲜果定阅本站" /></a></p> <p><a href="http://www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_sub_hexun.gif" style="border:0px;" alt="经由过程和讯博揽定阅本站" /></a></p>
<p><a href="http://add.my.yahoo.com/rss?url=www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_sub_myyahoo.gif" style="border:0px;" alt="经由过程雅虎定阅本站" /></a></p>
本文来自织梦
<p><a href="http://reader.yodao.com/#url=http://www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_yodaoresbutton.gif" style="border:0px;" alt="经由过程有道定阅本站" /></a></p> <p><a href="http://www.bloglines.com/sub/http://www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_sub_bloglines.gif" style="border:0px;" alt="经由过程BlogLines定阅本站" /></a></p> </p>
以上就是RSS全站静态输出和RSS定阅的步骤(dedecms)的细致内容,更多请关注ki4网别的相干文章!