<?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 cron config all tables directly...');

global $dbname;

    $db_clean = $dbname;
    $tot_data = 0;
    $tot_idx  = 0;
    $tot_all  = 0;
    $local_query = 'SHOW TABLE STATUS FROM '.$dbname;
    $result = $GLOBALS['db']->sql_query($local_query);
    if ( $GLOBALS['db']->sql_numrows($result) ) {
		while ($row = $GLOBALS['db']->sql_fetchrow($result)) {
	    $local_query = 'OPTIMIZE TABLE '.$row[0];  	
		} 
    }