dedecms如何更换ueditor最新版 1.4.3.3

2024-11-17 00:00:56

1、去百度编辑器官网下载最新的插件,http://ueditor.baidu.com/website/download.html#ueditor 选择[1.4.3.3 PHP 版本] UTF-8 版本,下载完成之后把文件夹(utf8-php)改名为 ueditor

2、把改完名字之后的ueditor 文件夹复制到 dedecms 根目录下的include 文件夹之中

3、找到include\inc\inc_fun_funAdmin.php 文件,找到 161行左右的代码:if($GLOBALS[媪青怍牙'cfg_html_editor']=='fck') 把这一句代码替换为:if($GLOBALS['cfg_html_editor']=='ueditor') { $fvalue = $fvalue=='' ? '<p></p>' : $fvalue; $code = '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.config.js"></script> <script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.all.js"></script> <link rel="stylesheet" type="text/css" href="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/themes/default/css/ueditor.css"/> <textarea name="'.$fname.'" id="'.$fname.'" style="width:100%;">'.$fvalue.'</textarea> <script type="text/javascript"> var ue = UE.getEditor("'.$fname.'");</script>'; if($gtype=="print") { echo $code; } else { return $code; } } elseif($GLOBALS['cfg_html_editor']=='fck')请注意下图中的红色方框中文件名字是否与下载的ueditor 文件名字一致。

4、修改include\ueditor\php\config.json 配置文件,(其实这一步也可以省略,虽然不影响使用,但是我们在镙烨莲峪添加文章时目录会生成一些新的目录) 原始文件都是类似这样的:/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6} 意思就上传时会保存在跟目录下生成这样的目录格式,我们需要把它修改为dedecms默认的图片文件存放地址uploads 下,我的命名规则是这样的:/uploads/image/{yyyy}{mm}{dd}/{time}{rand:6} 当然你们也可以修改为你们自己想要的目录格式。

5、最后修改两个地方:1.dedecms 根目录中的 data\config.cache.inc.php 文件中的12行左右$cfg_html_editor = 'ueditor';//换成百度编辑器ueditor2.dedecms后台中的: 系统 - 系统基本参数 - 核心设置 - Html编辑器(ckeditor,需要fck的用户可以去官网下载):ueditor至此,已经全部修改完成,可以更新一下缓存,然后添加一片文章和图片,代码,排版之类的试试功能吧!

6、如果后台发布一篇超长的文章,编辑器的高度是自动延伸的话,需要修改配置文件,include\ueditor\ueditor.config 打开这几行的注释://,autoHeightEnabled:true //,scaleEnabled:false//,minFrameWidth:800 //编辑器拖动时最小宽度,默认800//,minFrameHeight:220 //编辑器拖动时最小高度,默认220initialFrameWidth :800,//设置编辑器宽度initialFrameHeight:250,//设置编辑器高度把宽高改为你想要的即可。

猜你喜欢