星联网络专注帝国CMS二次功能插件开发-精品网站模板站长代码素材

  • 最近更新
  • 模板:33
  • 记录:12640|
  • 插件:52|
  • 工具:4|
  • 代码:8|
  • 评论:0

DedeCMS RSS全站输出和订阅的说明

前言

本文主要讲解《DedeCMSRSS全站输出和订阅的说明》的详细内容

在论坛上看了很多贴子,但发现还是有些人不太会用。认为说明不够详细,以至于不能实现!我再来和大家说一下 首先,你新建一个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/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> <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.abc.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.abc.com[field:arcurl/]</guid> <description><![CDATA[[field:description function='html2text(@me)'/] ... <br /><b>文章分类</b>:[field:typename/]<br /><a href="http://www.abc.com[field:arcurl/]" target="_blank">阅读全文</a> | <a href="http://www.abc.com/plus/recommend.php?aid=[field:id/]" target="_blank">邮件推荐</a> | <a href="http://www.abc.com[field:arcurl/]" target="_blank">评论回复</a>]]></description> </item> {/dede:arclist} </channel> </rss> 如果你自己的站点使用时,请把拾穗网网址替换为你的网址即可。保存该文件与index.htm主页模板相同的目录下,登陆管理后台,清理一下缓存,更新下html就有了 --------------------------------------------- 以上是动态输入,要想变为静态输出的话还要按下面说的做。 第一步:打开 频道模型 下的 单页文档管理 点击 增加一个页面 按照上图去建个这样的单页面文件就行了,但是名字不能用“全站RSS静输出” 最好使用英文名字,自已可以随便起的,点一下保存其它的不要管它 最后更新一下缓存,最好在全站更新一下就行了 看一下演示吧 http://www.abc.com/rss.php http://www.abc.com/rss.xml rss的订阅 我是把dede中的原文件rssmap.html 重新做了一下,然后覆盖原始的文件 原始的文件在data文件夹中 下面提供一些热门的rss订阅代码供大家参考使用
<div class="indexContent"> 
<div><a href="http://www.google.com/reader/view/feed/http://www.abc.com/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_sub_google.gif" style="border:0px;" alt="通过Google订阅本站" /></a></div> 
<div><a href="http://www.zhuaxia.com/add_channel.php?url=www.abc.com/rss.xml" target="_blank" rel="nofollow"><img src="images/o_sub_zhuaxia.gif" style="border:0px;" alt="通过抓虾订阅本站" /></a></div> 
<div><a href="http://www.xianguo.com/subscribe.php?url=www.abc.com/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_sub_xianguo.gif" style="border:0px;" alt="通过鲜果订阅本站" /></a></div> 
<div><a href="http://www.abc.com/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_sub_hexun.gif" style="border:0px;" alt="通过和讯博揽订阅本站" /></a></div> 
<div><a href="http://add.my.yahoo.com/rss?url=www.abc.com/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_sub_myyahoo.gif" style="border:0px;" alt="通过雅虎订阅本站" /></a></div> 
<div><a href="http://reader.yodao.com/#url=http://www.abc.com/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_yodaoresbutton.gif" style="border:0px;" alt="通过有道订阅本站" /></a></div> 
<div><a href="http://www.bloglines.com/sub/http://www.abc.com/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_sub_bloglines.gif" style="border:0px;" alt="通过BlogLines订阅本站" /></a></div> 
</div>

本网刊登的文章均仅代表作者个人观点,并不代表本网立场。文中的论述和观点,敬请读者注意判断。

本文地址:http://www.xlkjgs.com/notes/web/8895.html

以上内容由本站整理呈现,请务必在转载分享时注明本文地址!如对内容有疑问,请联系我们,谢谢!

星联网络

星联网络是中国最具实战的互联网创业者的知识服务商,这里有互联网行业动态,网络推广,SEO优化,SEM优化,ESC配置,行业经验分型,互联网项目,微信营销、淘宝客赚钱、新媒体营销、京东运营、跨境电商等众多互联网营销知识分享

站长运营站长必备网站运营之道才能长久发展