加入收藏 | 设为首页 | 会员中心 | 我要投稿 牡丹江站长网 (https://www.0453zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > 建站资源 > 经验 > 正文

dedecms RSS全站静态输出和RSS订阅的步骤具体解答

发布时间:2022-06-04 14:44:36 所属栏目:经验 来源:互联网
导读:你新建一个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_templ
        你新建一个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>
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.cuoxin.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.cuoxin.com[field:arcurl/]</guid>
<description><![CDATA[[field:description function='html2text(@me)'/] ...
<b>文章分类</b>:[field:typename/]
<a href="http://www.cuoxin.com[field:arcurl/]" target="_blank">阅读全文</a> | <a href="http://www.cuoxin.com/plus/recommend.php?aid=[field:id/]" target="_blank">邮件推荐</a> | <a href="http://www.cuoxin.com[field:arcurl/]" target="_blank">评论回复</a>]]></description>
织梦好,好织梦
</item>
{/dede:arclist}
</channel>
</rss>
 
如果你自己的站点使用时,请把网址替换为你的网址即可。保存该文件与index.htm主页模板相同的目录下,登陆管理后台,清理一下缓存,更新下html就有了
---------------------------------------------
以上是动态输入,要想变为静态输出的话还要按下面说的做
--------------------------------------
第一步:打开 频道模型 下的 单页文档管理
 
点击 增加一个页面
 
按照上图去建个这样的单页面文件就行了,但是名字不能用“全站RSS静输出” 最好使用英文名字,自已可以随便起的,点一下保存其它的不要管它
 
最后更新一下缓存,最好在全站更新一下就行了
rss的订阅 我是把dede中的原文件rssmap.html 重新做了一下,然后覆盖原始的文件 原始的文件在data文件夹中
下面提供一些热门的rss订阅代码供大家参考使用
<div class="indexContent">
<div><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;" /><div><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;" />织梦内容管理系统
 
<div><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;" /><div><a href="http://www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_sub_hexun.gif" style="border:0px;" /><div><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;" />本文来自织梦
<div><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;" /><div><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;" />本文出自 “玩linux…做运维…没事..” 博客,请务必保留此出处.

(编辑:牡丹江站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!