您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程

ecshop编辑器换成实用KindEditor编辑器的方法

访烟2025-01-01 22:23:43ecshop商城教程已有人查阅

导读然后修改kindeditro/php/上传目录修改includes/kindeditor/php/upload_json.php如下:

文件: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\"]', {
allowFileManager : true,
width : '700px',
height: '300px',
resizeType: 0 //固定宽高
});
});
</script>
<textarea id=\"$input_name\" name=\"$input_name\" style='width:700px;height:300px;'>$input_value</textarea>
<input type=\"submit\" value=\"提交\" />
";
$smarty->assign('FCKeditor', $kindeditor);
}
然后修改kindeditro/php/
上传目录修改includes/kindeditor/php/upload_json.php如下:
//文件保存目录路径
$save_path = $php_path . 'http:// .cnblogs.com/../images/upload/';
//文件保存目录URL
$save_url = $php_url . 'http:// .cnblogs.com/../images/upload/';
浏览服务器路径修改includes/kindeditor/php/file_manager_json.php如下:
//根目录路径,可以指定绝对路径,比如 /var/ /attached/
$root_path = $php_path . 'http:// .cnblogs.com/../images/upload/';
//根目录URL,可以指定绝对路径,比如 http:// .yoursite.com/attached/
$root_url = $php_url . 'http:// .cnblogs.com/../images/upload/';
PS:如果ECshop程序是GBK的话,就会出来乱码。

本文标签:

很赞哦! ()

留言与评论 (共有 条评论)
验证码:

本栏推荐

相关标签