当前位置:首页 > CMS教程 > DeDecms > 列表

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

发布:smiling 来源: PHP粉丝网  添加日期:2014-11-11 10:07:05 浏览: 评论:0 

搞织梦的孩子有福了,对于网上最新的织梦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. else if($GLOBALS['cfg_html_editor']=='ueditor'){ 
  2.         $fvalue = $fvalue=="" ? "<p>请在这里添加内容</p>" : $fvalue
  3.         $code =""
  4.             $code .= '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS["cfg_cmspath"].'/include/ueditor/ueditor.config.js"></script>'; 
  5.  
  6.             $code .= '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS["cfg_cmspath"].'/include/ueditor/ueditor.all.js"></script>'; 
  7.        
  8.             $code .='<textarea name="'.$fname.'" id="'.$fname.'" style="width:100%;">'.$fvalue.'</textarea>'
  9.             $code .='<script type="text/javascript">var ue = new baidu.editor.ui.Editor();ue.render("'.$fname.'");</script>'
  10.        //开源软件:phpfensi.com 
  11.         if($gtype=="print"
  12.         {      
  13.                     echo $code
  14.             } 
  15.             else 
  16.             { 
  17.                         return $code;            
  18.             } 
  19.     
  20.         
  21.     } 

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

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/');

Tags: 织梦V5 7SP1 织梦整合ueditor1 2 6 1

分享到: