点击名称选择文件 |
文件大小 |
最后修改时间 |
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:s", $filetime);
}
//------判断文件类型并作处理
if ($file == ".") continue;
else if ($file == "..") {
if ($activepath == "") continue;
$tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath);
$line = "\n
上级目录 |
当前目录:$activepath |
\r\n";
echo $line;
} else if (is_dir("$inpath/$file")) {
if (preg_match("#^_(.*)$#i", $file)) continue; #屏蔽FrontPage扩展目录和linux隐蔽目录
if (preg_match("#^\.(.*)$#i", $file)) continue;
$line = "\n
$file
|
- |
- |
";
echo "$line";
} else if (preg_match("#\.(swf|fly|fla|flv)#i", $file)) {
$reurl = "$activeurl/$file";
$reurl = preg_replace("#^\.\.#", "", $reurl);
$reurl = $reurl;
if ($file == $comeback) $lstyle = " style='color:red' ";
else $lstyle = "";
$line = "\n
$file
|
$filesize KB |
$filetime |
";
echo "$line";
} else if (preg_match("#\.(wmv|avi)#i", $file)) {
$reurl = "$activeurl/$file";
$reurl = preg_replace("#^\.\.#", "", $reurl);
$reurl = $reurl;
if ($file == $comeback) $lstyle = " style='color:red' ";
else $lstyle = "";
$line = "\n
$file
|
$filesize KB |
$filetime |
";
echo "$line";
} else if (preg_match("#\.(rm|rmvb)#i", $file)) {
$reurl = "$activeurl/$file";
$reurl = preg_replace("#^\.\.#", "", $reurl);
$reurl = $reurl;
if ($file == $comeback) $lstyle = " style='color:red' ";
else $lstyle = "";
$line = "\n
$file
|
$filesize KB |
$filetime |
";
echo "$line";
} else if (preg_match("#\.(mp3|wma)#", $file)) {
$reurl = "$activeurl/$file";
$reurl = preg_replace("#^\.\.#", "", $reurl);
$reurl = $reurl;
if ($file == $comeback) $lstyle = " style='color:red' ";
else $lstyle = "";
$line = "\n
$file
|
$filesize KB |
$filetime |
";
echo "$line";
}
} //End Loop
$dh->close();
?>
|