Annotation of /mambo/branches/4.6/modules/mod_stats.php
Parent Directory
|
Revision Log
Revision 3 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | * @version $Id: mod_stats.php,v 1.1 2005/07/22 01:58:30 eddieajau Exp $ | ||
| 4 : | * @package Mambo | ||
| 5 : | * @copyright (C) 2000 - 2005 Miro International Pty Ltd | ||
| 6 : | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||
| 7 : | * Mambo is Free Software | ||
| 8 : | */ | ||
| 9 : | |||
| 10 : | /** ensure this file is being included by a parent file */ | ||
| 11 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 12 : | |||
| 13 : | global $mosConfig_offset, $mosConfig_caching, $mosConfig_enable_stats; | ||
| 14 : | global $mosConfig_gzip; | ||
| 15 : | $serverinfo = $params->get( 'serverinfo' ); | ||
| 16 : | $siteinfo = $params->get( 'siteinfo' ); | ||
| 17 : | $moduleclass_sfx = $params->get( 'moduleclass_sfx' ); | ||
| 18 : | |||
| 19 : | $content = ""; | ||
| 20 : | |||
| 21 : | if ($serverinfo) { | ||
| 22 : | echo "<strong>OS:</strong> " . substr(php_uname(),0,7) . "<br />\n"; | ||
| 23 : | echo "<strong>PHP:</strong> " .phpversion() . "<br />\n"; | ||
| 24 : | echo "<strong>MySQL:</strong> " .mysql_get_server_info() . "<br />\n"; | ||
| 25 : | echo "<strong>"._TIME_STAT.": </strong> " .date("H:i",time()+($mosConfig_offset*60*60)) . "<br />\n"; | ||
| 26 : | $c = $mosConfig_caching ? 'Enabled':'Disabled'; | ||
| 27 : | echo "<strong>Caching:</strong> " . $c . "<br />\n"; | ||
| 28 : | $z = $mosConfig_gzip ? 'Enabled':'Disabled'; | ||
| 29 : | echo "<strong>GZIP:</strong> " . $z . "<br />\n"; | ||
| 30 : | } | ||
| 31 : | |||
| 32 : | if ($siteinfo) { | ||
| 33 : | $query="SELECT count(id) AS count_users FROM #__users"; | ||
| 34 : | $database->setQuery($query); | ||
| 35 : | echo "<strong>"._MEMBERS_STAT.":</strong> " .$database->loadResult() . "<br />\n"; | ||
| 36 : | |||
| 37 : | $query="SELECT count(id) as count_items from #__content"; | ||
| 38 : | $database->setQuery($query); | ||
| 39 : | echo "<strong>"._NEWS_STAT.":</strong> ".$database->loadResult() . "<br />\n"; | ||
| 40 : | |||
| 41 : | $query="SELECT count(id) as count_links FROM #__weblinks WHERE published='1'"; | ||
| 42 : | $database->setQuery($query); | ||
| 43 : | echo "<strong>"._LINKS_STAT.":</strong> ".$database->loadResult() . "<br />\n"; | ||
| 44 : | } | ||
| 45 : | |||
| 46 : | if ($mosConfig_enable_stats) { | ||
| 47 : | $counter = $params->get( 'counter' ); | ||
| 48 : | $increase = $params->get( 'increase' ); | ||
| 49 : | if ($counter) { | ||
| 50 : | $query = "SELECT sum(hits) AS count FROM #__stats_agents WHERE type='1'"; | ||
| 51 : | $database->setQuery( $query ); | ||
| 52 : | $hits = $database->loadResult(); | ||
| 53 : | |||
| 54 : | $hits = $hits + $increase; | ||
| 55 : | |||
| 56 : | if ($hits == NULL) { | ||
| 57 : | $content .= "<strong>" . _VISITORS . ":</strong> 0\n"; | ||
| 58 : | } else { | ||
| 59 : | $content .= "<strong>" . _VISITORS . ":</strong> " . $hits . "\n"; | ||
| 60 : | } | ||
| 61 : | } | ||
| 62 : | } | ||
| 63 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

