Dedecms生成的文件夹是按天生成的,只要传了图片就会自动建立年月日的文件,无论什么系统下,都是随便排序的,很难找到对应文件夹,如果要按顺序排列,要怎么操作呢?解决办法如下:
修改 /dede/templets/file_manage_main.html
$dh = dir($inpath); $ty1=""; $ty2=""; $files = $dirs = array(); while(($file = $dh->read()) !== false)
改成
$dh = scandir($inpath); $ty1=""; $ty2=""; $files = $dirs = array(); foreach ($dh as $file)
$dh->close();
<?php $dh = dir($templetdird); while($filename=$dh->read()) { if(!preg_match("#\.htm#", $filename)) continue; $filetime = filemtime($templetdird.'/'.$filename); $filetime = MyDate("Y-m-d H:i",$filetime); $fileinfo = (isset($fileinfos[$filename]) ? $fileinfos[$filename] : '未知模板'); ?>
改成
<?php $files = scandir($templetdird); foreach ($files as $filename) { if(!preg_match("#\.htm#", $filename)) continue; $filetime = filemtime($templetdird.'/'.$filename); $filetime = MyDate("Y-m-d H:i",$filetime); $fileinfo = (isset($fileinfos[$filename]) ? $fileinfos[$filename] : '未知模板'); ?>
$dh = dir($inpath); $ty1=""; $ty2=""; while($file = $dh->read())
改成
$dh = scandir($inpath); $ty1=""; $ty2=""; foreach ($dh as $file)
$dh->close();
评论前必须登录!
立即登录 注册