本文整理汇总了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);
}
示例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);
}
示例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);
}