将织梦dedecms后台编辑器更改为Ueditor
2014-02-20 23:18
381 查看
网站教程很多了,关于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.最后更新缓存,生成文档!
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.最后更新缓存,生成文档!
相关文章推荐
- hdu 3397 Sequence operation 线段树
- iOS UILABEL \UIIMAGE复制
- Android UI
- NSURLRequest 官方文档 详析
- 网页中集成SAP的WebGUI,可以指定用户名、密码、事务码
- UITabBarController自定义(一)
- UIScrollView属性全总结
- netduino plus2简介
- C# 通过线程更新UI
- 快速排序_quick_sort
- 【PAT1014】 Waiting in Line (30) queue模拟排队
- Codeforces 392C Yet Another Number Sequence(矩阵快速幂)
- 【题解】【数组】【Prefix Sums】【Codility】Genomic Range Query
- UIView
- uiimage截取一部分, iOS6/7 deltas
- wxFormBuilder怎么制作继承于wxWindow的窗口,便于集成在frame中
- easyui datagrid combobox下拉框获取数据问题
- Jordan Lecture Note-8: The Sequential Minimal Optimization Algorithm (SMO).
- LeetCode | Longest Consecutive Sequence
- 【Uinx高级环境变成】1.open函数