首页 > 网站 > 建站经验 > 正文

dede后台编辑器改成百度编辑器的修改方法

2024-04-25 20:45:26
字体:
来源:转载
供稿:网友
首先下载百度编辑器,点击进行下载,将ueditor文件夹上传到include目录,打开include/inc/inc_fun_funAdmin.php文件,找到以下代码:
        $GLOBALS['tools'] = empty($toolbar[$etype])? $GLOBALS['tools'] : $toolbar[$etype] ;
        $config['toolbar'] = $GLOBALS['tools'];
        $config['height'] = $nheight;
        $config['skin'] = 'kama';
        $CKEditor->returnOutput = TRUE;
        $code = $CKEditor->editor($fname, $fvalue, $config, $events);
        if($gtype=="print")
        {
            echo $code;
        }
        else
        {
            return $code;
        }
    }
在以上代码的后面添加以下代码:
else if($GLOBALS['cfg_html_editor']=='ueditor')
{
        $fvalue = $fvalue=='' ? '<p></p>' : $fvalue;
        $code = '<script type="text/javascript" charset="gbk" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/editor_config.js"></script>
        <script type="text/javascript" charset="gbk" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/editor_all_min.js"></script>
        <link rel="stylesheet" type="text/css" href="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/themes/default/ueditor.css"/>
<script type="text/javascript">
    uParse(".content",{
        "liiconpath":"/include/ueditor/themes/ueditor-list/" 
    })
        </script>
                 <script  id="editor" name="body" type="text/plain">'.$fvalue.'</script>
        <script type="text/javascript">
var ue = UE.getEditor('editor');
UE.getEditor('editor');
</script>';
        if($gtype=="print")
        {
                echo $code;
        }
        else
        {
                return $code;
        }
}
然后修改编辑器配置:/include/ueditor/editor_config.js,找到以下代码:
window.UEDITOR_HOME_URL = "/xxxx/xxxx/";
将以上代码替换成以下代码:
window.UEDITOR_HOME_URL = "/include/ueditor/";
最后在后台设置 系统基本参数 核心设置 把编辑器fck修改成ueditor.
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表