没什么功能

源代码在线查看: rss.php

软件大小: 6025 K
上传用户: rylzll
关键词:
下载地址: 免注册下载 普通下载 VIP

相关代码

								/**				 * @version		$Id: rss.php 10772 2008-08-23 11:53:16Z willebil $				 * @package		Joomla.Framework				 * @subpackage	Document				 * @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.				 * @license		GNU/GPL, see LICENSE.php				 * Joomla! is free software. This version may have been modified pursuant				 * to the GNU General Public License, and as distributed it includes or				 * is derivative of works licensed under the GNU General Public License or				 * other free or open source software licenses.				 * See COPYRIGHT.php for copyright notices and details.				 */								// Check to ensure this file is within the rest of the framework				defined('JPATH_BASE') or die();												 /**				 * JDocumentRenderer_RSS is a feed that implements RSS 2.0 Specification				 *				 * @author	Johan Janssens 				 *				 * @package 	Joomla.Framework				 * @subpackage		Document				 * @see http://www.rssboard.org/rss-specification				 * @since	1.5				 */								class JDocumentRendererRSS extends JDocumentRenderer				{					/**					 * Renderer mime type					 *					 * @var		string					 * @access	private					 */					var $_mime = "application/rss+xml";									/**					 * Render the feed					 *					 * @access public					 * @return	string					 */					function render()					{						$now	=& JFactory::getDate();						$data	=& $this->_doc;										$uri =& JFactory::getURI();						$url = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));										$feed = "\n";						$feed.= "	\n";						$feed.= "		".$data->title."\n";						$feed.= "		".$data->description."\n";						$feed.= "		".$url.$data->link."\n";						$feed.= "		".htmlspecialchars($now->toRFC822(), ENT_COMPAT, 'UTF-8')."\n";						$feed.= "		".$data->getGenerator()."\n";										if ($data->image!=null)						{							$feed.= "		\n";							$feed.= "			".$data->image->url."\n";							$feed.= "			".htmlspecialchars($data->image->title, ENT_COMPAT, 'UTF-8')."\n";							$feed.= "			".$data->image->link."\n";							if ($data->image->width != "") {								$feed.= "			".$data->image->width."\n";							}							if ($data->image->height!="") {								$feed.= "			".$data->image->height."\n";							}							if ($data->image->description!="") {								$feed.= "			\n";							}							$feed.= "		\n";						}						if ($data->language!="") {							$feed.= "		".$data->language."\n";						}						if ($data->copyright!="") {							$feed.= "		".htmlspecialchars($data->copyright,ENT_COMPAT, 'UTF-8')."\n";						}						if ($data->editor!="") {							$feed.= "		".htmlspecialchars($data->editor, ENT_COMPAT, 'UTF-8')."\n";						}						if ($data->webmaster!="") {							$feed.= "		".htmlspecialchars($data->webmaster, ENT_COMPAT, 'UTF-8')."\n";						}						if ($data->pubDate!="") {							$pubDate =& JFactory::getDate($data->pubDate);							$feed.= "		".htmlspecialchars($pubDate->toRFC822(),ENT_COMPAT, 'UTF-8')."\n";						}						if ($data->category!="") {							$feed.= "		".htmlspecialchars($data->category, ENT_COMPAT, 'UTF-8')."\n";						}						if ($data->docs!="") {							$feed.= "		".htmlspecialchars($data->docs, ENT_COMPAT, 'UTF-8')."\n";						}						if ($data->ttl!="") {							$feed.= "		".htmlspecialchars($data->ttl, ENT_COMPAT, 'UTF-8')."\n";						}						if ($data->rating!="") {							$feed.= "		".htmlspecialchars($data->rating, ENT_COMPAT, 'UTF-8')."\n";						}						if ($data->skipHours!="") {							$feed.= "		".htmlspecialchars($data->skipHours, ENT_COMPAT, 'UTF-8')."\n";						}						if ($data->skipDays!="") {							$feed.= "		".htmlspecialchars($data->skipDays, ENT_COMPAT, 'UTF-8')."\n";						}										for ($i=0; $iitems); $i++)						{							if ((strpos($data->items[$i]->link, 'http://') === false) and (strpos($data->items[$i]->link, 'https://') === false)) {								$data->items[$i]->link = $url.$data->items[$i]->link;							}							$feed.= "		\n";							$feed.= "			".htmlspecialchars(strip_tags($data->items[$i]->title), ENT_COMPAT, 'UTF-8')."\n";							$feed.= "			".$data->items[$i]->link."\n";							$feed.= "			\n";											if ($data->items[$i]->author!="") {								$feed.= "			".htmlspecialchars($data->items[$i]->author, ENT_COMPAT, 'UTF-8')."\n";							}							/*							// on hold							if ($data->items[$i]->source!="") {									$data.= "			".htmlspecialchars($data->items[$i]->source, ENT_COMPAT, 'UTF-8')."\n";							}							*/							if ($data->items[$i]->category!="") {								$feed.= "			".htmlspecialchars($data->items[$i]->category, ENT_COMPAT, 'UTF-8')."\n";							}							if ($data->items[$i]->comments!="") {								$feed.= "			".htmlspecialchars($data->items[$i]->comments, ENT_COMPAT, 'UTF-8')."\n";							}							if ($data->items[$i]->date!="") {							$itemDate =& JFactory::getDate($data->items[$i]->date);								$feed.= "			".htmlspecialchars($itemDate->toRFC822(), ENT_COMPAT, 'UTF-8')."\n";							}							if ($data->items[$i]->guid!="") {								$feed.= "			".htmlspecialchars($data->items[$i]->guid, ENT_COMPAT, 'UTF-8')."\n";							}							if ($data->items[$i]->enclosure != NULL)							{									$feed.= "												$feed.= $data->items[$i]->enclosure->url;									$feed.= "\" length=\"";									$feed.= $data->items[$i]->enclosure->length;									$feed.= "\" type=\"";									$feed.= $data->items[$i]->enclosure->type;									$feed.= "\"/>\n";							}											$feed.= "		\n";						}						$feed.= "	\n";						$feed.= "\n";						return $feed;					}									/**					 * Convert links in a text from relative to absolute					 *					 * @access public					 * @return	string					 */					function _relToAbs($text)					{						$base = JURI::base();				  		$text = preg_replace("/(href|src)=\"(?!http|ftp|https)([^\"]*)\"/", "$1=\"$base\$2\"", $text);										return $text;					}				}							

相关资源