search
HomeCMS TutorialDEDECMSHow dedecms implements RSS full-site static output and RSS subscription

How dedecms implements RSS full-site static output and RSS subscription

dedecmsHow to implement RSS full-site static output and RSS subscription?

First of all, you create a new rss.php file and copy the following code into it:

Recommended learning: Dream Weaver cms

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

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>https://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>https://www.jb51.net[field:arcurl/]</guid> 
<description><![CDATA[[field:description function=&#39;html2text(@me)&#39;/] ... 
<b>文章分类</b>:[field:typename/]
<a href="https://www.jb51.net[field:arcurl/]" target="_blank">阅读全文</a> | <a href="https://www.jb51.net/plus/recommend.php?aid=[field:id/]" target="_blank">邮件推荐</a> | <a href="https://www.jb51.net[field:arcurl/]" target="_blank">评论回复</a>]]></description> 
织梦好,好织梦 
</item> 
{/dede:arclist} 
</channel> 
</rss>

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 home page 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 need to press Do what is said below

----------------------------------------------

Step one: Open single-page document management under the channel model

Click to add a page

Just follow the picture above to create such a single-page file, but the name cannot be Use "site-wide RSS static output". It is best to use an English name. You can choose it by yourself. Click to save the others and ignore it.

Finally update the cache. It is best to update it in the whole site.

For rss subscription, I redid the original file rssmap.html in dede, and then overwritten the original file. The original file is in the data folder.

The following provides some popular rss subscription codes For your reference

<div class="indexContent"> 
<div><a href="http://www.google.com/reader/view/feed/http://www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="/static/imghwm/default1.png"  data-src="images/rss/o_sub_google.gif"  class="lazy"     style="max-width:90%" alt="通过Google订阅本站" /></a></div> 
<div><a href="http://www.zhuaxia.com/add_channel.php?url=www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="/static/imghwm/default1.png"  data-src="images/o_sub_zhuaxia.gif"  class="lazy"     style="max-width:90%" alt="通过抓虾订阅本站" /></a></div> 
织梦内容管理系统 
<div><a href="http://www.xianguo.com/subscribe.php?url=www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="/static/imghwm/default1.png"  data-src="images/rss/o_sub_xianguo.gif"  class="lazy"     style="max-width:90%" alt="通过鲜果订阅本站" /></a></div> 
<div><a href="http://www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="/static/imghwm/default1.png"  data-src="images/rss/o_sub_hexun.gif"  class="lazy"     style="max-width:90%" alt="通过和讯博揽订阅本站" /></a></div> 
<div><a href="http://add.my.yahoo.com/rss?url=www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="/static/imghwm/default1.png"  data-src="images/rss/o_sub_myyahoo.gif"  class="lazy"     style="max-width:90%" alt="通过雅虎订阅本站" /></a></div> 
本文来自织梦 
<div><a href="http://reader.yodao.com/#url=http://www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="/static/imghwm/default1.png"  data-src="images/rss/o_yodaoresbutton.gif"  class="lazy"     style="max-width:90%" alt="通过有道订阅本站" /></a></div> 
<div><a href="http://www.bloglines.com/sub/http://www.shsui.cn/rss.xml" target="_blank" rel="nofollow"><img src="/static/imghwm/default1.png"  data-src="images/rss/o_sub_bloglines.gif"  class="lazy"     style="max-width:90%" alt="通过BlogLines订阅本站" /></a></div> </div> 
本文出自 “玩linux…做运维…没事..” 博客,请务必保留此出处

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

Statement
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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.