From ce582a0037b4d544a33dd4ce8905ea5c113ddc62 Mon Sep 17 00:00:00 2001 From: James Atkinson Date: Mon, 23 Jul 2001 19:22:27 +0000 Subject: [PATCH] Almost done, just gotta figure out how to get the database size git-svn-id: file:///svn/phpbb/trunk@736 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_index.php | 28 +++++++++++++++++-- .../templates/PSO/admin/admin_index_body.tpl | 2 +- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/phpBB/admin/admin_index.php b/phpBB/admin/admin_index.php index d84a6742f3..791a115bb0 100644 --- a/phpBB/admin/admin_index.php +++ b/phpBB/admin/admin_index.php @@ -73,6 +73,24 @@ $posts_per_day = sprintf("%.2f", $total_posts / $boarddays); $topics_per_day = sprintf("%.2f", $total_topics / $boarddays); $users_per_day = sprintf("%.2f", $total_users / $boarddays); +$avatar_dir_size = 0; + +if ($avatar_dir = opendir($phpbb_root_path . $board_config['avatar_path'])) +{ + while($file = readdir($avatar_dir)) + { + if($file != "." && $file != "..") + { + $avatar_dir_size += filesize($file); + } + } + closedir($openDir); +} +if($avatar_dir_size > 0) +{ + $avatar_dir_size /= 1024; +} + if($posts_per_day > $total_posts) { $posts_per_day = $total_posts; @@ -95,7 +113,8 @@ $template->assign_vars(array("NUMBER_OF_POSTS" => $total_posts, "STARTDATE" => $start_date, "POSTS_PER_DAY" => $posts_per_day, "TOPICS_PER_DAY" => $topics_per_day, - "USERS_PER_DAY" => $users_per_day)); + "USERS_PER_DAY" => $users_per_day, + "AVATAR_DIR_SIZE" => $avatar_dir_size)); // // End forum statistics // @@ -214,8 +233,11 @@ if($online_count) $count++; $ip_address = decode_ip($onlinerow[$i]['session_ip']); - $host_name = gethostbyaddr($ip_address); - $ip_address = $ip_address . " ($host_name)"; +// +// This resolves the users IP to a host name, but it REALLY slows the page down +// +// $host_name = gethostbyaddr($ip_address); +// $ip_address = $ip_address . " ($host_name)"; if(empty($username)) { diff --git a/phpBB/templates/PSO/admin/admin_index_body.tpl b/phpBB/templates/PSO/admin/admin_index_body.tpl index 7e4664ffbe..a4a0f45ebf 100644 --- a/phpBB/templates/PSO/admin/admin_index_body.tpl +++ b/phpBB/templates/PSO/admin/admin_index_body.tpl @@ -17,7 +17,7 @@ Topics per day: {TOPICS_PER_DAY}
Users per day: {USERS_PER_DAY}

- Avatar directory size: {AVATAR_DIR_SIZE}
+ Avatar directory size: {AVATAR_DIR_SIZE} (in kilobytes)
Database size: {DB_SIZE}