dedecms RSS全站靜態輸出和RSS訂閱的步驟詳細解答
導讀:織夢教程織夢教程在論壇上看了很多貼子,但發現還是有些人不太會用。認為說明不夠詳細,以至于不能實現!我再來和大家說一下.模板織夢織夢的模板。
首先,你新建一個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.[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.[field:arcurl/]</guid> <description><![CDATA[[field:description function='html2text(@me)'/] ... <b>文章分類</b>:[field:typename/]<a href="http://www.[field:arcurl/]" target="_blank">閱讀全文</a> | <a href="http://www./plus/recommend.php?aid=[field:id/]" target="_blank">郵件推薦</a> | <a href="http://www.[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;" alt="通過Google訂閱本站" /></a></div> <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;" alt="通過抓蝦訂閱本站" /></a></div> 織夢內容管理系統 <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;" alt="通過鮮果訂閱本站" /></a></div> <div><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></div> <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;" alt="通過雅虎訂閱本站" /></a></div> 本文來自織夢 <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="borderdede,模板:0px;" alt="通過有道訂閱本站" /></a></div> <div><a href="http://www.bloglines.com/sub/http://www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src=https://img.genban.org&qdede5.7模板uot;images/rss/o_sub_bloglines.gif" style="border:0px;" alt="通過BlogLines訂閱本站" /></a></div> </div> 本文出自 “玩linux…做運維…沒事..” 博客,請務必保留此出處相關模板織夢織夢的模板。
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-07-21 ,文章dedecms RSS全站靜態輸出和RSS訂閱的步驟詳細解答主要講述全站,靜態,織夢網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_33343.html