-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
uploads.php
31 lines (26 loc) · 924 Bytes
/
uploads.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
function CastToXBytes($size)
{
if ($size < 1024) {
$result = $size . " b";
} elseif ($size < 1048576) {
$result = ($size / 1024.0) . " kb";
} elseif ($size < 1073741824) {
$result = ($size / 1048576.0) . " mb";
} else {
$result = ($size / 1073741824.0) . " gb";
}
return $result;
}
$uploads = amule_load_vars("uploads");
echo '<ul data-role="listview">';
echo '<li data-role="list-divider">Uploads<span class="ui-li-count">' . count($uploads) . '</span></li>';
foreach ($uploads as $file) {
echo '<li data-filtertext="', $file->name, '">';
echo "<h3>", $file->name, "</h3>";
echo "<p>", $file->user_name, " - ", CastToXBytes($file->xfer_up), "up - ",
CastToXBytes($file->xfer_down), "down - ", ($file->xfer_speed > 0) ? (CastToXBytes($file->xfer_speed) . "/s") : "", "</p>";
echo "</li>";
}
echo '</ul>';
?>