aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/admin
diff options
context:
space:
mode:
authorJames Atkinson <thefinn@users.sourceforge.net>2001-07-24 17:26:32 +0000
committerJames Atkinson <thefinn@users.sourceforge.net>2001-07-24 17:26:32 +0000
commit70b74fc706a8b79cae1625f773c2dabf82d18d15 (patch)
treea19c8e6df6467c6dc131865c9d7c8a7aee69f7f0 /phpBB/admin
parentd2cf278d445371ff5ee16311e78aa9c26342d041 (diff)
downloadforums-70b74fc706a8b79cae1625f773c2dabf82d18d15.tar
forums-70b74fc706a8b79cae1625f773c2dabf82d18d15.tar.gz
forums-70b74fc706a8b79cae1625f773c2dabf82d18d15.tar.bz2
forums-70b74fc706a8b79cae1625f773c2dabf82d18d15.tar.xz
forums-70b74fc706a8b79cae1625f773c2dabf82d18d15.zip
Cleaned up the stats view, added slightly better code for computing the avatar dir size
git-svn-id: file:///svn/phpbb/trunk@743 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/admin')
-rw-r--r--phpBB/admin/admin_index.php29
1 files changed, 23 insertions, 6 deletions
diff --git a/phpBB/admin/admin_index.php b/phpBB/admin/admin_index.php
index 4e3c2ecf0a..f80409510d 100644
--- a/phpBB/admin/admin_index.php
+++ b/phpBB/admin/admin_index.php
@@ -29,11 +29,14 @@ if($setmodules == 1)
return;
}
-if(!$from_index)
+if($from_index != 1)
{
$phpbb_root_path = "./../";
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
+
+ $template_header = "admin/page_header.tpl";
+ include('page_header_admin.'.$phpEx);
}
//
@@ -86,10 +89,24 @@ if ($avatar_dir = opendir($phpbb_root_path . $board_config['avatar_path']))
}
closedir($avatar_dir);
}
-if($avatar_dir_size > 0)
-{
- $avatar_dir_size = sprintf("%.2f", $avatar_dir_size / 1024);
-}
+
+//
+// This bit of code translates the avatar directory size into human readable format
+// Borrowed the code from the PHP.net annoted manual, origanally written by:
+// Jesse (jesse@jess.on.ca)
+//
+if($avatar_dir_size >= 1048576)
+{
+ $avatar_dir_size = round($avatar_dir_size / 1048576 * 100) / 100 . "MB";
+}
+else if($avatar_dir_size >= 1024)
+{
+ $avatar_dir_size = round($avatar_dir_size / 1024 * 100) / 100 . "KB";
+}
+else
+{
+ $avatar_dir_size = $avatar_dir_size . "Bytes";
+}
if($posts_per_day > $total_posts)
{
@@ -265,7 +282,7 @@ $template->assign_vars(array("L_USERNAME" => $lang['Username'],
$template->pparse("body");
-if(!$from_index)
+if($from_index != 1)
{
include('page_footer_admin.'.$phpEx);
}