示例#1
0
 /**
  *
  */
 function displayCategoriesSubscriptions()
 {
     if ($this->config->category_subscriptions == 'disabled') {
         return;
     }
     $params = array('userid' => $this->user->id, 'limit' => 6, 'filter_order' => 'time', 'limitstart' => 0, 'filter_order_Dir' => 'desc');
     KunenaForum::display('category', 'user', 'embed', $params);
 }
示例#2
0
	function displaySubscriptions() {
		if ($this->config->topic_subscriptions == 'disabled') return;
		$params = array(
			'topics_categories' => 0,
			'topics_catselection' => 1,
			'userid' => $this->user->id,
			'mode' => 'subscriptions',
			'sel' => -1,
			'limit' => 6,
			'filter_order' => 'time',
			'limitstart' => 0,
			'filter_order_Dir' => 'desc',
		);
		KunenaForum::display('topics', 'user', 'embed', $params);
	}
示例#3
0
 /**
  * @param KunenaForumCategory $category
  * @param KunenaForumTopic    $topic
  * @param string              $link_topic
  *
  * @return string
  */
 protected function showTopic(KunenaForumCategory $category, KunenaForumTopic $topic, $link_topic)
 {
     if (!$topic->exists()) {
         $this->debug("showTopic: No messages to render");
         return '';
     }
     $this->debug("showTopic: Rendering discussion");
     $ordering = $this->params->get('ordering', 1);
     // 0=ASC, 1=DESC
     $params = array('catid' => $category->id, 'id' => $topic->id, 'limitstart' => (int) (!$ordering), 'limit' => $this->params->get('limit', 25), 'filter_order_Dir' => $ordering ? 'desc' : 'asc', 'templatepath' => __DIR__ . '/tmpl');
     ob_start();
     KunenaForum::display('topic', 'default', null, $params);
     $str = ob_get_contents();
     ob_end_clean();
     return $link_topic . $str;
 }
示例#4
0
 protected function _display()
 {
     // Load language files.
     KunenaFactory::loadLanguage('com_kunena.sys', 'admin');
     KunenaFactory::loadLanguage();
     KunenaFactory::loadLanguage('com_kunena.templates');
     // Convert module parameters into topics view parameters
     $categories = $this->params->get('category_id', 0);
     $categories = is_array($categories) ? implode(',', $categories) : $categories;
     $this->params->set('limitstart', 0);
     $this->params->set('limit', $this->params->get('nbpost', 5));
     $this->params->set('topics_categories', $categories);
     $this->params->set('topics_catselection', $this->params->get('sh_category_id_in', 1));
     $this->params->set('topics_time', $this->params->get('show_list_time', 168));
     $userid = 0;
     switch ($this->params->get('choosemodel')) {
         case 'latestposts':
             $layout = 'posts';
             $mode = 'recent';
             break;
         case 'noreplies':
             $layout = 'default';
             $mode = 'noreplies';
             break;
         case 'catsubscriptions':
             // TODO
             break;
         case 'subscriptions':
             $userid = -1;
             $layout = 'user';
             $mode = 'subscriptions';
             break;
         case 'favorites':
             $userid = -1;
             $layout = 'user';
             $mode = 'favorites';
             break;
         case 'owntopics':
             $layout = 'user';
             $mode = 'posted';
             break;
         case 'deleted':
             $layout = 'posts';
             $mode = 'deleted';
             break;
         case 'saidthankyouposts':
             $userid = -1;
             $layout = 'posts';
             $mode = 'mythanks';
             break;
         case 'gotthankyouposts':
             $userid = -1;
             $layout = 'posts';
             $mode = 'thankyou';
             break;
         case 'userposts':
             $userid = -1;
             $layout = 'posts';
             $mode = 'recent';
             break;
         case 'latesttopics':
         default:
             $layout = 'default';
             $mode = 'recent';
     }
     $this->params->set('layout', $layout);
     $this->params->set('mode', $mode);
     $this->params->set('userid', $userid);
     $this->params->set('moreuri', "index.php?option=com_kunena&view=topics&layout={$layout}&mode={$mode}" . ($userid ? "&userid={$userid}" : ''));
     // Set template path to module
     $this->params->set('templatepath', dirname(JModuleHelper::getLayoutPath('mod_kunenalatest')));
     // Display topics view
     KunenaForum::display('topics', $layout, null, $this->params);
 }