《PHP編程:ecshop后臺編輯器替換成ueditor編輯器》要點:
本文介紹了PHP編程:ecshop后臺編輯器替換成ueditor編輯器,希望對您有用。如果有疑問,可以聯系我們。
1、Ueditor1.4.3下載(截止到2015-03-03最新版)
PHP實例
下載地址:http://ueditor.baidu.com/website/download.html
解決jquery沖突的jquery等相關文件下載
文件中已含js沖突修改文件,另外已修改php/config.json中的圖處保存路徑,用戶也可以自行修改!
因為老楊用的是mac os系統,所以文件中有一些.DS_store文件,可以忽略或自行刪除
下載地址:http://pan.baidu.com/s/1gdglb0J 暗碼:fflu (老楊提供)PHP實例
2、上傳到網站服務器
PHP實例
解壓并上傳目錄 uediter 到根目錄 /includes 下
解壓老楊的那個東東,把fix_jquery上傳到 ueditor 的目錄下PHP實例
3、修改/admin/includes/lib_main.phpPHP實例
找到下面的函數PHP實例
代碼如下:
/**
?* 生成編纂器
?* @param?? string? input_name? 輸入框名稱
?* @param?? string? input_value 輸入框值
?*/?
function create_html_editor($input_name, $input_value = '')?
{?
??? global $smarty;?
??
??? $editor = new FCKeditor($input_name);?
??? $editor->BasePath?? = '../includes/fckeditor/';?
??? $editor->ToolbarSet = 'Normal';?
??? $editor->Width????? = '100%';?
??? $editor->Height???? = '320';?
??? $editor->Value????? = $input_value;?
??? $FCKeditor = $editor->CreateHtml();?
??? $smarty->assign('FCKeditor', $FCKeditor);?
}
替換為:PHP實例
代碼如下:
/**
?* 生成編纂器
?* @param?? string? input_name? 輸入框名稱
?* @param?? string? input_value 輸入框值
?*/
function create_html_editor($input_name, $input_value = '')
{
??? global $smarty;
??? $kindeditor="
??? <script id='editor' name='$input_name' type='text/plain' style='width:1024px;height:500px;'>$input_value</script>
??? <script charset='utf-8' src='../includes/ueditor/ueditor.config.js'></script>
??? <script charset='utf-8' src='../includes/ueditor/ueditor.all.min.js'></script>
??? <script>
??????? var ue = UE.getEditor('editor');
??? </script>
??? ";
??? $smarty->assign('FCKeditor', $kindeditor);
}
4、修改/admin/templates/pageheader.htmPHP實例
查找:PHP實例
代碼如下:
{insert_scripts files="../js/transport.js,common.js,../js/utils.js"}
替換為:PHP實例
代碼如下:
<script src="../includes/ueditor/fix_jquery/jquery.min.js"></script>
<script src="../includes/ueditor/fix_jquery/jquery.json-1.3.js"></script>
<script src="js/common.js"></script>
<script src="../includes/ueditor/fix_jquery/transport_json.js"></script>
{insert_scripts files="../js/utils.js"}
5、辦理商品編輯中編輯器被重置,uedite無法保存內容的bug.
PHP實例
文件:/admin/templates/goods_info.htm
找到:PHP實例
代碼如下:
document.forms['theForm'].reset();
注釋掉:PHP實例
代碼如下:
//document.forms['theForm'].reset();
以上所述便是本文的全部內容了,希望大家能夠喜歡.PHP實例
《PHP編程:ecshop后臺編輯器替換成ueditor編輯器》是否對您有啟發,歡迎查看更多與《PHP編程:ecshop后臺編輯器替換成ueditor編輯器》相關教程,學精學透。維易PHP學院為您提供精彩教程。
轉載請注明本頁網址:
http://www.snjht.com/jiaocheng/11902.html