Example #1
0
<?php

/**
 * @copyright (C) 2013 iJoomla, Inc. - All rights reserved.
 * @license GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html)
 * @author iJoomla.com <*****@*****.**>
 * @url https://www.jomsocial.com/license-agreement
 * The PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript *are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0
 * More info at https://www.jomsocial.com/license-agreement
 */
defined('_JEXEC') or die('Restricted access');
// Include the syndicate functions only once
require_once dirname(__FILE__) . '/helper.php';
require_once JPATH_BASE . '/components/com_community/libraries/core.php';
$document = JFactory::getDocument();
// $document->addStyleSheet(JURI::root() . '/components/com_community/assets/modules/module.css');
$stats = modStatisticsHelper::getStatisticsData($params);
require JModuleHelper::getLayoutPath('mod_statistics', $params->get('layout', 'default'));
/**
 * @package Joomla 1.6.x
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant to the
 * GNU General Public License, and as distributed it includes or is derivative
 * of works licensed under the GNU General Public License or other free or open
 * source software licenses. See COPYRIGHT.php for copyright notices and
 * details.
 *
 * @PlayJoom Module
 * @copyright Copyright (C) 2010-2011 by www.teglo.info
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @date $Date$
 * @revision $Revision$
 * @author $Author$
 * @headurl $HeadURL$
 */
// no direct access
defined('_JEXEC') or die;
// Include the syndicate functions only once
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'helper.php';
require_once JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_playjoom' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'playjoom.php';
require_once JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_playjoom' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'logging.php';
// import Joomla view library
jimport('joomla.application.component.view');
jimport('joomla.application.component.helper');
$list = modStatisticsHelper::getList($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
require JModuleHelper::getLayoutPath('mod_pj_statistics', $params->get('layout', 'default'));
Example #3
0
 public static function getStatisticsData(&$params)
 {
     $stats = modStatisticsHelper::getInstance();
     $stats_arr = array();
     if ($params->get('members', 1)) {
         $members = $stats->getMemberCount();
         $params->def('t_members', $members);
         array_push($stats_arr, 't_members');
     }
     if ($params->get('groups', 1)) {
         $params->def('t_groups', $stats->getGroupCount());
         array_push($stats_arr, 't_groups');
     }
     if ($params->get('discussions', 1)) {
         $params->def('t_discussions', $stats->geDiscussionCount());
         array_push($stats_arr, 't_discussions');
     }
     if ($params->get('albums', 1)) {
         $params->def('t_albums', $stats->getAlbumsCount());
         array_push($stats_arr, 't_albums');
     }
     if ($params->get('photos', 1)) {
         $params->def('t_photos', $stats->getPhotosCount());
         array_push($stats_arr, 't_photos');
     }
     if ($params->get('videos', 1)) {
         $params->def('t_videos', $stats->getVideosCount());
         array_push($stats_arr, 't_videos');
     }
     if ($params->get('bulletins', 1)) {
         $params->def('t_bulletins', $stats->getBulletinsCount());
         array_push($stats_arr, 't_bulletins');
     }
     if ($params->get('activities', 1)) {
         $params->def('t_activities', $stats->getActivitiesCount());
         array_push($stats_arr, 't_activities');
     }
     if ($params->get('walls', 1)) {
         $params->def('t_walls', $stats->getWallsCount());
         array_push($stats_arr, 't_walls');
     }
     if ($params->get('events', 1)) {
         $params->def('t_events', $stats->getEventsCount());
         array_push($stats_arr, 't_events');
     }
     if ($params->get('genders', 0)) {
         $gender_fieldcode = $params->get('genders_fieldcode', 'FIELD_GENDER');
         $gender_male = strtolower($params->get('genders_male_display', 'Male'));
         $gender_female = strtolower($params->get('genders_female_display', 'Female'));
         $genders = $stats->getGendersCount($gender_fieldcode, $gender_male, $gender_female);
         if (!empty($genders)) {
             if (empty($members)) {
                 $members = $stats->getMemberCount();
             }
             $unspecified = $members - ($genders["male"] + $genders["female"]);
             $params->def('t_gender_males', $genders["male"]);
             $params->def('t_gender_females', $genders["female"]);
             $params->def('t_gender_unspecified', $unspecified);
             array_push($stats_arr, 'genders');
         }
     }
     return $stats_arr;
 }