zoukankan      html  css  js  c++  java
  • dedecms添加全站的rss订阅功能

    今天就是分享下如何为dedecms添加RSS订阅:

      1、将下面的代码以rssmap.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/rssmap.htm");  
    header("Content-type:application/xml");  
    $pv->Display();   ?>


        2、将下面的内容存为rssmap.htm,传至模板根目录default下。
     
    <?xml version="1.0" encoding="utf-8" ?>
     <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='20' col='1' titlelen='100' orderby='pubdate'}
                    <item>
                    <link>http://www.96seo.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.96seo.com[field:arcurl/]</guid>
                    <description><![CDATA[[field:description function='html2text(@me)'/] ... ]]></description>
                    </item>
                    {/dede:arclist}
                    </channel>
      </rss>


    PS:注意将上面的www.96seo.com换为自己的网址。
    更新下网站,你的网站RSS就是http://你的网站名字/rssmap.php。
    再在模板的 header.php中修改一下rss的路径为 http://你的网站名字/rss.php  ,如http://www.96seo.com/rssmap.php 就是泰州seo的 订阅页面,欢迎朋友们添加。

    清风明月本无价,近水远山皆有情。
  • 相关阅读:
    UEmacs/PK Keybindings
    ubunut install golang
    vyos ipsec l2tp simple experiment
    Lynx 命令行操作
    Linux开启路由转发功能
    PROTEUS的元器件及模型制作
    5G模拟网自动化测试的需求和挑战
    vyos site-to-site ipsec simple experiment
    kubeadm 搭建 k8s 时用到的常用命令汇总
    html 特殊符号标记
  • 原文地址:https://www.cnblogs.com/onlylove2015/p/4393583.html
Copyright © 2011-2022 走看看