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


PHP KunenaForumMessageHelper::getLocation方法代码示例

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


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

示例1: getPostLocation

 /**
  * @param int $mesid
  * @param string|null $direction
  * @param mixed $hold
  *
  * @return int
  */
 public function getPostLocation($mesid, $direction = null, $hold = null)
 {
     if (is_null($direction)) {
         $direction = KunenaUserHelper::getMyself()->getMessageOrdering();
     }
     if (!isset($this->lastread)) {
         $this->lastread = $this->last_post_id;
         $this->unread = 0;
     }
     if ($mesid == 'unread') {
         $mesid = $this->lastread;
     }
     if ($this->moved_id || !KunenaUserHelper::getMyself()->isModerator($this->getCategory())) {
         if ($mesid == 'first' || $mesid == $this->first_post_id) {
             return $direction == 'asc' ? 0 : $this->posts - 1;
         }
         if ($mesid == 'last' || $mesid == $this->last_post_id) {
             return $direction == 'asc' ? $this->posts - 1 : 0;
         }
         if ($mesid == $this->unread) {
             return $direction == 'asc' ? $this->posts - max($this->unread, 1) : 0;
         }
     }
     if ($mesid == 'first') {
         $direction = $direction == 'asc' ? 0 : 'both';
     }
     if ($mesid == 'last') {
         $direction = $direction == 'asc' ? 'both' : 0;
     }
     return KunenaForumMessageHelper::getLocation($mesid, $direction, $hold);
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:38,代码来源:topic.php

示例2: getLastPostLocation

	public function getLastPostLocation($direction = 'asc', $hold = null) {
		if (!$this->_me->isModerator($this->id)) return $direction = 'asc' ? $this->last_topic_posts-1 : 0;
		return KunenaForumMessageHelper::getLocation($this->last_post_id, $direction, $hold);
	}
开发者ID:rich20,项目名称:Kunena,代码行数:4,代码来源:category.php

示例3: getPostLocation

	public function getPostLocation($mesid, $direction = 'asc', $hold=null) {
		if (!isset($this->lastread)) {
			$this->lastread = $this->last_post_id;
			$this->unread = 0;
		}
		if ($mesid == 'unread') $mesid = $this->lastread;
		if ($this->moved_id || !$this->_me->isModerator($this->category_id)) {
			if ($mesid == 'first' || $mesid == $this->first_post_id) return $direction = 'asc' ? 0 : $this->posts-1;
			if ($mesid == 'last' || $mesid == $this->last_post_id) return $direction = 'asc' ? $this->posts-1 : 0;
			if ($mesid == $this->unread) return $direction = 'asc' ? $this->posts - max($this->unread, 1) : 0;
		}
		if ($mesid == 'first') $direction == 'asc' ? 0 : 'both';
		if ($mesid == 'last') $direction == 'asc' ? 'both' : 0;
		if (!$direction) return 0;
		return KunenaForumMessageHelper::getLocation($mesid, $direction, $hold);
	}
开发者ID:rich20,项目名称:Kunena,代码行数:16,代码来源:topic.php


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