当前位置: 首页>>代码示例>>PHP>>正文


PHP KunenaForumMessageHelper::getMessagesByTopic方法代码示例

本文整理汇总了PHP中KunenaForumMessageHelper::getMessagesByTopic方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaForumMessageHelper::getMessagesByTopic方法的具体用法?PHP KunenaForumMessageHelper::getMessagesByTopic怎么用?PHP KunenaForumMessageHelper::getMessagesByTopic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KunenaForumMessageHelper的用法示例。


在下文中一共展示了KunenaForumMessageHelper::getMessagesByTopic方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: before

 /**
  * Prepare reply history display.
  *
  * @return void
  */
 protected function before()
 {
     parent::before();
     $id = $this->input->getInt('id');
     $this->topic = KunenaForumTopicHelper::get($id);
     $this->history = KunenaForumMessageHelper::getMessagesByTopic($this->topic, 0, (int) $this->config->historylimit, 'DESC');
     $this->replycount = $this->topic->getReplies();
     $this->historycount = count($this->history);
     KunenaAttachmentHelper::getByMessage($this->history);
     $userlist = array();
     foreach ($this->history as $message) {
         $userlist[(int) $message->userid] = (int) $message->userid;
     }
     KunenaUserHelper::loadUsers($userlist);
     // Run events
     $params = new JRegistry();
     $params->set('ksource', 'kunena');
     $params->set('kunena_view', 'topic');
     $params->set('kunena_layout', 'history');
     $dispatcher = JEventDispatcher::getInstance();
     JPluginHelper::importPlugin('kunena');
     $dispatcher->trigger('onKunenaPrepare', array('kunena.messages', &$this->history, &$params, 0));
     // FIXME: need to improve BBCode class on this...
     $this->attachments = KunenaAttachmentHelper::getByMessage($this->history);
     $this->inline_attachments = array();
     $this->headerText = JText::_('COM_KUNENA_POST_EDIT') . ' ' . $this->topic->subject;
 }
开发者ID:Ruud68,项目名称:Kunena-Forum,代码行数:32,代码来源:display.php

示例2: getMessages

 public function getMessages()
 {
     if ($this->messages === false) {
         $layout = $this->getState('layout');
         $threaded = $layout == 'indented' || $layout == 'threaded';
         $this->messages = KunenaForumMessageHelper::getMessagesByTopic($this->getState('item.id'), $this->getState('list.start'), $this->getState('list.limit'), $this->getState('list.direction'), $this->getState('hold'), $threaded);
         // Get thankyous for all messages in the page
         $thankyous = KunenaForumMessageThankyouHelper::getByMessage($this->messages);
         // First collect ids and users
         $userlist = array();
         $this->threaded = array();
         $location = $this->getState('list.start');
         foreach ($this->messages as $message) {
             $message->replynum = ++$location;
             if ($threaded) {
                 // Threaded ordering
                 if (isset($this->messages[$message->parent])) {
                     $this->threaded[$message->parent][] = $message->id;
                 } else {
                     $this->threaded[0][] = $message->id;
                 }
             }
             $userlist[intval($message->userid)] = intval($message->userid);
             $userlist[intval($message->modified_by)] = intval($message->modified_by);
             $thankyou_list = $thankyous[$message->id]->getList();
             $message->thankyou = array();
             if (!empty($thankyou_list)) {
                 $message->thankyou = $thankyou_list;
             }
         }
         if (!isset($this->messages[$this->getState('item.mesid')]) && !empty($this->messages)) {
             $this->setState('item.mesid', reset($this->messages)->id);
         }
         if ($threaded) {
             if (!isset($this->messages[$this->topic->first_post_id])) {
                 $this->messages = $this->getThreadedOrdering(0, array('edge'));
             } else {
                 $this->messages = $this->getThreadedOrdering();
             }
         }
         // Prefetch all users/avatars to avoid user by user queries during template iterations
         KunenaUserHelper::loadUsers($userlist);
         // Get attachments
         KunenaForumMessageAttachmentHelper::getByMessage($this->messages);
     }
     return $this->messages;
 }
开发者ID:sillysachin,项目名称:teamtogether,代码行数:47,代码来源:topic.php

示例3: displayThreadHistory

 function displayThreadHistory()
 {
     if (!$this->hasThreadHistory()) {
         return;
     }
     $this->history = KunenaForumMessageHelper::getMessagesByTopic($this->topic, 0, (int) $this->config->historylimit, $ordering = 'DESC');
     $this->historycount = count($this->history);
     $this->replycount = $this->topic->getReplies();
     KunenaAttachmentHelper::getByMessage($this->history);
     $userlist = array();
     foreach ($this->history as $message) {
         $userlist[(int) $message->userid] = (int) $message->userid;
     }
     KunenaUserHelper::loadUsers($userlist);
     // Run events
     $params = new JRegistry();
     $params->set('ksource', 'kunena');
     $params->set('kunena_view', 'topic');
     $params->set('kunena_layout', 'history');
     $dispatcher = JDispatcher::getInstance();
     JPluginHelper::importPlugin('kunena');
     $dispatcher->trigger('onKunenaPrepare', array('kunena.messages', &$this->history, &$params, 0));
     echo $this->loadTemplateFile('history');
 }
开发者ID:Jougito,项目名称:DynWeb,代码行数:24,代码来源:view.html.php

示例4: displayThreadHistory

 function displayThreadHistory()
 {
     if (!$this->hasThreadHistory()) {
         return;
     }
     $db = JFactory::getDBO();
     $this->history = KunenaForumMessageHelper::getMessagesByTopic($this->topic, 0, (int) $this->config->historylimit, $ordering = 'DESC');
     $this->historycount = count($this->history);
     KunenaForumMessageAttachmentHelper::getByMessage($this->history);
     $userlist = array();
     foreach ($this->history as $message) {
         $userlist[(int) $message->userid] = (int) $message->userid;
     }
     KunenaUserHelper::loadUsers($userlist);
     // Run events
     if (version_compare(JVERSION, '1.6', '>')) {
         // Joomla 1.6+
         $params = new JRegistry();
     } else {
         // Joomla 1.5
         $params = new JParameter('');
     }
     $params->set('ksource', 'kunena');
     $params->set('kunena_view', 'topic');
     $params->set('kunena_layout', 'history');
     $dispatcher = JDispatcher::getInstance();
     JPluginHelper::importPlugin('kunena');
     $dispatcher->trigger('onKunenaPrepare', array('kunena.messages', &$this->history, &$params, 0));
     echo $this->loadTemplateFile('history');
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:30,代码来源:view.html.php

示例5: displayThreadHistory

	function displayThreadHistory() {
		if (! $this->hasThreadHistory())
			return;

		$db = JFactory::getDBO();
		$this->history = KunenaForumMessageHelper::getMessagesByTopic($this->topic, 0, (int) $this->config->historylimit, $ordering='DESC');
		$this->historycount = count ( $this->history );
		KunenaForumMessageAttachmentHelper::getByMessage($this->history);
		$userlist = array();
		foreach ($this->history as $message) {
			$userlist[(int) $message->userid] = (int) $message->userid;
		}
		KunenaUserHelper::loadUsers($userlist);

		echo $this->loadTemplate ( 'history' );
	}
开发者ID:GoremanX,项目名称:Kunena-2.0,代码行数:16,代码来源:view.html.php


注:本文中的KunenaForumMessageHelper::getMessagesByTopic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。