mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-22 00:48:44 +00:00
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) {
|
||||
$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;
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
RewriteEngine On
|
||||
RewriteRule ^$ /ams [R=301,L]
|
|
@ -42,7 +42,7 @@
|
|||
<tr>
|
||||
<td><a href="{$FILE_WEB_PATH}{$array['Path']}">{$array['Filename']}</a></td>
|
||||
<td>{$array['Timestamp']}</td>
|
||||
<td>{$array['Filesize']} Bytes</td>
|
||||
<td>{$array['Filesize']}</td>
|
||||
<td>{if $permission > 1}
|
||||
<a href="{$BASE_WEBPATH}index.php?page=show_user&id={$array['Uploader']}">{$array['Username']}</a>
|
||||
{else}
|
||||
|
|
Loading…
Reference in a new issue