[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/modules/ -> mod_stats.php (source)

   1  <?php
   2  /**
   3  * @version $Id: mod_stats.php 87 2005-09-15 23:12:03Z eddieajau $
   4  * @package Joomla
   5  * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
   6  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
   7  * Joomla! is free software. This version may have been modified pursuant
   8  * to the GNU General Public License, and as distributed it includes or
   9  * is derivative of works licensed under the GNU General Public License or
  10  * other free or open source software licenses.
  11  * See COPYRIGHT.php for copyright notices and details.
  12  */
  13  
  14  // no direct access
  15  defined( '_VALID_MOS' ) or die( 'Restricted access' );
  16  
  17  global $mosConfig_offset, $mosConfig_caching, $mosConfig_enable_stats;
  18  global $mosConfig_gzip;
  19  
  20  $serverinfo = $params->get( 'serverinfo' );
  21  $siteinfo     = $params->get( 'siteinfo' );
  22  
  23  $content = '';
  24  
  25  if ($serverinfo) {
  26      echo "<strong>OS:</strong> "  . substr(php_uname(),0,7) . "<br />\n";
  27      echo "<strong>PHP:</strong> " .phpversion() . "<br />\n";
  28      echo "<strong>MySQL:</strong> " .$database->getVersion() . "<br />\n";
  29      echo "<strong>"._TIME_STAT.": </strong> " .date("H:i",time()+($mosConfig_offset*60*60)) . "<br />\n";
  30      $c = $mosConfig_caching ? 'Enabled':'Disabled';
  31      echo "<strong>Caching:</strong> " . $c . "<br />\n";
  32      $z = $mosConfig_gzip ? 'Enabled':'Disabled';
  33      echo "<strong>GZIP:</strong> " . $z . "<br />\n";
  34  }
  35  
  36  if ($siteinfo) {
  37      $query="SELECT COUNT( id ) AS count_users"
  38      . "\n FROM #__users"
  39      ;
  40      $database->setQuery($query);
  41      echo "<strong>"._MEMBERS_STAT.":</strong> " .$database->loadResult() . "<br />\n";
  42  
  43      $query="SELECT COUNT( id ) AS count_items"
  44      . "\n FROM #__content"
  45      ;
  46      $database->setQuery($query);
  47      echo "<strong>"._NEWS_STAT.":</strong> ".$database->loadResult() . "<br />\n";
  48  
  49      $query="SELECT COUNT( id ) AS count_links"
  50      . "\n FROM #__weblinks"
  51      . "\n WHERE published = 1"
  52      ;
  53      $database->setQuery($query);
  54      echo "<strong>"._LINKS_STAT.":</strong> ".$database->loadResult() . "<br />\n";
  55  }
  56  
  57  if ($mosConfig_enable_stats) {
  58      $counter     = $params->get( 'counter' );
  59      $increase     = $params->get( 'increase' );
  60      if ($counter) {
  61          $query = "SELECT SUM( hits ) AS count"
  62          . "\n FROM #__stats_agents"
  63          . "\n WHERE type = 1"
  64          ;
  65          $database->setQuery( $query );
  66          $hits = $database->loadResult();
  67  
  68          $hits = $hits + $increase;
  69  
  70          if ($hits == NULL) {
  71              $content .= "<strong>" . _VISITORS . ":</strong> 0\n";
  72          } else {
  73              $content .= "<strong>" . _VISITORS . ":</strong> " . $hits . "\n";
  74          }
  75      }
  76  }
  77  ?>


Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics