[ PHPXref.com ] [ Generated: Sun Jul 20 18:31:57 2008 ] [ Mambo 4.6 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/modules/ -> mod_stats.php (source)

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


[ Powered by PHPXref - Served by Debian GNU/Linux ]