Source for file mod_stats.php

Documentation is available at mod_stats.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @author Mambo Foundation Inc see README.php
  5. @copyright Mambo Foundation Inc.
  6. *  See COPYRIGHT.php for copyright notices and details.
  7. @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
  8. *  LICENSE.php
  9. *  Mambo is free software; you can redistribute it and/or
  10. *  modify it under the terms of the GNU General Public License
  11. *  as published by the Free Software Foundation; version 2 of the
  12. *  License.
  13. */
  14.  
  15. /** ensure this file is being included by a parent file */
  16. defined'_VALID_MOS' or die'Direct Access to this location is not allowed.' );
  17.  
  18. global $mosConfig_offset$mosConfig_caching$mosConfig_enable_stats;
  19. global $mosConfig_gzip;
  20. $serverinfo $params->get'serverinfo' );
  21. $siteinfo $params->get'siteinfo' );
  22. $moduleclass_sfx $params->get'moduleclass_sfx' );
  23.  
  24. $content "";
  25.  
  26. if ($serverinfo{
  27.     echo "<strong>OS:</strong> "  substr(php_uname(),0,7"<br />\n";
  28.     echo "<strong>PHP:</strong> " .phpversion("<br />\n";
  29.     echo "<strong>MySQL:</strong> " .mysql_get_server_info("<br />\n";
  30.     echo "<strong>".T_('Time').": </strong> " .date("H:i",time()+($mosConfig_offset*60*60)) "<br />\n";
  31.     $c $mosConfig_caching T_('Enabled'):T_('Disabled');
  32.     echo "<strong>Caching:</strong> " $c "<br />\n";
  33.     $z $mosConfig_gzip T_('Enabled'):T_('Disabled');
  34.     echo "<strong>GZIP:</strong> " $z "<br />\n";
  35. }
  36.  
  37. if ($siteinfo{
  38.     $query="SELECT count(id) AS count_users FROM #__users";
  39.     $database->setQuery($query);
  40.     echo "<strong>".T_('Members').":</strong> " .$database->loadResult("<br />\n";
  41.  
  42.     $query="SELECT count(id) as count_items from #__content";
  43.     $database->setQuery($query);
  44.     echo "<strong>".T_('News').":</strong> ".$database->loadResult("<br />\n";
  45.  
  46.     $query="SELECT count(id) as count_links FROM #__weblinks WHERE published='1'";
  47.     $database->setQuery($query);
  48.     echo "<strong>".T_('Web Links').":</strong> ".$database->loadResult("<br />\n";
  49. }
  50.  
  51. if ($mosConfig_enable_stats{
  52.     $counter $params->get'counter' );
  53.     $increase $params->get'increase' );
  54.     if ($counter{
  55.         $query "SELECT sum(hits) AS count FROM #__stats_agents WHERE type='1'";
  56.         $database->setQuery$query );
  57.         $hits $database->loadResult();
  58.  
  59.         $hits $hits $increase;
  60.  
  61.         if ($hits == NULL{
  62.             $content .= "<strong>" T_('Visitors'":</strong> 0\n";
  63.         else {
  64.             $content .= "<strong>" .  T_('Visitors'":</strong> " $hits "\n";
  65.         }
  66.     }
  67. }
  68. ?>

Documentation generated on Mon, 05 May 2008 16:21:23 +0400 by phpDocumentor 1.4.0