Esempio n. 1
0
 /**
  * @return KunenaForumStatistics
  */
 public static function getInstance()
 {
     if (self::$_instance === null) {
         self::$_instance = new KunenaForumStatistics();
     }
     return self::$_instance;
 }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
 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();
 }
Esempio n. 4
0
 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();
 }
Esempio n. 5
0
 /**
  * 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;
 }
Esempio n. 6
0
 /**
  * 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();
 }
Esempio n. 7
0
	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 ();
	}
Esempio n. 8
0
 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;
 }
Esempio n. 9
0
	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();
	}
Esempio n. 10
0
	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();
	}
Esempio n. 11
0
 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();
 }