@@ -87,7 +87,25 @@ if (!empty($iseditor)) { | |||
<div class="card-body opt"> | |||
<?php | |||
$dh = scandir($inpath); | |||
$ty1 = ""; | |||
$ty2 = ""; | |||
foreach ($dh as $file) { | |||
//计算文件大小和创建时间 | |||
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; | |||
@@ -108,11 +126,11 @@ if (!empty($iseditor)) { | |||
</div>"; | |||
echo "$line"; | |||
} else if (preg_match("#\.(".$cfg_imgtype.")#i", $file)) { | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
$reurl = $reurl; | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | |||
$line = "<div class='list'> | |||
<a href='$reurl' onclick=\"ReturnImg('$reurl');\" $lstyle> | |||
<img src='$reurl' title='$file'> | |||
@@ -121,11 +139,11 @@ if (!empty($iseditor)) { | |||
</div>"; | |||
echo "$line"; | |||
} else if (preg_match("#\.(jpg)#i", $file)) { | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
$reurl = $reurl; | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | |||
$line = "<div class='list'> | |||
<a href='$reurl' onclick=\"ReturnImg('$reurl');\" $lstyle> | |||
<img src='$reurl' title='$file'> | |||
@@ -79,8 +79,8 @@ if (!empty($noeditor)) { | |||
<tbody> | |||
<?php | |||
$dh = scandir($inpath); | |||
$ty1 = ''; | |||
$ty2 = ''; | |||
$ty1 = ""; | |||
$ty2 = ""; | |||
foreach ($dh as $file) { | |||
//计算文件大小和创建时间 | |||
if ($file != "." && $file != ".." && !is_dir("$inpath/$file")) { | |||
@@ -115,10 +115,11 @@ if (!empty($noeditor)) { | |||
</tr>"; | |||
echo "$line"; | |||
} else if (preg_match("#\.(swf|fly|fla|flv)#i", $file)) { | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | |||
$line = "<tr> | |||
<td><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='/static/web/img/icon_flash.png'> $file</a></td> | |||
<td>$filesize KB</td> | |||
@@ -126,10 +127,11 @@ if (!empty($noeditor)) { | |||
</tr>"; | |||
echo "$line"; | |||
} else if (preg_match("#\.(wmv|avi)#i", $file)) { | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | |||
$line = "<tr> | |||
<td><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='/static/web/img/icon_video.png'> $file</a></td> | |||
<td>$filesize KB</td> | |||
@@ -137,10 +139,11 @@ if (!empty($noeditor)) { | |||
</tr>"; | |||
echo "$line"; | |||
} else if (preg_match("#\.(rm|rmvb|mp3|mp4)#i", $file)) { | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | |||
$line = "<tr> | |||
<td><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='/static/web/img/icon_rm.png'> $file</a></td> | |||
<td>$filesize KB</td> | |||
@@ -148,10 +151,11 @@ if (!empty($noeditor)) { | |||
</tr>"; | |||
echo "$line"; | |||
} else if (preg_match("#\.(mp3|wma)#", $file)) { | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | |||
$line = "<tr> | |||
<td><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='/static/web/img/icon_music.png'> $file</a></td> | |||
<td>$filesize KB</td> | |||
@@ -53,7 +53,7 @@ if (!empty($noeditor)) { | |||
<body class="p-3"> | |||
<div class="card shadow-sm mb-3"> | |||
<div class="card-body"> | |||
<form name="myform" action="select_soft_post.php" method="POST" enctype="multipart/form-data"> | |||
<form name="myform" action="select_soft_post.php" method="POST" enctype="multipart/form-data"> | |||
<input type="hidden" name="activepath" value="<?php echo $activepath ?>"> | |||
<?php $noeditor = !empty($noeditor) ? "<input type='hidden' name='noeditor' value='yes'>" : ''; echo $noeditor;?> | |||
<input type="hidden" name="f" value="<?php echo $f ?>"> | |||
@@ -78,21 +78,22 @@ if (!empty($noeditor)) { | |||
</thead> | |||
<tbody> | |||
<?php | |||
$dh = scandir($inpath); | |||
$ty1 = $ty2 = ''; | |||
foreach ($dh as $file) { | |||
$dh = scandir($inpath); | |||
$ty1 = ""; | |||
$ty2 = ""; | |||
foreach ($dh as $file) { | |||
//计算文件大小和创建时间 | |||
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); | |||
} | |||
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); | |||
} | |||
@@ -114,11 +115,10 @@ if (!empty($noeditor)) { | |||
</tr>"; | |||
echo "$line"; | |||
} else if (preg_match("#\.(zip|rar|tgr.gz)#i", $file)) { | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
$reurl = $reurl; | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ""; | |||
$line = "<tr> | |||
<td><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='/static/web/img/icon_zip.png'> $file</a></td> | |||
<td>$filesize KB</td> | |||
@@ -126,11 +126,10 @@ if (!empty($noeditor)) { | |||
</tr>"; | |||
echo "$line"; | |||
} else { | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
$reurl = $reurl; | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ""; | |||
$line = "<tr> | |||
<td><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='/static/web/img/icon_exe.png'> $file</a></td> | |||
<td>$filesize KB</td> | |||
@@ -69,8 +69,8 @@ if (empty($comeback)) { | |||
<tbody> | |||
<?php | |||
$dh = scandir($inpath); | |||
$ty1 = ''; | |||
$ty2 = ''; | |||
$ty1 = ""; | |||
$ty2 = ""; | |||
foreach ($dh as $file) { | |||
//计算文件大小和创建时间 | |||
if ($file != "." && $file != ".." && !is_dir("$inpath/$file")) { | |||
@@ -105,11 +105,10 @@ if (empty($comeback)) { | |||
</tr>"; | |||
echo "$line"; | |||
} else if (preg_match("#\.(htm|html)#i", $file)) { | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ""; | |||
$line = "<tr> | |||
<td><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='/static/web/img/icon_htm.png'> $file</a></td> | |||
<td>$filesize KB</td> | |||
@@ -129,11 +128,10 @@ if (empty($comeback)) { | |||
</tr>"; | |||
echo "$line"; | |||
} else if (preg_match("#\.(js)#i", $file)) { | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ""; | |||
$line = "<tr> | |||
<td><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='/static/web/img/icon_js.png'> $file</a></td> | |||
<td>$filesize KB</td> | |||
@@ -141,11 +139,10 @@ if (empty($comeback)) { | |||
</tr>"; | |||
echo "$line"; | |||
} else if (preg_match("#\.(jpg)#i", $file)) { | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ""; | |||
$line = "<tr> | |||
<td><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='$reurl'> $file</a></td> | |||
<td>$filesize KB</td> | |||
@@ -153,11 +150,10 @@ if (empty($comeback)) { | |||
</tr>"; | |||
echo "$line"; | |||
} else if (preg_match("#\.(gif|png)#i", $file)) { | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ""; | |||
$line = "<tr> | |||
<td><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='$reurl'> $file</a></td> | |||
<td>$filesize KB</td> | |||
@@ -165,11 +161,10 @@ if (empty($comeback)) { | |||
</tr>"; | |||
echo "$line"; | |||
} else if (preg_match("#\.(txt)#i", $file)) { | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ''; | |||
$reurl = "$activeurl/$file"; | |||
$reurl = preg_replace("#\.\.#", "", $reurl); | |||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | |||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||
if ($file == $comeback) $lstyle = "class='text-danger'"; | |||
else $lstyle = ""; | |||
$line = "<tr> | |||
<td><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='/static/web/img/icon_text.png'> $file</a></td> | |||
<td>$filesize KB</td> | |||