include "Uploader.class.php";
在下面添加:
require_once("../../common.inc.php");
require_once("../../image.func.php");
二、打開(kāi) \include\ueditor\php\Uploader.class.php 找到
$this->stateInfo = $this->stateMap[0];
在124行左右,在它下面加上
@WaterImg($this->filePath, 'down');
在258行左右,在它下面加上
@WaterImg($filePath, 'down');
親測(cè)有效
織夢(mèng)DEDECMS安裝百度編輯器ueditor的方法
]]>
這里說(shuō)的方法是在dedecsm5.7織夢(mèng)整合百度編輯器ueditor最新1.4.3方法 基礎(chǔ)之上 出現(xiàn)的問(wèn)題??不過(guò)網(wǎng)上大多教程亦如此
核心代碼
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%;">'.$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;
}
}
在每次實(shí)例化對(duì)象的時(shí)候 都會(huì)引入js
以上問(wèn)題的解決辦法就是??頁(yè)面值引用一次js
圖中紅色代碼部分
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%;">'.$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;
}
}
在inc_func_funcAdmin.php 將這三行代碼剪切? ?至 需要引入編輯器的頁(yè)面 如后臺(tái)的發(fā)布文章模板頁(yè)面 article_add.htm? ?修改文章的模板頁(yè)面 article_edit.htm等等??放在頭部的head區(qū)域 原則是在實(shí)例化編輯器之前
inc_func_funcAdmin.php部分
article_add.htm部分
]]>