diff --git a/code/web/private_php/ams/autoload/ticket.php b/code/web/private_php/ams/autoload/ticket.php index 013dad842..e6af8e188 100644 --- a/code/web/private_php/ams/autoload/ticket.php +++ b/code/web/private_php/ams/autoload/ticket.php @@ -216,6 +216,18 @@ class Ticket{ foreach ($fetchall as &$value) { $webUser = new WebUsers($value['Uploader']); $fetchall[$base]['Username'] = $webUser->getUsername(); + + $bytes = $fetchall[$base]['Filesize']; + $precision = 2; + $units = array('B', 'KB', 'MB', 'GB', 'TB'); + + $bytes = max($bytes, 0); + $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); + $pow = min($pow, count($units) - 1); + + $bytes /= pow(1024, $pow); + + $fetchall[$base]['Filesize'] = round($bytes, $precision) . ' ' . $units[$pow];; $base++; } return $fetchall; diff --git a/code/web/public_php/.htaccess b/code/web/public_php/.htaccess deleted file mode 100644 index c0b74b60d..000000000 --- a/code/web/public_php/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ -RewriteEngine On -RewriteRule ^$ /ams [R=301,L] diff --git a/code/web/public_php/ams/templates/show_ticket.tpl b/code/web/public_php/ams/templates/show_ticket.tpl index b832f29b1..deed7c0af 100644 --- a/code/web/public_php/ams/templates/show_ticket.tpl +++ b/code/web/public_php/ams/templates/show_ticket.tpl @@ -42,7 +42,7 @@