ecshop算是目前最成熟 好用的商城系統 ,小編最近在搭建商城系統 的時候,準備大功告成的時候竟然 在服務器上面不能正常上傳圖片,真的是急死了。問題情況是這樣子的
上傳圖片時一直在進度條,接下來沒有反應,但可以上傳到服務器,可以在圖像屬性中瀏覽圖片,正常情況應該圖片上傳到空間,馬上回應地址等信息,這次沒有,研究了一整天。用不同瀏覽器也看過了,ftp后臺文件也覆蓋過,不同電腦也試過,聯系服務商詢問權限問題,說不需要改的,后來干脆重裝ec系統,還是老樣子。 就是不會出現彈出框 you file has been successful upload 如果出現就是好的了。

小編網上查了好久,還是解決不了,竟然 在fckeditor上找不到 解決的方法,那只有給ecshop的后臺換個編輯器,因為fckeditor上好像也不是太好用。下面重要點說下,如何用kindeditor替換fckeditor方法
kindeditor此編輯器可以讓ecshop批量上傳圖片,可以插入代碼,可以全屏編輯,可以插入地圖、視頻,進行更多word操作,設置字體。
步驟一:進入kindeditor的官網,http://kindeditor.net/index.php下載最新的編輯器版本,將文件上傳到網站includes/目錄下,注意,不要有多余的目錄,要可以訪問到includes/kindeditor/kindeditor-min.js
步驟二:
1、修改admin/includes/lib_main.php
將
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);
}
替換為
function create_html_editor($input_name, $input_value = '')
{
global $smarty;
$kindeditor="<script charset='utf-8' src='../includes/kindeditor/kindeditor-min.js'></script>
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name="$input_name"]', {//www.lyecs.com
allowFileManager : true,
width : '100%',
height: '300px',
resizeType: 0 //固定寬高
});
});
</script>
<textarea id="$input_name" name="$input_name" style='width:100%;height:300px;'>$input_value</textarea>
<input type="submit" value="提交" />
";
$smarty->assign('FCKeditor', $kindeditor);
}
2、找到
includes/kindeditor/php/upload_json.php
將
//文件保存目錄路徑
$save_path = $php_path . '../attached/';
//文件保存目錄URL
$save_url = $php_url . '../attached/';
替換為
//文件保存目錄路徑www.lyecs.com老楊ecshop二次開發
$save_path = $php_path . '../../../images/upload/';
//文件保存目錄URL
$save_url = $php_url . '../../../images/upload/';
3、includes/kindeditor/php/file_manager_json.php
將
//根目錄路徑,可以指定絕對路徑,比如 /var/www/attached/
$root_path = $php_path . '../attached/';
//根目錄URL,可以指定絕對路徑,比如 http://www.yoursite.com/attached/
$root_url = $php_path . '../attached/';
改為:
//根目錄路徑,可以指定絕對路徑,比如 /var/www/attached/
$root_path = $php_path . '../../../images/upload/';
//根目錄URL,可以指定絕對路徑,比如 http://www.yoursite.com/attached/
$root_url = $php_url . '../../../images/upload/';
3、找到admin/template/goods_info.htm
<input type="button" value="{$lang.button_submit}" class="button" onclick="validate('{$goods.goods_id}')" />
修改為
<input type="submit" value="{$lang.button_submit}" class="button" onclick="validate('{$goods.goods_id}')" />
進后臺刷新就可以了
小編通過此方法算是解決了這個不能正常上傳圖片的問題,希望對大家有所幫助