| [ Index ] |
PHP Cross Reference of Joomla 2.5.4 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @package Joomla.Site 4 * @subpackage mod_stats 5 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. 6 * @license GNU General Public License version 2 or later; see LICENSE.txt 7 */ 8 9 // no direct access 10 defined('_JEXEC') or die; 11 12 /** 13 * @package Joomla.Site 14 * @subpackage mod_stats 15 * @since 1.5 16 */ 17 class modStatsHelper 18 { 19 static function &getList(&$params) 20 { 21 $app = JFactory::getApplication(); 22 $db = JFactory::getDbo(); 23 $rows = array(); 24 $query = $db->getQuery(true); 25 26 $serverinfo = $params->get('serverinfo'); 27 $siteinfo = $params->get('siteinfo'); 28 $counter = $params->get('counter'); 29 $increase = $params->get('increase'); 30 31 $i = 0; 32 if ($serverinfo) { 33 $rows[$i] = new stdClass; 34 $rows[$i]->title = JText::_('MOD_STATS_OS'); 35 $rows[$i]->data = substr(php_uname(), 0, 7); 36 $i++; 37 38 $rows[$i] = new stdClass; 39 $rows[$i]->title = JText::_('MOD_STATS_PHP'); 40 $rows[$i]->data = phpversion(); 41 $i++; 42 43 $rows[$i] = new stdClass; 44 $rows[$i]->title = JText::_('MOD_STATS_MYSQL'); 45 $rows[$i]->data = $db->getVersion(); 46 $i++; 47 48 $rows[$i] = new stdClass; 49 $rows[$i]->title = JTEXT::_('MOD_STATS_TIME'); 50 $rows[$i]->data = JHtml::_('date', 'now', 'H:i'); 51 $i++; 52 53 $rows[$i] = new stdClass; 54 $rows[$i]->title = JText::_('MOD_STATS_CACHING'); 55 $rows[$i]->data = $app->getCfg('caching') ? JText::_('JENABLED'):JText::_('JDISABLED'); 56 $i++; 57 58 $rows[$i] = new stdClass; 59 $rows[$i]->title = JText::_('MOD_STATS_GZIP'); 60 $rows[$i]->data = $app->getCfg('gzip') ? JText::_('JENABLED'):JText::_('JDISABLED'); 61 $i++; 62 } 63 64 if ($siteinfo) { 65 $query->select('COUNT(id) AS count_users'); 66 $query->from('#__users'); 67 $db->setQuery($query); 68 $users = $db->loadResult(); 69 70 $query->clear(); 71 $query->select('COUNT(id) AS count_items'); 72 $query->from('#__content'); 73 $query->where('state = 1'); 74 $db->setQuery($query); 75 $items = $db->loadResult(); 76 77 $query->clear(); 78 $query->select('COUNT(id) AS count_links '); 79 $query->from('#__weblinks'); 80 $query->where('state = 1'); 81 $db->setQuery($query); 82 $links = $db->loadResult(); 83 84 if ($users) { 85 $rows[$i] = new stdClass; 86 $rows[$i]->title = JText::_('MOD_STATS_USERS'); 87 $rows[$i]->data = $users; 88 $i++; 89 } 90 91 if ($items) { 92 $rows[$i] = new stdClass; 93 $rows[$i]->title = JText::_('MOD_STATS_ARTICLES'); 94 $rows[$i]->data = $items; 95 $i++; 96 } 97 98 if ($links) { 99 $rows[$i] = new stdClass; 100 $rows[$i]->title = JText::_('MOD_STATS_WEBLINKS'); 101 $rows[$i]->data = $links; 102 $i++; 103 } 104 } 105 106 if ($counter) { 107 $query->clear(); 108 $query->select('SUM(hits) AS count_hits'); 109 $query->from('#__content'); 110 $query->where('state = 1'); 111 $db->setQuery($query); 112 $hits = $db->loadResult(); 113 114 if ($hits) { 115 $rows[$i] = new stdClass; 116 $rows[$i]->title = JText::_('MOD_STATS_ARTICLES_VIEW_HITS'); 117 $rows[$i]->data = $hits + $increase; 118 $i++; 119 } 120 } 121 122 return $rows; 123 } 124 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Tue Apr 3 11:40:28 2012 | Cross-referenced by PHPXref 0.7.1 |