百度编辑器UEditor 在线管理 图片不显示问题

阅读: 评论:0

百度编辑器UEditor 在线管理 图片不显示问题

百度编辑器UEditor 在线管理 图片不显示问题

一,先找到ueditorphp这个文件夹,找到config.json,配置里面的图片路径,75行左右
如果图片路径是按时间归类的.还里设置好后.还需要在php文件中进行替换

/* 列出指定目录下的图片 */"imageManagerActionName": "listimage", /* 执行图片管理的action名称 */"imageManagerListPath": "/Uploads/Editor/Picture/{yyyy}-{mm}-{dd}/", /* 指定要列出图片的目录 */"imageManagerListSize": 20, /* 每次列出文件数量 */"imageManagerUrlPrefix": "", /* 图片访问路径前缀 */"imageManagerInsertAlign": "none", /* 插入的图片浮动方式 */"imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 列出的文件类型 */

二,找到ueditorphp/action_list.php 这个文件.修改
40行左右这里的路径要正确

$rootpath = str_replace('/Public/admin/ueditor/php/action_list.php', '', str_replace('\', '/', __FILE__));

三,这个文件中要增加测试文件.查看打印出来的路径是多少,类似下面的打印结果.根本情况修改.或直接写死了,比如你可以直接定义$path =“D:/phpstudy_pro/WWW/Uploads/Editor/Picture/”;这样

		file_put_contents(&#',$path);///Uploads/Editor/Picture/{yyyy}-{mm}-{dd}/file_put_contents(&#',$path);//D:/phpstudy_pro/WWW//Uploads/Editor/Picture/2021-07-29/
/* 获取文件列表 */
//$path = $_SERVER['DOCUMENT_ROOT'].'/'.end($rootpath) . (substr($path, 0, 1) == "/" ? "":"/") . $path;$path = $_SERVER['DOCUMENT_ROOT'].'/'. (substr($path, 0, 1) == "/" ? "":"/") . $path;$t = time();$d = explode('-', date("Y-m-d-H-i-s"));//  $path = $path;// file_put_contents(&#',$d );$path = str_replace("{yyyy}", $d[0], $path);//转为当时的日期.比如2021/07/29///file_put_contents(&#',$path);$path = str_replace("{mm}", $d[1], $path);$path = str_replace("{dd}", $d[2], $path);$path = str_replace("//", "/", $path);//替换掉重复的斜线
//Uploads/Editor/Picture/{yyyy}{mm}{dd}/
//$path ="D:/phpstudy_pro/WWW/Uploads/Editor/Picture/";
file_put_contents(&#',$path);//D:/phpstudy_pro/WWW/WWW/Uploads/img/

最终效果

本文发布于:2024-02-03 02:29:50,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170689858748047.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:在线   编辑器   图片   UEditor
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23