* @version $Id$ * @license http://opensource.org/licenses/gpl-2.0.php GNU GPL 2 */ /** * Page affichant les statistiques du forum * * FSB utilise le puissant framework Artichow pour les graphiques en GD. Vous pouvez trouver * davantage de documentation et d'informations sur le site officiel de ce framework : * http://www.artichow.org/ */ class Fsb_frame_child extends Fsb_admin_frame { /** * Mode de la page * * @var string */ public $mode = ''; /** * Constructeur */ public function main() { $this->mode = Http::request('mode'); $call = new Call($this); $call->module(array( 'list' => array('text', 'gd'), 'url' => 'index.' . PHPEXT . '?p=tools_stats', 'lang' => 'adm_stats_', 'default' => 'text', )); $call->functions(array( 'mode' => array( 'phpinfo' => 'show_phpinfo', 'default' => array( 'module' => array( 'text' => 'show_text_stats', 'gd' => 'show_gd_stats', ), ), ), )); } /** * Affiche les statistiques textuelles du forum */ public function show_text_stats() { $stats_users = $this->get_simple_stats('total_users'); $stats_topics = $this->get_simple_stats('total_topics'); $stats_posts = $this->get_simple_stats('total_posts'); $stats_smiley = $this->get_memory_stats(SMILEY_PATH); $stats_avatar = $this->get_memory_stats(AVATAR_PATH); $stats_rank = $this->get_memory_stats(RANK_PATH); $stats_upload = $this->get_memory_stats(ROOT . 'upload/'); $stats_sql = $this->get_sql_stats(); Fsb::$tpl->set_switch('stats_forum'); Fsb::$tpl->set_vars(array( 'OS_TYPE' => PHP_OS, 'PHP_VERSION' => phpversion(), 'SGBD_TYPE' => $stats_sql['sgbd_type'], 'SGBD_VERSION' => $stats_sql['sgbd_version'], 'TOTAL_USERS' => $stats_users['total'], 'AVERAGE_USERS' => $stats_users['average'], 'TOTAL_TOPICS' => $stats_topics['total'], 'AVERAGE_TOPICS' => $stats_topics['average'], 'TOTAL_POSTS' => $stats_posts['total'], 'AVERAGE_POSTS' => $stats_posts['average'], 'TOTAL_SQL' => $stats_sql['total'], 'SIZE_SQL' => convert_size($stats_sql['size']), 'TOTAL_SMILEY' => $stats_smiley['total'], 'SIZE_SMILEY' => convert_size($stats_smiley['size']), 'TOTAL_AVATAR' => $stats_avatar['total'], 'SIZE_AVATAR' => convert_size($stats_avatar['size']), 'TOTAL_RANK' => $stats_rank['total'], 'SIZE_RANK' => convert_size($stats_rank['size']), 'TOTAL_UPLOAD' => $stats_upload['total'], 'SIZE_UPLOAD' => convert_size($stats_upload['size']), 'FSB_CREATE' => Fsb::$session->print_date(Fsb::$cfg->get('register_time')), 'CACHE_SYSTEM' => Fsb::$db->cache->cache_type, 'U_PHP_VERSION' => sid('index.' . PHPEXT . '?p=tools_stats&mode=phpinfo'), )); } /** * Affiche le phpinfo() */ public function show_phpinfo() { // Fonction temporaire de callback function phpinfo_legend_name($match) { $title = ($match[2]) ? $match[2] : '???'; return ('
'); } // On recupere le buffer de phpinfo() ob_start(); phpinfo(); $buffer = ob_get_contents(); ob_end_clean(); // On parse le buffer pour mieux afficher le style $buffer = preg_replace('#.*?#si', '', $buffer); $buffer = preg_replace('#