織夢dedecms使用RSS訂閱整站的實現代碼,織夢技術
導讀:織夢技術織夢技術★織夢dedecms使用RSS訂閱整站的實現代碼★簡介: 織夢dedecms使用RSS訂閱整站的實現代碼 本文介紹下,dedecms織夢系統中,用rss實現全站織夢模板修改dede,模板。
織夢dedecms使用RSS訂閱整站的實現代碼
本文介紹下,dedecms織夢系統中,用rss實現全站訂閱的實現方法與代碼。有需要的朋友,參考下吧。 1,添加一個RSS模板,文件名為:rss_qq.htm,將RSS模板文件保存到/templets/plus/目錄下 <span style="font-family: 'courier new', courier; font-size: 13px;"><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" 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> &dede5.7模板lt;webmaster>{dede:global.cfg_adminemail/}</webmaster> {dede:arclist row='50' orderby='pubdate' titlelen='200'} <item> <title><![CDATA[[field:title/]]]></title> <link>[field:arcurl/]</link> <category>[field:typename/]</category> <pubdate>[field:pubdate function='strftime("%a,%d%b%Y%H:%M:%S +0800",@me)'/]</pubdate> <description><![CDATA[[field:array runphp='yes']@me = (strpos(@me['litpic'],'defaultpic') ? "": "<a [email=href='%7B@me[%22arcurl%22]%7D']href='{@me["arcurl"]}'[/email] target='_blank'><img [email=src='%7B@me[%22litpic%22]%7D']src='{@me["litpic"]}'[/email] border='0' /><br />"); [/field:array][field:description function='html2text(@me)'/] ... ]]></description> </item> {/dede:arclist} </channel> </rss> </span> 2,在根目錄中添加rss.php文件 <span style="font-family: 'courier new', courier; font-size: 13px;"><?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 . "/plus/rss_qq.htm"); header("Content-type:application/xml"); $pv->Display(); ?> </span> 3,在首頁index.htm模板的頭部標簽中添加屬性 <span style="font-family: 'courier new', courier; font-size: 13px;&織夢后臺模板quot;><link rel="alternate" type="application/rss+xml" title="{dede:field.title/}" href="http://www.g織夢模板網enban.org/rss.php"/> </span> 完成以上三步,即可實現DEDE的整站訂閱了,可以訪問你根目錄的rss.php文件看到效果,在使用QQlist時,只需要把 rss.php的路徑(就是 “http://www.genban.org/rss.php")填進去,就可以實現整站的訂閱了。 通過瀏覽器上的RSS源識別按鈕即可識別。或在網頁其它地方添加A標簽形式的訂閱鏈接。 默認情況下,最多調用50個最新的文章,不需要每次生成,只要有新文章,RSS就會更新。 以上就是本節dedecms教程的全部內容,希望可以幫助到大家。 相關織夢模板修改dede,模板。聲明: 本文由我的SEOUC技術文章主頁發布于:2023-07-20 ,文章織夢dedecms使用RSS訂閱整站的實現代碼,織夢技術主要講述標簽,代碼,織夢網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_31631.html