Example #1
0
 function displayDefault($tpl = null)
 {
     if (!$this->config->enablerss) {
         JError::raiseError(404, JText::_('COM_KUNENA_RSS_DISABLED'));
     }
     KunenaHtmlParser::$relative = false;
     $this->category = $this->get('Category');
     if (!$this->category->authorise('read')) {
         JError::raiseError(404, $this->category->getError());
     }
     $this->topics = $this->get('Topics');
     $title = JText::_('COM_KUNENA_THREADS_IN_FORUM') . ': ' . $this->category->name;
     $this->setTitle($title);
     $metaDesc = $this->document->getDescription() . '. ' . $this->escape("{$this->category->name} - {$this->config->board_title}");
     $this->document->setDescription($metaDesc);
     // Create image for feed
     $image = new JFeedImage();
     $image->title = $this->document->getTitle();
     $image->url = $this->ktemplate->getImagePath('icons/rss.png');
     $image->description = $this->document->getDescription();
     $this->document->image = $image;
     foreach ($this->topics as $topic) {
         $description = $topic->last_post_message;
         $date = new JDate($topic->last_post_time);
         $userid = $topic->last_post_userid;
         $username = KunenaFactory::getUser($userid)->getName($topic->last_post_guest_name);
         $title = $topic->subject;
         $category = $topic->getCategory();
         $url = $topic->getUrl($category, true, 'last');
         $this->createItem($title, $url, $description, $category->name, $date, $userid, $username);
     }
 }
Example #2
0
	function displayDefault($tpl = null) {
		if (!$this->config->enablerss) {
			JError::raiseError ( 404, JText::_ ( 'COM_KUNENA_RSS_DISABLED' ) );
		}

		KunenaHtmlParser::$relative = false;
		/*
		// TODO: caching (this is from old code)
		$cache = JFactory::getCache( 'com_kunena_rss' );
		if ( $this->caching ) {
			$cache->setCaching( 1 );
			$cache->setLifeTime( $this->caching );
		}
		$data = $cache->call( array( 'CKunenaRSSData', 'fetch' ), $this->type, $this->incl_cat, $this->excl_cat, $this->limit, $this->timelimit );
		*/
		$this->layout = 'default';
		$this->params = $this->state->get('params');
		$this->topics = $this->get ( 'Topics' );
		$this->total = $this->get ( 'Total' );

		// TODO: if start != 0, add information from it into description
		$this->document->setGenerator('Kunena Forum (Joomla)');

		switch ($this->state->get ( 'list.mode' )) {
			case 'topics' :
				$title =  JText::_('COM_KUNENA_VIEW_TOPICS_DEFAULT_MODE_TOPICS');
				break;
			case 'sticky' :
				$title =  JText::_('COM_KUNENA_VIEW_TOPICS_DEFAULT_MODE_STICKY');
				break;
			case 'locked' :
				$title =  JText::_('COM_KUNENA_VIEW_TOPICS_DEFAULT_MODE_LOCKED');
				break;
			case 'noreplies' :
				$title =  JText::_('COM_KUNENA_VIEW_TOPICS_DEFAULT_MODE_NOREPLIES');
				break;
			case 'unapproved' :
				$title =  JText::_('COM_KUNENA_VIEW_TOPICS_DEFAULT_MODE_UNAPPROVED');
				break;
			case 'deleted' :
				$title =  JText::_('COM_KUNENA_VIEW_TOPICS_DEFAULT_MODE_DELETED');
				break;
			case 'replies' :
			default :
				$title =  JText::_('COM_KUNENA_VIEW_TOPICS_DEFAULT_MODE_DEFAULT');
		}
		$this->setTitle ( $title );

		// Create image for feed
		$image = new JFeedImage();
		$image->title = $this->document->getTitle();
		$image->url = $this->ktemplate->getImagePath('icons/rss.png');
		$image->description = $this->document->getDescription();
		$this->document->image = $image;

		$this->displayTopicRows();
	}