在論壇上看了很多貼子,但發(fā)現(xiàn)還是有些人不太會用。認(rèn)為說明不夠詳細(xì),以至于不能實現(xiàn)!我再來和大家說一下
首先,你新建一個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">評論回復(fù)</a>]]></description>
</item>
{/dede:arclist}
</channel>
</rss>
如果你自己的站點使用時,請把拾穗網(wǎng)網(wǎng)址替換為你的網(wǎng)址即可。保存該文件與index.htm主頁模板相同的目錄下,登陸管理后臺,清理一下緩存,更新下html就有了
---------------------------------------------
以上是動態(tài)輸入,要想變?yōu)殪o態(tài)輸出的話還要按下面說的做。
第一步:打開 頻道模型 下的 單頁文檔管理
點擊 增加一個頁面
按照上圖去建個這樣的單頁面文件就行了,但是名字不能用“全站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>