diff options
author | James Atkinson <thefinn@users.sourceforge.net> | 2001-07-24 17:26:32 +0000 |
---|---|---|
committer | James Atkinson <thefinn@users.sourceforge.net> | 2001-07-24 17:26:32 +0000 |
commit | 70b74fc706a8b79cae1625f773c2dabf82d18d15 (patch) | |
tree | a19c8e6df6467c6dc131865c9d7c8a7aee69f7f0 | |
parent | d2cf278d445371ff5ee16311e78aa9c26342d041 (diff) | |
download | forums-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
-rw-r--r-- | phpBB/admin/admin_index.php | 29 | ||||
-rw-r--r-- | phpBB/templates/PSO/admin/admin_index_body.tpl | 61 |
2 files changed, 71 insertions, 19 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); } diff --git a/phpBB/templates/PSO/admin/admin_index_body.tpl b/phpBB/templates/PSO/admin/admin_index_body.tpl index a4a0f45ebf..c3f61d7eab 100644 --- a/phpBB/templates/PSO/admin/admin_index_body.tpl +++ b/phpBB/templates/PSO/admin/admin_index_body.tpl @@ -7,19 +7,54 @@ <h2>Forum Statistics</h2> -<p> - Current number of posts: <b>{NUMBER_OF_POSTS}</b><br /> - Current number of topics: <b>{NUMBER_OF_TOPICS}</b><br /> - Current number of users: <b>{NUMBER_OF_USERS}</b><br /> - <br /> - Board started on: <b>{STARTDATE}</b><br /> - Posts per day: <b>{POSTS_PER_DAY}</b><br /> - Topics per day: <b>{TOPICS_PER_DAY}</b><br /> - Users per day: <b>{USERS_PER_DAY}</b><br /> - <br /> - Avatar directory size: <b>{AVATAR_DIR_SIZE} (in kilobytes)</b><br /> - Database size: <b>{DB_SIZE}</b> -</p> +<table border="0" cellpadding="1" cellspacing="0" width="65%"> + <tr> + <td class="tablebg"> + <table width="100%" cellpadding="4" cellspacing="1" border="0"> + <tr> + <th width="50%">Statistic</th> + <th width="50%">Value</th> + </tr> + <tr> + <td class="row1">Current number of posts:</td> + <td class="row2"><b>{NUMBER_OF_POSTS}</b></td> + </tr> + <tr> + <td class="row1">Current number of topics:</td> + <td class="row2"><b>{NUMBER_OF_TOPICS}</b></td> + </tr> + <tr> + <td class="row1">Current number of users:</td> + <td class="row2"><b>{NUMBER_OF_USERS}</b></td> + </tr> + <tr> + <td class="row1">Board started on:</td> + <td class="row2"><b>{STARTDATE}</b></td> + </tr> + <tr> + <td class="row1">Posts per day:</td> + <td class="row2"><b>{POSTS_PER_DAY}</b></td> + </tr> + <tr> + <td class="row1">Topics per day:</td> + <td class="row2"><b>{TOPICS_PER_DAY}</b></td> + </tr> + <tr> + <td class="row1">Users per day:</td> + <td class="row2"><b>{USERS_PER_DAY}</b></td> + </tr> + <tr> + <td class="row1">Avatar directory size:</td> + <td class="row2"><b>{AVATAR_DIR_SIZE}</b></td> + </tr> + <tr> + <td class="row1">Database size:</td> + <td class="row2"><b>{DB_SIZE}</b></td> + </tr> + </table> + </td> + </tr> +</table> <h2>Users Online</h2> <table border="0" cellpadding="1" cellspacing="0" width="98%" align="center"> |