|
@@ -125,117 +125,104 @@ table{background:#fff} |
|
|
</script> |
|
|
</script> |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="1" align="center" class="table table-borderless"> |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="1" align="center" class="table table-borderless"> |
|
|
<tr> |
|
|
<tr> |
|
|
<td colspan="4"> |
|
|
|
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="2"> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td width="10%" class="linerow">预览</td> |
|
|
|
|
|
<td width="40%" class="linerow">选择图片</td> |
|
|
|
|
|
<td width="20%" class="linerow">文件大小</td> |
|
|
|
|
|
<td width="30%" class="linerow">修改时间</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td class="linerow" colspan="4">点击图片预览,点击图片名选择图片,显示图片后点击该图片关闭预览。</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<?php |
|
|
|
|
|
$dh = dir($inpath); |
|
|
|
|
|
$ty1 = ""; |
|
|
|
|
|
$ty2 = ""; |
|
|
|
|
|
while ($file = $dh->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 = "<tr> |
|
|
|
|
|
<td class='linerow' colspan='2'> |
|
|
|
|
|
<a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=".urlencode($tmp).$addparm."'><img src='img/dir2.gif'>上级目录</a></td> |
|
|
|
|
|
<td colspan='2' class='linerow'>当前目录:$activepath</td> |
|
|
|
|
|
</tr>"; |
|
|
|
|
|
echo $line; |
|
|
|
|
|
} else if (is_dir("$inpath/$file")) { |
|
|
|
|
|
if (preg_match("#^_(.*)$#i", $file)) continue; |
|
|
|
|
|
if (preg_match("#^\.(.*)$#i", $file)) continue; |
|
|
|
|
|
$line = "<tr> |
|
|
|
|
|
<td class='linerow' colspan='2'> |
|
|
|
|
|
<a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=".urlencode("$activepath/$file").$addparm."'><img src='img/dir.gif'>$file</a></td> |
|
|
|
|
|
<td class='linerow'></td> |
|
|
|
|
|
<td class='linerow'></td> |
|
|
|
|
|
</tr>"; |
|
|
|
|
|
echo "$line"; |
|
|
|
|
|
} else if (preg_match("#\.(".$cfg_imgtype.")#i", $file)) { |
|
|
|
|
|
$reurl = "$activeurl/$file"; |
|
|
|
|
|
$reurl = preg_replace("#^\.\.#", "", $reurl); |
|
|
|
|
|
$reurl = $reurl; |
|
|
|
|
|
if ($file == $comeback) $lstyle = " style='color:red' "; |
|
|
|
|
|
else $lstyle = ""; |
|
|
|
|
|
$line = "<tr> |
|
|
|
|
|
<td class='linerow'><a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='img/picviewnone.gif'></a> |
|
|
|
|
|
</td> |
|
|
|
|
|
<td class='linerow'><a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src='img/gif.gif'>$file</a></td> |
|
|
|
|
|
<td class='linerow'>$filesize KB</td> |
|
|
|
|
|
<td class='linerow'>$filetime</td> |
|
|
|
|
|
</tr>"; |
|
|
|
|
|
echo "$line"; |
|
|
|
|
|
} else if (preg_match("#\.(jpg)#i", $file)) { |
|
|
|
|
|
$reurl = "$activeurl/$file"; |
|
|
|
|
|
$reurl = preg_replace("#^\.\.#", "", $reurl); |
|
|
|
|
|
$reurl = $reurl; |
|
|
|
|
|
if ($file == $comeback) $lstyle = " style='color:red' "; |
|
|
|
|
|
else $lstyle = ""; |
|
|
|
|
|
$line = "<tr> |
|
|
|
|
|
<td class='linerow'><a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='img/picviewnone.gif'></a></td> |
|
|
|
|
|
<td class='linerow'><a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src='img/jpg.gif'>$file</a></td> |
|
|
|
|
|
<td class='linerow'>$filesize KB</td> |
|
|
|
|
|
<td class='linerow'>$filetime</td> |
|
|
|
|
|
</tr>"; |
|
|
|
|
|
echo "$line"; |
|
|
|
|
|
} |
|
|
|
|
|
}//End Loop |
|
|
|
|
|
$dh->close(); |
|
|
|
|
|
?> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td colspan="4"> |
|
|
|
|
|
<table width="100%"> |
|
|
|
|
|
<form action="select_images_post.php" method="POST" enctype="multipart/form-data" name="myform"> |
|
|
|
|
|
<?php $noeditor = !empty($noeditor) ? "<input type='hidden' name='noeditor' value='yes'>" : ''; |
|
|
|
|
|
echo $noeditor; ?> |
|
|
|
|
|
<input type="hidden" name="activepath" value="<?php echo $activepath ?>"> |
|
|
|
|
|
<input type="hidden" name="f" value="<?php echo $f ?>"> |
|
|
|
|
|
<input type="hidden" name="v" value="<?php echo $v ?>"> |
|
|
|
|
|
<input type="hidden" name="imgstick" value="<?php echo $imgstick ?>"> |
|
|
|
|
|
<input type="hidden" name="CKEditorFuncNum" value="<?php echo isset($CKEditorFuncNum) ? $CKEditorFuncNum : 1; ?>"> |
|
|
|
|
|
<input type="hidden" name="job" value="upload"> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td> |
|
|
|
|
|
上传:<input type="file" name="imgfile" style="width:160px;border:none"> |
|
|
|
|
|
<label><input type="checkbox" name="needwatermark" value="1" class="np" <?php if ($photo_markup == '1') echo "checked"; ?> /> 水印 </label> |
|
|
|
|
|
<label><input type="checkbox" name="resize" value="1" class="np"> 缩小 </label> |
|
|
|
|
|
宽:<input type="text" name="iwidth" value="<?php echo $cfg_ddimg_width ?>" style="width:46px"> |
|
|
|
|
|
高:<input type="text" name="iheight" value="<?php echo $cfg_ddimg_height ?>" style="width:46px"> |
|
|
|
|
|
<button type="submit" name="sb1" class="btn btn-success btn-sm">确定</button> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</form> |
|
|
|
|
|
</table> |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
</table> |
|
|
|
|
|
|
|
|
<td colspan="4" height="30"> |
|
|
|
|
|
<form action="select_images_post.php" method="POST" enctype="multipart/form-data" name="myform"> |
|
|
|
|
|
<?php $noeditor = !empty($noeditor) ? "<input type='hidden' name='noeditor' value='yes'>" : ''; echo $noeditor; ?> |
|
|
|
|
|
<input type="hidden" name="activepath" value="<?php echo $activepath ?>"> |
|
|
|
|
|
<input type="hidden" name="f" value="<?php echo $f ?>"> |
|
|
|
|
|
<input type="hidden" name="v" value="<?php echo $v ?>"> |
|
|
|
|
|
<input type="hidden" name="imgstick" value="<?php echo $imgstick ?>"> |
|
|
|
|
|
<input type="hidden" name="CKEditorFuncNum" value="<?php echo isset($CKEditorFuncNum) ? $CKEditorFuncNum : 1; ?>"> |
|
|
|
|
|
<input type="hidden" name="job" value="upload"> |
|
|
|
|
|
上传:<input type="file" name="imgfile" style="width:160px;border:none"> |
|
|
|
|
|
<label><input type="checkbox" name="needwatermark" value="1" class="np" <?php if ($photo_markup == '1') echo "checked"; ?> /> 水印 </label> |
|
|
|
|
|
<label><input type="checkbox" name="resize" value="1" class="np"> 缩小 </label> |
|
|
|
|
|
宽:<input type="text" name="iwidth" value="<?php echo $cfg_ddimg_width ?>" style="width:46px"> |
|
|
|
|
|
高:<input type="text" name="iheight" value="<?php echo $cfg_ddimg_height ?>" style="width:46px"> |
|
|
|
|
|
<button type="submit" name="sb1" class="btn btn-success btn-sm">确定</button> |
|
|
|
|
|
</form> |
|
|
</td> |
|
|
</td> |
|
|
</tr> |
|
|
</tr> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td width="10%" class="linerow">预览</td> |
|
|
|
|
|
<td width="40%" class="linerow">选择图片</td> |
|
|
|
|
|
<td width="20%" class="linerow">文件大小</td> |
|
|
|
|
|
<td width="30%" class="linerow">修改时间</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td class="linerow" colspan="4">点击图片预览,点击图片名选择图片,显示图片后点击该图片关闭预览。</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
<?php |
|
|
|
|
|
$dh = dir($inpath); |
|
|
|
|
|
$ty1 = ""; |
|
|
|
|
|
$ty2 = ""; |
|
|
|
|
|
while ($file = $dh->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 = "<tr> |
|
|
|
|
|
<td class='linerow' colspan='2'> |
|
|
|
|
|
<a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=".urlencode($tmp).$addparm."'><img src='img/dir2.gif'>上级目录</a></td> |
|
|
|
|
|
<td colspan='2' class='linerow'>当前目录:$activepath</td> |
|
|
|
|
|
</tr>"; |
|
|
|
|
|
echo $line; |
|
|
|
|
|
} else if (is_dir("$inpath/$file")) { |
|
|
|
|
|
if (preg_match("#^_(.*)$#i", $file)) continue; |
|
|
|
|
|
if (preg_match("#^\.(.*)$#i", $file)) continue; |
|
|
|
|
|
$line = "<tr> |
|
|
|
|
|
<td class='linerow' colspan='2'> |
|
|
|
|
|
<a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=".urlencode("$activepath/$file").$addparm."'><img src='img/dir.gif'>$file</a></td> |
|
|
|
|
|
<td class='linerow'></td> |
|
|
|
|
|
<td class='linerow'></td> |
|
|
|
|
|
</tr>"; |
|
|
|
|
|
echo "$line"; |
|
|
|
|
|
} else if (preg_match("#\.(".$cfg_imgtype.")#i", $file)) { |
|
|
|
|
|
$reurl = "$activeurl/$file"; |
|
|
|
|
|
$reurl = preg_replace("#^\.\.#", "", $reurl); |
|
|
|
|
|
$reurl = $reurl; |
|
|
|
|
|
if ($file == $comeback) $lstyle = " style='color:red' "; |
|
|
|
|
|
else $lstyle = ""; |
|
|
|
|
|
$line = "<tr> |
|
|
|
|
|
<td class='linerow'><a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='img/picviewnone.gif'></a></td> |
|
|
|
|
|
<td class='linerow'><a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src='img/gif.gif'>$file</a></td> |
|
|
|
|
|
<td class='linerow'>$filesize KB</td> |
|
|
|
|
|
<td class='linerow'>$filetime</td> |
|
|
|
|
|
</tr>"; |
|
|
|
|
|
echo "$line"; |
|
|
|
|
|
} else if (preg_match("#\.(jpg)#i", $file)) { |
|
|
|
|
|
$reurl = "$activeurl/$file"; |
|
|
|
|
|
$reurl = preg_replace("#^\.\.#", "", $reurl); |
|
|
|
|
|
$reurl = $reurl; |
|
|
|
|
|
if ($file == $comeback) $lstyle = " style='color:red' "; |
|
|
|
|
|
else $lstyle = ""; |
|
|
|
|
|
$line = "<tr> |
|
|
|
|
|
<td class='linerow'><a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='img/picviewnone.gif'></a></td> |
|
|
|
|
|
<td class='linerow'><a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src='img/jpg.gif'>$file</a></td> |
|
|
|
|
|
<td class='linerow'>$filesize KB</td> |
|
|
|
|
|
<td class='linerow'>$filetime</td> |
|
|
|
|
|
</tr>"; |
|
|
|
|
|
echo "$line"; |
|
|
|
|
|
} |
|
|
|
|
|
}//End Loop |
|
|
|
|
|
$dh->close(); |
|
|
|
|
|
?> |
|
|
|
|
|
</tr> |
|
|
</table> |
|
|
</table> |
|
|
</body> |
|
|
</body> |
|
|
</html> |
|
|
</html> |