织梦ckeditor更换为ueditor百度编辑器

修改时间: 2019-06-3 16:39:00 PM

文章时间:2019年6月3日 15:48:27
解决问题:织梦的ckeditor更换为ueditor百度编辑器

ueditor.png

第一步:ueditor下载地址

下载地址:链接: https://pan.baidu.com/s/1v1LF2ZkZrlf-p9JNga4mIw 提取码: 4yeh

第二步:将文件拷贝到include文件夹

将下载的到的ueditor文件,直接放到include文件夹目录下

第三步:修改inc_fun_funAadmin.php

打开 /include/inc/inc_fun_funAdmin.php 找到
else if($GLOBALS['cfg_html_editor']=='ckeditor')
在他的上面,复制下面这段代码进去

else if($GLOBALS['cfg_html_editor']=='ueditor')
{
    $fvalue = $fvalue=='' ? '<p></p>' : $fvalue;
    $code = '<script type="text/javascript" charset="utf-8" src="//apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js"></script><!--需要jquery解决多个百度编辑器同时使用-->';
    $code .= '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.config.js"></script>';
    $code .= '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.all.min.js"></script>';
    $code .= '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/lang/zh-cn/zh-cn.js"></script>';
    $code .= '<link rel="stylesheet" type="text/css" href="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/themes/default/css/ueditor.css"/>';
    $code .= '<script type="text/plain" name="'.$fname.'" id="'.$fname.'">'.$fvalue.'</script>';
    if($bbcode)
    {
        $code .= '<script type="text/javascript">jQuery.noConflict();jQuery(function(){var ue = UE.getEditor("'.$fname.'",{toolbars:[["Source","|",
    "bold", "italic", "underline","|","fontsize","forecolor","emotion","Undo", "Redo"]],initialFrameHeight:100});});</script>';
    }
    else
    {
        $code .= '<script type="text/javascript">jQuery.noConflict();jQuery(function(){var ue = UE.getEditor("'.$fname.'",{initialFrameHeight:450});});</script>';
    }          

    if($gtype=="print")
    {
        echo $code;
    }
    else
    {
        return $code;
    }
}

第四步:后台切换编辑器

系统-系统基本参数-核心设置-Html编辑器
ueditor02.png

其他问题出现(几率)及解决方案

更换ueditor后栏目内容、单页无法保存问题的解决方法

打开

  • /dede/templets/catalog_add.htm
  • /dede/templets/catalog_edit.htm

把里面的form放置到<td height="95" align="center" bgcolor="#FFFFFF">内,就可以了。

本地上传图片添加水印的解决方法

打开 /include/ueditor/php/action_upload.php 找到
include "Uploader.class.php";
在它下面加入

require_once("../../common.inc.php");
require_once("../../image.func.php");

打开 /include/ueditor/php/Uploader.class.php 找到 大概在124行左右
$this->stateInfo = $this->stateMap[0];
在它下面加入

@WaterImg($this->filePath, 'down');

添加新评论