织梦dedecms网站教程很多了,关于ueditor我也不做过多介绍了,官网上都有。这里着重说说个人使用时遇到的问题 分享给大家 。
1.去Ueditor官网下载最新的php版本 http://ueditor.baidu.com解压后,将文件夹的名字改为ueditor,上传至网站根目录的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 .进入后台系统设置–核心设置修改编辑器为ueditor
至此,后台的编辑器已经可以使用了,但最主要的还是前台看到。下面的步骤就很重要了(惭愧的说本人卡在这很久)
5.在你的文章页模板的底部….中加入如下代码!
12345 <script type=”text/javascript”>
SyntaxHighlighter.highlight();
var editor_a = new baidu.editor.ui.Editor();
editor_a.render( ‘myEditor’ );
</script>
并在内容页的模板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的目录下对应的文件目录
6.最后更新缓存,生成文档!