RSS full site static output and RSS subscription steps (dedecms)

Y2J
Release: 2017-04-25 15:50:08
Original
2344 people have browsed it

I read a lot of posts on the forum, but found that some people still don't know how to use it. Think the instructions are not detailed enough to make it possible! Let me tell you again. First, you create a new rss.php file and copy the following code into it:

The code is as follows:

<?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(); 
?>
Copy after login

Save the file to the root directory of the site.

Then, make an rss.htm template output file and copy the following code into it:

The code is as follows:

<?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=&#39;60&#39; col=&#39;1&#39; titlelen=&#39;100&#39; orderby=&#39;pubdate&#39;} <item> <link>http://www.jb51.net[field:arcurl/]</link> <title><![CDATA[[field:title function=&#39;html2text(@me)&#39;/]]]></title> <author>[field:writer/]</author> <category>[field:typename/]</category> <pubDate>[field:pubdate function=&#39;strftime("%a, %d %b %Y %H:%M:%S +0800",@me)&#39;/]</pubDate> <guid>http://www.jb51.net[field:arcurl/]</guid> <description><![CDATA[[field:description function=&#39;html2text(@me)&#39;/] ... <b>文章分类</b>:[field:typename/]<a href="http://www.jb51.net[field:arcurl/]" target="_blank">阅读全文</a> | <a href="http://www.jb51.net/plus/recommend.php?aid=[field:id/]" target="_blank">邮件推荐</a> | <a href="http://www.jb51.net[field:arcurl/]" target="_blank">评论回复</a>]]></description> 织梦好,好织梦 </item> {/dede:arclist} </channel> </rss>
Copy after login

If you use it on your own site, Please replace the URL with your own. Save this file in the same directory as the index.htm homepage template, log in to the management background, clear the cache, and update the html.
------------------- --------------------------
The above is dynamic input. If you want to change it to static output, you must do as follows
-------------------------------------
Step one: Open the channel model Single-page document management

Click to add a page

Just follow the picture above to create such a single-page document, but the name cannot be "full-site RSS static output". It is better to use an English name. You can choose it by yourself. Click to save and ignore the others.
Finally update the cache. It is best to update the entire site.
For rss subscription, I put the original file in dede rssmap.html was redone and then overwritten with the original file. The original file is in the data folder.
Some popular RSS subscription codes are provided below for your reference.

<p class="indexContent"> 
<p><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></p> 
<p><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></p>
Copy after login

Dream Weaver Content Management System

<p><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></p> 
<p><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></p>
Copy after login
<p><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></p>
Copy after login

This article comes from Dreamweaver

<p><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="border:0px;" alt="通过有道订阅本站" /></a></p> 
<p><a href="http://www.bloglines.com/sub/http://www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="images/rss/o_sub_bloglines.gif" style="border:0px;" alt="通过BlogLines订阅本站" /></a></p> </p>
Copy after login

The above is the detailed content of RSS full site static output and RSS subscription steps (dedecms). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
rss
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!