| [ Index ] |
PHP Cross Reference of Joomla 1.5.26 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @version $Id: helper.php 14401 2010-01-26 14:10:00Z louis $ 4 * @package Joomla 5 * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. 6 * @license GNU/GPL, see LICENSE.php 7 * Joomla! is free software. This version may have been modified pursuant 8 * to the GNU General Public License, and as distributed it includes or 9 * is derivative of works licensed under the GNU General Public License or 10 * other free or open source software licenses. 11 * See COPYRIGHT.php for copyright notices and details. 12 */ 13 14 /** ensure this file is being included by a parent file */ 15 defined('_JEXEC') or die('Direct Access to this location is not allowed.'); 16 17 class modFeedHelper 18 { 19 function getFeed($params) 20 { 21 // module params 22 $rssurl = $params->get('rssurl', ''); 23 24 // get RSS parsed object 25 $options = array(); 26 $options['rssUrl'] = $rssurl; 27 if ($params->get('cache')) { 28 $options['cache_time'] = $params->get('cache_time', 15) ; 29 $options['cache_time'] *= 60; 30 } else { 31 $options['cache_time'] = null; 32 } 33 34 $rssDoc =& JFactory::getXMLparser('RSS', $options); 35 36 $feed = new stdclass(); 37 38 if ($rssDoc != false) 39 { 40 // channel header and link 41 $feed->title = $rssDoc->get_title(); 42 $feed->link = $rssDoc->get_link(); 43 $feed->description = $rssDoc->get_description(); 44 45 // channel image if exists 46 $feed->image->url = $rssDoc->get_image_url(); 47 $feed->image->title = $rssDoc->get_image_title(); 48 49 // items 50 $items = $rssDoc->get_items(); 51 52 // feed elements 53 $feed->items = array_slice($items, 0, $params->get('rssitems', 5)); 54 } else { 55 $feed = false; 56 } 57 58 return $feed; 59 } 60 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Mar 28 15:54:07 2012 | Cross-referenced by PHPXref 0.7.1 |