From 73403645808a81425381f43c25e0ea2c92705312 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 25 Jul 2010 02:01:36 +0000 Subject: first go at brining tidypics up to code standards --- pages/server_analysis.php | 62 +++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'pages/server_analysis.php') diff --git a/pages/server_analysis.php b/pages/server_analysis.php index ccffc1632..db3aed5f6 100644 --- a/pages/server_analysis.php +++ b/pages/server_analysis.php @@ -8,48 +8,49 @@ * ********************************************************************/ - include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php"; +include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php"; - global $CONFIG; +global $CONFIG; - admin_gatekeeper(); +admin_gatekeeper(); - set_context('admin'); +set_context('admin'); - $title = 'TidyPics Server Analysis'; +$title = 'TidyPics Server Analysis'; - function tp_readable_size($bytes) - { - if (strpos($bytes, 'M')) - return $bytes . 'B'; - - $size = $bytes / 1024; +function tp_readable_size($bytes) { + if (strpos($bytes, 'M')) { + return $bytes . 'B'; + } + + $size = $bytes / 1024; + if ($size < 1024) { + $size = number_format($size, 2); + $size .= ' KB'; + } else { + $size = $size / 1024; if ($size < 1024) { $size = number_format($size, 2); - $size .= ' KB'; + $size .= ' MB'; } else { $size = $size / 1024; - if($size < 1024) { - $size = number_format($size, 2); - $size .= ' MB'; - } else { - $size = $size / 1024; - $size = number_format($size, 2); - $size .= ' GB'; - } + $size = number_format($size, 2); + $size .= ' GB'; } - return $size; } + return $size; +} - $disablefunc = explode(',', ini_get('disable_functions')); - $exec_avail = "Disabled"; - if (is_callable('exec') && !in_array('exec',$disablefunc)) - $exec_avail = "Enabled"; +$disablefunc = explode(',', ini_get('disable_functions')); +$exec_avail = "Disabled"; +if (is_callable('exec') && !in_array('exec',$disablefunc)) { + $exec_avail = "Enabled"; +} - ob_start(); +ob_start(); - echo elgg_view_title($title); +echo elgg_view_title($title); ?>
@@ -130,9 +131,8 @@ \ No newline at end of file +echo page_draw($title, $body); \ No newline at end of file -- cgit v1.2.3