选择文件 |
文件大小 |
修改时间 |
read()) {
//计算文件大小和创建时间
if ($file != "." && $file != ".." && !is_dir("$inpath/$file")) {
$filesize = filesize("$inpath/$file");
$filesize = $filesize / 1024;
if ($filesize != "")
if ($filesize < 0.1) {
@list($ty1, $ty2) = split("\.", $filesize);
$filesize = $ty1.".".substr($ty2, 0, 2);
} else {
@list($ty1, $ty2) = split("\.", $filesize);
$filesize = $ty1.".".substr($ty2, 0, 1);
}
$filetime = filemtime("$inpath/$file");
$filetime = MyDate("Y-m-d H:i", $filetime);
}
//判断文件类型并作处理
if ($file == ".") continue;
else if ($file == "..") {
if ($activepath == "") continue;
$tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath);
$line = "
上级目录 |
当前目录:$activepath |
\r\n";
echo $line;
} else if (is_dir("$inpath/$file")) {
if (preg_match("#^_(.*)$#i", $file)) continue;
if (preg_match("#^\.(.*)$#i", $file)) continue;
$line = "
$file |
|
|
";
echo "$line";
} else if (preg_match("#\.(zip|rar|tgr.gz)#i", $file)) {
if ($file == $comeback) $lstyle = " style='color:#dc3545' ";
else $lstyle = "";
$reurl = "$activeurl/$file";
$reurl = preg_replace("#^\.\.#", "", $reurl);
$reurl = $reurl;
$line = "
$file |
$filesize KB |
$filetime |
";
echo "$line";
} else {
if ($file == $comeback) $lstyle = " style='color:#dc3545' ";
else $lstyle = '';
$reurl = "$activeurl/$file";
$reurl = preg_replace("#^\.\.#", "", $reurl);
$reurl = $reurl;
$line = "
$file |
$filesize KB |
$filetime |
";
echo "$line";
}
}//End Loop
$dh->close();
?>
|