织梦DEDECMS安装百度编辑器ueditor的方法

1.根据你的网站编码,下载相应编码的编辑器包。在include文件夹里,新建一个名为ueditor文件夹,把刚才下载的文件放到里面。

1

2.打开include下的inc文件夹内的inc_func_funcAdmin.php找到184行,在下面放入下面的代码,然后保存。这段代码是只有一个编辑器的情况下使用。

//百度编辑器
else if($GLOBALS['cfg_html_editor']=='ueditor')
{
 $fvalue = $fvalue=='' ? '<p></p>' : $fvalue;
$code = '<script type="text/javascript" charset="utf-8"
src="/include/ueditor/ueditor.config.js"></script>
 <script type="text/javascript" charset="utf-8"
src="/include/ueditor/ueditor.all.js"></script>
<link rel="stylesheet" type="text/css"
href="/include/ueditor/themes/default/css/ueditor.css"/>
<textarea name="'.$fname.'" id="'.$fname.'"
style="width:100%;height:400px;">'.$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;
}
}

2

下面的代码是多个编辑器时使用的

//百度编辑器
else if($GLOBALS['cfg_html_editor']=='ueditor')
{
	$fvalue = $fvalue=='' ? '<p></p>' : $fvalue;
	$code = '<script type="text/javascript" charset="utf-8" src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js"></script><!--需要jquery解决多个百度编辑器同时使用-->';
	$code .= '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.config.js"></script>';
	$code .= '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ueditor.all.min.js"></script>';
	$code .= '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/lang/zh-cn/zh-cn.js"></script>';
	$code .= '<link rel="stylesheet" type="text/css" href="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/themes/default/css/ueditor.css"/>';
	$code .= '<script type="text/plain" name="'.$fname.'" id="'.$fname.'">'.$fvalue.'</script>';
	if($bbcode)
	{
		$code .= '<script type="text/javascript">jQuery.noConflict();jQuery(function(){var ue = UE.getEditor("'.$fname.'",{toolbars:[["Source","|",
	"bold", "italic", "underline","|","fontsize","forecolor","emotion","Undo", "Redo"]],initialFrameHeight:100});});</script>';
	}
	else
	{
		$code .= '<script type="text/javascript">jQuery.noConflict();jQuery(function(){var ue = UE.getEditor("'.$fname.'",{initialFrameHeight:450});});</script>';
	}          

	if($gtype=="print")
	{
		echo $code;
	}
	else
	{
		return $code;
	}
}

 

3.在后台管理系统-->系统基本参数-->核心设置-->将 Html编辑器的值改为 ueditor ,然后保存。



3 4

 

织梦DEDECMS百度编辑器Ueditor上传图片及下载远程图片无法加水印的解决方法

 

THE END