Ejemplo n.º 1
0
 public function display($tpl = null)
 {
     // Fetch the document and set the current URL as feed-point
     $document =& JFactory::getDocument();
     // Load the model
     $model =& $this->getModel();
     // Get the category from our model
     $category = $model->getCategory();
     // Automatically fetch items, total and pagination - and assign them to the template
     $this->setAutoClean(false);
     $this->fetchItems();
     // Set the document properties
     $needles = array('category_id' => $category->id, 'category_alias' => $category->alias);
     $category_url = SimpleListsHelper::getUrl($needles);
     $document->set('link', $category_url);
     $document->setGenerator('');
     // Check if the list is empty
     if (is_array($this->items) && !empty($this->items)) {
         // Loop through the list to set things right
         foreach ($this->items as $id => $item) {
             // Initialize the feed-item
             $feed = new JFeedItem();
             $feed->set('title', $item->title);
             $feed->set('link', $category_url . '#item' . $item->id);
             $feed->set('description', $item->text);
             $feed->set('category', $category->title);
             // Set the date
             $modified = strtotime($item->modified);
             $created = strtotime($item->created);
             if ($modified > 0) {
                 $feed->set('date', $item->modified);
             } elseif ($created > 0) {
                 $feed->set('date', $item->created);
             } else {
                 $feed->set('date', date('R'));
             }
             $document->addItem($feed);
         }
     }
 }
Ejemplo n.º 2
0
 // organizer for particular item
 $item_organizer = htmlspecialchars( $row->contact_info() );
 $item_organizer = html_entity_decode( $item_organizer );
 // location for particular item
 $item_location = htmlspecialchars( $row->location() );
 $item_location = html_entity_decode( $item_location );
 // start date for particular item
 $item_startdate = htmlspecialchars( $row->publish_up());
 // end date for particular item
 $item_enddate = htmlspecialchars( $row->publish_down() );
 if (isset($row->_thumbimg1) && $row->_thumbimg1!=""){
 	$item_description = $row->_thumbimg1. "<br/>".$item_description;
 }
 */
 // load individual item creator class
 $item = new JFeedItem();
 // item info
 if ($row->alldayevent()) {
     $temptime = new JevDate($eventDate);
     $item->set('title', $temptime->toFormat(JText::_('JEV_RSS_DATE')) . " : " . $item_title);
 } else {
     $temptime = new JevDate($eventDate);
     $item->set('title', $temptime->toFormat(JText::_('JEV_RSS_DATETIME')) . " : " . $item_title);
 }
 $item->set('link', $item_link);
 $item->set('description', $item_description);
 $item->set('category', $item_type);
 $eventcreated = new JevDate($row->created());
 $item->set('date', $eventcreated->toUnix(true));
 // add item info to RSS document
 $doc->addItem($item);