Made filesize friendly
This commit is contained in:
parent
e8bcdc75eb
commit
220d0edd3e
3 changed files with 13 additions and 3 deletions
|
@ -216,6 +216,18 @@ class Ticket{
|
||||||
foreach ($fetchall as &$value) {
|
foreach ($fetchall as &$value) {
|
||||||
$webUser = new WebUsers($value['Uploader']);
|
$webUser = new WebUsers($value['Uploader']);
|
||||||
$fetchall[$base]['Username'] = $webUser->getUsername();
|
$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++;
|
$base++;
|
||||||
}
|
}
|
||||||
return $fetchall;
|
return $fetchall;
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
RewriteEngine On
|
|
||||||
RewriteRule ^$ /ams [R=301,L]
|
|
|
@ -42,7 +42,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{$FILE_WEB_PATH}{$array['Path']}">{$array['Filename']}</a></td>
|
<td><a href="{$FILE_WEB_PATH}{$array['Path']}">{$array['Filename']}</a></td>
|
||||||
<td>{$array['Timestamp']}</td>
|
<td>{$array['Timestamp']}</td>
|
||||||
<td>{$array['Filesize']} Bytes</td>
|
<td>{$array['Filesize']}</td>
|
||||||
<td>{if $permission > 1}
|
<td>{if $permission > 1}
|
||||||
<a href="{$BASE_WEBPATH}index.php?page=show_user&id={$array['Uploader']}">{$array['Username']}</a>
|
<a href="{$BASE_WEBPATH}index.php?page=show_user&id={$array['Uploader']}">{$array['Username']}</a>
|
||||||
{else}
|
{else}
|
||||||
|
|
Loading…
Reference in a new issue