summaryrefslogtreecommitdiffstats
path: root/lib/class/user.class.php
diff options
context:
space:
mode:
authorPaul 'flowerysong' Arthur <flowerysong00@yahoo.com>2010-10-15 19:16:42 +0000
committerPaul 'flowerysong' Arthur <flowerysong00@yahoo.com>2010-10-15 19:16:42 +0000
commit63031fb6c1b3dc31d2d9cc1d0e7148c827656922 (patch)
tree5c3b60b2cffaff77b64461155fcaab9c345f4d1d /lib/class/user.class.php
parent680e9f6206de1e17cdc63ebec498f6ebafa667b6 (diff)
downloadampache-63031fb6c1b3dc31d2d9cc1d0e7148c827656922.tar.gz
ampache-63031fb6c1b3dc31d2d9cc1d0e7148c827656922.tar.bz2
ampache-63031fb6c1b3dc31d2d9cc1d0e7148c827656922.zip
Use a function to format bytes -> human-readable sizes. Also bump catalog build
memory profiling logging to level 5; fixes FS#141.
Diffstat (limited to 'lib/class/user.class.php')
-rw-r--r--lib/class/user.class.php18
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/class/user.class.php b/lib/class/user.class.php
index de759378..7649df31 100644
--- a/lib/class/user.class.php
+++ b/lib/class/user.class.php
@@ -699,23 +699,7 @@ class User extends database_object {
$total = $total + $r['size'];
}
- $divided = 0;
-
- while (strlen(floor($total)) > 3) {
- $total = ($total / 1024);
- $divided++;
- }
-
- switch ($divided) {
- default:
- case '1': $name = "KB"; break;
- case '2': $name = "MB"; break;
- case '3': $name = "GB"; break;
- case '4': $name = "TB"; break;
- case '5': $name = "PB"; break;
- } // end switch
-
- $this->f_useage = round($total,2) . $name;
+ $this->f_useage = format_bytes($total);
/* Get Users Last ip */
if (count($data = $this->get_ip_history(1))) {