From 3b06ee0d381dc1be5f40ca98ad4278046d869d21 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 17 Nov 2019 20:57:39 +0100 Subject: checked in initial customized verison for Archlinux32 --- admin_statistics.php | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 admin_statistics.php (limited to 'admin_statistics.php') diff --git a/admin_statistics.php b/admin_statistics.php new file mode 100644 index 0000000..901e14c --- /dev/null +++ b/admin_statistics.php @@ -0,0 +1,139 @@ +query('SELECT COUNT(user_id) FROM '.$db->prefix.'online WHERE idle=0') or error('Unable to fetch online count', __FILE__, __LINE__, $db->error()); +$num_online = $db->result($result); + + +// Collect some additional info about MySQL +if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') +{ + // Calculate total db size/row count + $result = $db->query('SHOW TABLE STATUS LIKE \''.$db->prefix.'%\'') or error('Unable to fetch table status', __FILE__, __LINE__, $db->error()); + + $total_records = $total_size = 0; + while ($status = $db->fetch_assoc($result)) + { + $total_records += $status['Rows']; + $total_size += $status['Data_length'] + $status['Index_length']; + } + + $total_size = file_size($total_size); +} + + +// Check for the existence of various PHP opcode caches/optimizers +if (function_exists('mmcache')) + $php_accelerator = ''.$lang_admin_index['Turck MMCache'].''; +else if (isset($_PHPA)) + $php_accelerator = ''.$lang_admin_index['ionCube PHP Accelerator'].''; +else if (ini_get('apc.enabled')) + $php_accelerator =''.$lang_admin_index['Alternative PHP Cache (APC)'].''; +else if (ini_get('zend_optimizer.optimization_level')) + $php_accelerator = ''.$lang_admin_index['Zend Optimizer'].''; +else if (ini_get('eaccelerator.enable')) + $php_accelerator = ''.$lang_admin_index['eAccelerator'].''; +else if (ini_get('xcache.cacher')) + $php_accelerator = ''.$lang_admin_index['XCache'].''; +else + $php_accelerator = $lang_admin_index['NA']; + + +$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Server statistics']); +define('PUN_ACTIVE_PAGE', 'admin'); +require PUN_ROOT.'header.php'; + +generate_admin_menu('index'); + +?> +
+

+
+
+
+
+
+ +
+
+
+
+ '.$lang_admin_index['Show info'].'') ?>
+ +
+
+
+ get_version())."\n" ?> +
+
+
+ +
+
+
+
+
+ +