Home Backend Development XML/RSS Tutorial RSS full site static output and RSS subscription steps (dedecms)

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

Apr 25, 2017 pm 03:50 PM
rss

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to use PHP and XML to implement RSS subscription management and display on the website How to use PHP and XML to implement RSS subscription management and display on the website Jul 29, 2023 am 10:09 AM

How to use PHP and XML to implement RSS subscription management and display on a website. RSS (Really Simple Syndication) is a standard format for publishing frequently updated blog posts, news, audio and video content. Many websites provide RSS subscription functions, allowing users to easily obtain the latest information. In this article, we will learn how to use PHP and XML to implement the RSS subscription management and display functions of the website. First, we need to create an RSS subscription to XM

PHP application: Get rss subscription content through function PHP application: Get rss subscription content through function Jun 20, 2023 pm 06:25 PM

With the rapid development of the Internet, more and more websites have begun to provide RSS subscription services, allowing users to easily obtain updated content from the website. As a popular server-side scripting language, PHP has many functions for processing RSS subscriptions, allowing developers to easily extract the required data from RSS sources. This article will introduce how to use PHP functions to obtain RSS subscription content. 1. What is RSS? The full name of RSS is "ReallySimpleSyndication" (abbreviated

How to write a simple RSS subscriber via PHP How to write a simple RSS subscriber via PHP Sep 25, 2023 pm 07:05 PM

How to write a simple RSS subscriber through PHP RSS (ReallySimpleSyndication) is a format used to subscribe to website content. Through the subscriber, you can get the latest articles, news, blogs and other updates. In this article, we will write a simple RSS subscriber using PHP to demonstrate how to obtain and display the content of an RSS feed. Confirm environment and preparation Before starting, make sure you have a PHP environment and have the SimpleXML extension installed.

How to use PHP to implement RSS subscription function How to use PHP to implement RSS subscription function Sep 05, 2023 pm 04:43 PM

How to use PHP to implement RSS subscription function RSS (ReallySimpleSyndication) is a format used to publish and subscribe to website updated content. Using RSS, users can easily obtain the latest information from websites that interest them without having to visit the website regularly. In this article, we will learn how to implement RSS subscription functionality using PHP. First, we need to understand the basic structure of RSS. A typical RSS document consists of one or more items

Crawl RSS feeds from other websites using PHP Crawl RSS feeds from other websites using PHP Jun 13, 2023 pm 02:55 PM

As Internet content continues to enrich and diversify, more and more people are beginning to use RSS technology to subscribe to blogs, news and other content they are interested in, so that they will no longer miss any important information. As one of the commonly used programming languages ​​in web development, PHP also provides some powerful functions and tools to help us crawl RSS subscriptions from other websites and display them on our own website. This article will introduce how to use PHP to crawl RSS subscriptions of other websites and parse them into arrays or objects.

XML/RSS Data Integration: Practical Guide for Developers & Architects XML/RSS Data Integration: Practical Guide for Developers & Architects Apr 02, 2025 pm 02:12 PM

XML/RSS data integration can be achieved by parsing and generating XML/RSS files. 1) Use Python's xml.etree.ElementTree or feedparser library to parse XML/RSS files and extract data. 2) Use ElementTree to generate XML/RSS files and gradually add nodes and data.

Implement RSS subscription function using PHP and XML Implement RSS subscription function using PHP and XML Aug 09, 2023 pm 08:13 PM

Using PHP and XML to implement RSS subscription function RSS (ReallySimpleSyndication) is a standard format for publishing and subscribing to website updates. It is based on XML and gets the latest content through the subscriber's RSS reader. In this article, we will introduce how to use PHP and XML to implement a simple RSS subscription function. Create an XML file First, we need to create an XML file to store the content we want to publish. Suppose we want to publish a text

Microsoft Edge is testing a modern RSS feed that lets you follow YouTube creators Microsoft Edge is testing a modern RSS feed that lets you follow YouTube creators May 04, 2023 am 11:25 AM

&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Click to enter:&lt;/strong&gt;ChatGPT tool plug-in navigation&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;In&lt;em&gt;Influence&lt;/em&gt; In the age of bloggers, vloggers, and content creators, every new way to follow our favorite influencers matters&lt;em&gt;

See all articles