將織夢(mèng)dedecms后臺(tái)編輯器更改為ueditor

字號(hào):


    網(wǎng)站教程很多了,關(guān)于ueditor我也不做過(guò)多介紹了,官網(wǎng)上都有。這里著重說(shuō)說(shuō)個(gè)人使用時(shí)遇到的問(wèn)題 分享給大家
    1.去ueditor官網(wǎng)下載最新的php版本 http://ueditor.baidu.com解壓后,將文件夾的名字改為ueditor,上傳至網(wǎng)站根目錄的include中。
    2.修改include中inc文件夾中的inc_fun_funadmin.php文件(注意備份之前的文件)找到以下代碼(最新的大約在212行左右)
    $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 {
    3.在****位置加入如下代碼
    else 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 = new
    baidu.editor.ui.editor();ue.render(.$fname.);</script>;
    if($gtype==print)
    {
    echo $code;
    }
    else
    {
    return $code;
    }
    }
    4 .進(jìn)入后臺(tái)系統(tǒng)設(shè)置--核心設(shè)置修改編輯器為ueditor
    至此,后臺(tái)的編輯器已經(jīng)可以使用了,但最主要的還是前臺(tái)看到。下面的步驟就很重要了(慚愧的說(shuō)本人卡在這很久)
    5.在你的文章頁(yè)模板的底部....中加入如下代碼!
    12345 <script type=text/javascript>
    syntaxhighlighter.highlight();
    var editor_a = new baidu.editor.ui.editor();
    editor_a.render( 'myeditor' );
    </script>
    并在內(nèi)容頁(yè)的模板head中加入如下代碼
    12 <script type=text/javascript src=/include/ueditor/third-party/syntaxhighlighter/shcore.js></script>
    <link type=text/css rel=stylesheet href=/include/ueditor/third-party/syntaxhighlighter/shcoredefault.css />
    *注意路徑,更改為你ueditor的目錄下對(duì)應(yīng)的文件目錄
    6.最后更新緩存,生成文檔!