<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
defined('MAXIMUS') or die ('Access denied block total hits MAXIMUS directly...');

if ( $content = opencacheb ( 'TotalHits', 'html' , "".CACHE_BL_TOTALHITS."", '1' ) ) {
} else {

global $startdate;

$sql = "SELECT `count` FROM `".TABLE_COUNTER."` WHERE `type`='total' AND `var`='hits'";
if ( !($result = $GLOBALS['db']->sql_query($sql)) )
{ query_die(BLOCK_ERROR, 'Could not obtain _counter Blocks', '', __LINE__, __FILE__, $sql);}
$row   = $GLOBALS['db']->sql_fetchrow($result);
$count = $GLOBALS['db']->XMFnum($row['count']);
$content = "<font class=\"tiny\"><center>"._WERECEIVED."<br /><b><a href=\"modules.php?name=Statistics\">$count</a></b><br />"._PAGESVIEWS." $startdate</center></font>";
$GLOBALS['db']->sql_freeresult($result);

closecacheb ( "".$content."", 'TotalHits', 'html' , "".CACHE_BL_TOTALHITS."", '1' );
}