/** * @return KunenaForumStatistics */ public static function getInstance() { if (self::$_instance === null) { self::$_instance = new KunenaForumStatistics(); } return self::$_instance; }
function displayDefault($tpl = null) { JToolBarHelper::title(JText::_('COM_KUNENA'), 'kunena.png'); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_KUNENA_STAT_FORUMSTATS') . ' - ' . $this->config->board_title); $kunena_stats = KunenaForumStatistics::getInstance(); $kunena_stats->loadAll(); $this->assign($kunena_stats); $this->display(); }
function displayDefault($tpl = null) { require_once KPATH_SITE . '/lib/kunena.link.class.php'; $kunena_stats = KunenaForumStatistics::getInstance(); $kunena_stats->loadAll(); $this->assign($kunena_stats); $this->latestMemberLink = KunenaFactory::getUser(intval($this->lastUserId))->getLink(); $this->userlist = CKunenaLink::GetUserlistLink('', intval($this->get('memberCount'))); $this->_prepareDocument(); parent::display(); }
function displayDefault($tpl = null) { $kunena_stats = KunenaForumStatistics::getInstance(); $kunena_stats->loadAll(); $this->assign($kunena_stats); $this->latestMemberLink = KunenaFactory::getUser(intval($this->lastUserId))->getLink(); $this->userlist = $this->_getUserListLink('', intval($this->get('memberCount'))); if (!KunenaFactory::getConfig()->statslink_allowed && JFactory::getUser()->guest) { return $this->app->enqueueMessage(JText::_('COM_KUNENA_STATS_NOT_ALLOWED_TOSEE_STATS')); } $this->_prepareDocument(); parent::display(); }
/** * Prepare statistics box display. * * @return boolean */ protected function before() { parent::before(); $this->config = KunenaConfig::getInstance(); if (!$this->config->get('showstats') || !$this->config->statslink_allowed && !KunenaUserHelper::get()->exists()) { throw new KunenaExceptionAuthorise(JText::_('COM_KUNENA_NO_ACCESS'), '404'); } $statistics = KunenaForumStatistics::getInstance(); $statistics->loadGeneral(); $this->setProperties($statistics); $this->latestMemberLink = KunenaFactory::getUser(intval($this->lastUserId))->getLink(); $this->statisticsUrl = KunenaFactory::getProfile()->getStatisticsURL(); return true; }
/** * Prepare general statistics display. * * @return void * * @throws KunenaExceptionAuthorise */ protected function before() { parent::before(); $this->config = KunenaConfig::getInstance(); if (!$this->config->get('showstats')) { throw new KunenaExceptionAuthorise(JText::_('COM_KUNENA_NO_ACCESS'), '404'); } if (!$this->config->statslink_allowed && JFactory::getUser()->guest) { throw new KunenaExceptionAuthorise(JText::_('COM_KUNENA_NO_ACCESS'), '401'); } $statistics = KunenaForumStatistics::getInstance(); $statistics->loadAll(); $this->setProperties($statistics); $this->latestMemberLink = KunenaFactory::getUser((int) $this->lastUserId)->getLink(); $this->userlistUrl = KunenaFactory::getProfile()->getUserListUrl(); }
function displayDefault($tpl = null) { $this->config = KunenaFactory::getConfig (); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_KUNENA_STAT_FORUMSTATS') . ' - ' . $this->config->board_title); require_once(KPATH_SITE.'/lib/kunena.link.class.php'); $kunena_stats = KunenaForumStatistics::getInstance ( ); $kunena_stats->loadAll(); $this->assign($kunena_stats); $this->latestMemberLink = CKunenaLink::GetProfileLink($this->lastUserId); $this->userlist = CKunenaLink::GetUserlistLink('', intval($this->get('memberCount'))); $this->statisticsURL = KunenaRoute::_('index.php?option=com_kunena&view=statistics'); parent::display (); }
protected function getStats() { $stats = KunenaForumStatistics::getInstance(); switch ($this->type) { case 'topics': $this->titleHeader = JText::_('MOD_KUNENASTATS_TOPTOPICS'); $this->valueHeader = JText::_('MOD_KUNENASTATS_HITS'); $items = $stats->loadTopTopics($this->items); break; case 'posters': $this->titleHeader = JText::_('MOD_KUNENASTATS_TOPPOSTERS'); $this->valueHeader = JText::_('MOD_KUNENASTATS_POSTS'); $items = $stats->loadTopPosters($this->items); break; case 'profiles': $this->titleHeader = JText::_('MOD_KUNENASTATS_TOPPROFILES'); $this->valueHeader = JText::_('MOD_KUNENASTATS_HITS'); $items = $stats->loadTopProfiles($this->items); break; case 'polls': $this->titleHeader = JText::_('MOD_KUNENASTATS_TOPPOLLS'); $this->valueHeader = JText::_('MOD_KUNENASTATS_VOTES'); $items = $stats->loadTopPolls($this->items); break; case 'thanks': $this->titleHeader = JText::_('MOD_KUNENASTATS_TOPTHANKS'); $this->valueHeader = JText::_('MOD_KUNENASTATS_THANKS'); $items = $stats->loadTopThankyous($this->items); break; default: $this->type = 'general'; $stats->loadGeneral(true); $this->latestMemberLink = KunenaFactory::getUser(intval($stats->lastUserId))->getLink(); $this->userlist = $this->_getUserListLink('', $this->formatLargeNumber($stats->memberCount, 4)); $items = $stats; } return $items; }
function displayStatistics($tpl = null) { $cache = JFactory::getCache('com_kunena', 'output'); if ($cache->start("{$this->template->name}.common.statistics", 'com_kunena.template')) return; // FIXME: refactor code $this->config = KunenaFactory::getConfig(); require_once(KPATH_SITE.'/lib/kunena.link.class.php'); $kunena_stats = KunenaForumStatistics::getInstance ( ); $kunena_stats->loadGeneral(); $this->assign($kunena_stats); $this->latestMemberLink = CKunenaLink::GetProfileLink($this->lastUserId); $this->statisticsURL = KunenaRoute::_('index.php?option=com_kunena&view=statistics'); $result = $this->loadTemplate($tpl); if (JError::isError($result)) { return $result; } echo $result; $cache->end(); }
function displayStatistics($tpl = null) { if ($this->offline) { return; } $cache = JFactory::getCache('com_kunena', 'output'); if ($cache->start("{$this->ktemplate->name}.common.statistics", 'com_kunena.template')) { return; } $kunena_stats = KunenaForumStatistics::getInstance(); $kunena_stats->loadGeneral(); $this->assign($kunena_stats); $this->latestMemberLink = KunenaFactory::getUser(intval($this->lastUserId))->getLink(); $this->statisticsUrl = KunenaRoute::_('index.php?option=com_kunena&view=statistics'); $this->statisticsLink = $this->getStatsLink($this->config->board_title . ' ' . JText::_('COM_KUNENA_STAT_FORUMSTATS'), ''); $this->usercountLink = $this->getUserlistLink('', $this->memberCount); $this->userlistLink = $this->getUserlistLink('', JText::_('COM_KUNENA_STAT_USERLIST') . ' »'); $this->moreLink = $this->getStatsLink(JText::_('COM_KUNENA_STAT_MORE_ABOUT_STATS') . ' »'); $result = $this->loadTemplateFile($tpl); if (JError::isError($result)) { return $result; } echo $result; $cache->end(); }
function displayStatistics($tpl = null) { if ($this->offline) { return; } $cache = JFactory::getCache('com_kunena', 'output'); if ($cache->start("{$this->ktemplate->name}.common.statistics", 'com_kunena.template')) { return; } // FIXME: refactor code require_once KPATH_SITE . '/lib/kunena.link.class.php'; $kunena_stats = KunenaForumStatistics::getInstance(); $kunena_stats->loadGeneral(); $this->assign($kunena_stats); $this->latestMemberLink = KunenaFactory::getUser(intval($this->lastUserId))->getLink(); $this->statisticsUrl = KunenaRoute::_('index.php?option=com_kunena&view=statistics'); $result = $this->loadTemplateFile($tpl); if (JError::isError($result)) { return $result; } echo $result; $cache->end(); }