- md5
- db12c49a8a058d98a98c9921d633a3e3
- sha1
- b4a87c2b7f9668b9d984a8aa23cda1bc6b798eb5
- sha256
- cc227fcbc0d17ab0ed061c0e45cc8dfcc969803bbf536f716aa951058d25bead
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
<?php
/**
* @version $Id: view.feed.php 20196 2011-01-09 02:40:25Z ian $
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access
defined('_JEXEC') or die;
jimport('joomla.application.component.view');
/**
* HTML View class for the Content component
*
* @package Joomla.Site
* @subpackage com_content
* @since 1.5
*/
class ContentViewCategory extends JView
{
function display()
{
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$params = $app->getParams();
$feedEmail = (@$app->getCfg('feed_email')) ? $app->getCfg('feed_email') : 'author';
// Get some data from the model
JRequest::setVar('limit', $app->getCfg('feed_limit'));
$category = $this->get('Category');
$rows = $this->get('Items');
$doc->link = JRoute::_(ContentHelperRoute::getCategoryRoute($category->id));
foreach ($rows as $row)
{
// strip html from feed item title
$title = $this->escape($row->title);
$title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
// Compute the article slug
$row->slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id;
// url link to article
// & used instead of & as this is converted by feed creator
$link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catid), false);
// strip html from feed item description text
// TODO: Only pull fulltext if necessary (actually, just get the necessary fields).
$description = ($params->get('feed_summary', 0) ? $row->introtext/*.$row->fulltext*/ : $row->introtext);
$author = $row->created_by_alias ? $row->created_by_alias : $row->author;
@$date = ($row->created ? date('r', strtotime($row->created)) : '');
// load individual item creator class
$item = new JFeedItem();
$item->title = $title;
$item->link = $link;
$item->description = $description;
$item->date = $date;
$item->category = $row->category;
$item->author = $author;
if ($feedEmail == 'site') {
$item->authorEmail = $siteEmail;
}
else {
$item->authorEmail = $row->author_email;
}
// loads item info into rss array
$doc->addItem($item);
}
}
}
The same content is in 7 releases, Joomla 1.6.0 to 1.6.6. See them all, or every version of this file.