dedecms添加rss订阅功能实现代码
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>装好dedecms后,点击左上角的rss功能,发现404错误,进入后台目录一看,发现rss文件就不存在,无奈,自己给dedecms添加rss订阅功能(代码来自网络,经检验正确!) <br>
新建rss.php传到根目录: <br>
</p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<div class="right">
<span><u>复制代码</u></span>
</div>
<p>
代码如下:</p>
</div>
<div class="msgborder" id="phpcode10" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
<?php <br>
require_once (dirname(__FILE__) . "/include/common.inc.php"); <br>
require_once DEDEINC."/arc.partview.class.php"; <br>
$pv = new PartView(); <br>
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/default/rssmap.htm"); <br>
header("Content-type:application/xml"); <br>
$pv->Display(); <br>
?> </div>
<p>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>新建rss.htm传至/templates/default目录下: </span></p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<div class="right">
<span><u>复制代码</u></span>
</div>
<p>
代码如下:</p>
</div>
<div class="msgborder" id="phpcode11" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
<?xml version="1.0" encoding="utf-8" ?> <br>
<rss version="2.0"> <br>
<channel> <br>
<title>{dede:global.cfg_webname/}</title> <br>
<link>{dede:global.cfg_basehost/}</link> <br>
<description>{dede:global.cfg_description/}</description> <br>
<language>zh-cn</language> <br>
<generator>{dede:global.cfg_webname/}</generator> <br>
<webmaster>{dede:global.cfg_adminemail/}</webmaster> <br>
{dede:arclist row='20' col='1' titlelen='100' orderby='pubdate'} <br>
<item> <br>
<link>http://www.jb51.net</link> <br>
<title><!]]></title> <br>
<author></author> <br>
<category></category> <br>
<pubDate></pubDate> <br>
<guid>http://www.jb51.net</guid> <br>
<description><! ... ]]></description> <br>
</item> <br>
{/dede:arclist} <br>
</channel> <br>
</rss> </div>
<p>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>把域名改成你的域名,另外在后台-》模板管理-》head.htm里卖弄修改rss链接为:http://域名/rss.php</span></p>
頁:
[1]