DedeCMS整合百度ueditor编辑器

DedeCMS版本:UTF-8 V5.7.101正式版(更新日期:2022-09-30)   官方下载

Ueditor版本:UTF-8  v1.4.3.3   官方下载

一、整合编辑器

1、将Ueditor下载后解压,并且修改文件夹名为:ueditor

2、将 ueditor 文件夹复制到 DedeCMS 路径下的 include 文件夹下

3、修改 \include\inc\inc_fun_funAdmin.php 文件
 

在当前文件的187行代码  else if($GLOBALS['cfg_html_editor']=='ckeditor') 的上方增加以下代码

    // 百度ueditor编辑器----开始
    else if($GLOBALS['cfg_html_editor']=='ueditor')
    {
        $fvalue = $fvalue=='' ? '<p></p>' : $fvalue;
        $code = '<script type="text/javascript" charset="utf-8"
            src="/include/ueditor/ueditor.config.js"></script>
            <script type="text/javascript" charset="utf-8"
            src="/include/ueditor/ueditor.all.js"></script>
            <link rel="stylesheet" type="text/css"
            href="/include/ueditor/themes/default/css/ueditor.css"/>
            <textarea name="'.$fname.'" id="'.$fname.'"
            style="width:100%;height: 600px;">'.$fvalue.'</textarea>
            <script type="text/javascript">var ue = new
            baidu.editor.ui.Editor();ue.render("'.$fname.'");</script>';
                if($gtype=="print")
                {
                    echo $code;
                }
                else
                {
                    return $code;
                }
    }
    // 百度ueditor编辑器----结束

如图所示:

 4、修改完毕后,进入DedeCMS后台:系统 —> 系统基本参数 —> 核心设置 —> html编辑器支持
填写:ueditor  点击确定后进入:生成 —> 更新系统缓存

二、修改图片保存路径

1、修改 \include\ueditor\php\config.json 文件,将该文件中所有 /ueditor/php/upload (一共8处)修改为自定义的路径即可

三、Ueditor七牛云存储版本

如果需要站点图片保存到七牛云存储可以使用此版本
下载地址:https://codeload.github.com/widuu/qiniu_ueditor_1.4.3/zip/refs/tags/0.01


 

猜你喜欢

转载自blog.csdn.net/edsoki/article/details/127400011
今日推荐