原文来自:https://www.zixuephp.com

织梦V5.7SP1整合ueditor1.2.6.1教程 (本人亲测)

搞织梦的孩子有福了,对于网上最新的织梦V5.7SP1和最新的ueditor1.2.6.1,有些孩童不知道怎么整合,我也去各大论坛看了下,找了相关资料,发现好多资料缺胳膊断腿的,不全,于是,我就自己搞了下,不错意外,一定是可以的,相关步骤如下:

织梦V5.7SP1整合ueditor1.2.6.1教程

第一步:进入织梦后台,系统—核心设置,将编辑器改成:ueditor

第二步:下载最新版程序,我下的是utf-8版,解压上传至include目录下

第三步:打开织梦目录include/inc/inc_fun_funAdmin.php文件,在第226行与227行之间插入下列代码:

  1. elseif($GLOBALS['cfg_html_editor']=='ueditor'){
  2. $fvalue=$fvalue==""?"<p>请在这里添加内容</p>":$fvalue;
  3. $code="";
  4. $code.='<scripttype="text/javascript"charset="utf-8"src="'.$GLOBALS["cfg_cmspath"].'/include/ueditor/ueditor.config.js"></script>';
  5. $code.='<scripttype="text/javascript"charset="utf-8"src="'.$GLOBALS["cfg_cmspath"].'/include/ueditor/ueditor.all.js"></script>';
  6. $code.='<textareaname="'.$fname.'"id="'.$fname.'"style="width:100%;">'.$fvalue.'</textarea>';
  7. $code.='<scripttype="text/javascript">varue=newbaidu.editor.ui.Editor();ue.render("'.$fname.'");</script>';
  8. if($gtype=="print")
  9. {
  10. echo$code;
  11. }
  12. else
  13. {
  14. return$code;
  15. }
  16. }

第四步:开始修改图片上传的路径

1,打开include/ueditor/ueditor.config.js

01,改:

window.UEDITOR_HOME_URL = "/DedeCMS57/include/ueditor/";

02 ,imagePath:URL + "php/"改,imagePath:"http://cms.local/DedeCMS57/"

03 ,imageManagerPath:URL + "php/" 改,imageManagerPath:"http://cms.local/DedeCMS57/"

2,打开include/ueditor/php/imageUp.php

04 "savePath" => ($path == "1" ? "upload/" : "upload1/"), 改:

"savePath" => ($path == "1" ? "../../../upload/img/" : "upload1/"),

05 echo "{'url':'" . $info["url"] . "','title':'" . $title . "','original':'" . $info["originalName"] . "','state':'" . $info["state"] . "'}"; 改:

echo "{'url':'" . str_replace('../','',$info[ "url" ]) . "','title':'" . $title . "','original':'" . $info["originalName"] . "','state':'" . $info["state"] . "'}";

3,打开include/ueditor/php/imageUp.php

06 $paths = array('upload/','upload1/'); 改

$paths = array('../../../upload/img/','upload1/');