/** * Prepare ban history. * * @return void * * @throws KunenaExceptionAuthorise */ protected function before() { parent::before(); $userid = $this->input->getInt('userid'); $this->me = KunenaUserHelper::getMyself(); $this->profile = KunenaUserHelper::get($userid); $this->profile->tryAuthorise('ban'); $this->banHistory = KunenaUserBan::getUserHistory($this->profile->userid); $this->headerText = JText::sprintf('COM_KUNENA_BAN_BANHISTORYFOR', $this->profile->getName()); }
/** * Prepare topic moderate display. * * @return void * * @throws KunenaExceptionAuthorise */ protected function before() { parent::before(); $catid = $this->input->getInt('catid'); $id = $this->input->getInt('id'); $mesid = $this->input->getInt('mesid'); if (!$mesid) { $this->topic = KunenaForumTopicHelper::get($id); $this->topic->tryAuthorise('move'); } else { $this->message = KunenaForumMessageHelper::get($mesid); $this->message->tryAuthorise('move'); $this->topic = $this->message->getTopic(); } $this->category = $this->topic->getCategory(); $this->uri = "index.php?option=com_kunena&view=topic&layout=moderate" . "&catid={$this->category->id}&id={$this->topic->id}" . ($this->message ? "&mesid={$this->message->id}" : ''); $this->title = !$this->message ? JText::_('COM_KUNENA_TITLE_MODERATE_TOPIC') : JText::_('COM_KUNENA_TITLE_MODERATE_MESSAGE'); // Load topic icons if available. if ($this->config->topicicons) { $this->template = KunenaTemplate::getInstance(); $this->template->setCategoryIconset(); $this->topicIcons = $this->template->getTopicIcons(false); } // Have a link to moderate user as well. if (isset($this->message)) { $user = $this->message->getAuthor(); if ($user->exists()) { $username = $user->getName(); $this->userLink = $this->message->userid ? JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=user&layout=moderate&userid=' . $this->message->userid, $username . ' (' . $this->message->userid . ')', $username . ' (' . $this->message->userid . ')') : null; } } if ($this->message) { $this->banHistory = KunenaUserBan::getUserHistory($this->message->userid); $this->me = KunenaFactory::getUser(); // Get thread and reply count from current message: $db = JFactory::getDbo(); $query = "SELECT COUNT(mm.id) AS replies FROM #__kunena_messages AS m\r\n\t\t\t\tINNER JOIN #__kunena_messages AS t ON m.thread=t.id\r\n\t\t\t\tLEFT JOIN #__kunena_messages AS mm ON mm.thread=m.thread AND mm.time > m.time\r\n\t\t\t\tWHERE m.id={$db->Quote($this->message->id)}"; $db->setQuery($query, 0, 1); $this->replies = $db->loadResult(); if (KunenaError::checkDatabaseError()) { return; } } $this->banInfo = KunenaUserBan::getInstanceByUserid(JFactory::getUser()->id, true); }
/** * */ function displayBanHistory() { $this->banhistory = KunenaUserBan::getUserHistory($this->profile->userid); echo $this->loadTemplateFile('history'); }
function getBanHistory() { kimport('userban'); $user_history = KunenaUserBan::getUserHistory($this->profile->userid); return $user_history; }
function displayBanHistory() { kimport('kunena.user.ban'); $this->banhistory = KunenaUserBan::getUserHistory($this->profile->userid); echo $this->loadTemplate('history'); }