找到\ueditor\php/action_list.php 这个文件,修改function getfiles() 在return $files;的上面增加二句 在线管理图片不显示问题.查看这里的说明https://blog.csdn.net/viqecel/article/details/119214013
function getfiles($path, $allowFiles, &$files = array())
{
if (!is_dir($path)) return null;
if(substr($path, strlen($path) - 1) != '/') $path .= '/';
$handle = opendir($path);
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..') {
$path2 = $path . $file;
if (is_dir($path2)) {
getfiles($path2, $allowFiles, $files);
} else {
if (preg_match("/\.(".$allowFiles.")$/i", $file)) {
$files[] = array(
'url'=> substr($path2, strlen($_SERVER['DOCUMENT_ROOT'])),
'mtime'=> date("Y-m-d",filectime($path2))
);
}
}
}
}
$last_names = array_column($files,'mtime');
array_multisort($last_names,SORT_DESC,$files);
return $files;
}
二修改ueditor/dialogs/image/image.js
item.appendChild(img);
item.appendChild($("<span style='display:inline-block;width:100%;height:20px;position: absolute;top: 0;right: 0;background:#fff' >"+list[i].mtime+"</span>").click(function() {})[0]);
三,更新缓存.就是修改ueditor/dialogs/image/image.html 这个文件中的js
<script type="text/javascript" src="image.js"></script>
<script type="text/javascript" src="image.js?w=1"></script>
效果图
|