ecshop彻底编辑器为kindeditor实现在多张图片上传(个人修正)
来源:互联网 发布:身材测算软件 编辑:程序博客网 时间:2024/05/22 07:41
ecshop彻底编辑器为kindeditor实现在多张图片上传
使用过ECSHOP后台产品、文章编辑的朋友都知道ECSHOP编辑器是'FCKeditor,'FCK官早已经不再更新FCKeditor了,但是ECSHOP却一直还在使用,FCKeditor浏览器的缺点:漏洞多,容易被不怀好意的人利用;不能一次上传多张图片。。。。。
最近发现有网友发过关于用kindeditor替换FCKeditor的文章,感觉FCKeditor还不错。于是就是baidu、google上搜,现把我的使用经验分享给大家。
先来欣赏一下kindeditor编辑器的多图上传功能
下面是实现替换kindeditor编辑器的步骤及方法:
1、从kindedito官网上下载最新版的kindeditor-4.1.10.zip
2、解压kindeditor-4.1.10.zip到kindeditor文件夹, 并将kindeditor上传 /includes目录下
3、打开/admin/includes/lib_main.php
找到 create_html_editor 函数,
/**
* 生成编辑器
* @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);
}
把它替换为:
function create_new_kindedit($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 : '100%',
height: '400px',
resizeType: 0 //固定宽高
});
});
</script>
<textarea id=\"$input_name\" name=\"$input_name\" style='width:100%;height:400px;'>$input_value</textarea>
";
$smarty->assign('FCKeditor', $kindeditor);
}
不管是UTF-8、还是 GBK都适用。 注意一定要加上charset='utf-8'
4、修改includes/kindeditor/php/upload_json.php :
(1)找到:
//文件保存目录路径
在它的下面添加:
$php_save_path=str_replace($php_url,'',$php_path). '/'; //将上传的文件保存根目录了
(2)找到:
$save_path = $php_path . '../attached/';
修改为:
$save_url = 'images/upload/'; //上传文件保存路径
(3)找到:
$save_url = $php_url . '../attached/';
修改为:
$save_url = '/images/upload/'; //上传文件保存路径
5、.浏览服务器路径修改includes/kindeditor/php/file_manager_json.php
(1)在$php_url = dirname($_SERVER['PHP_SELF']) . '/'; 的下面添加:
$php_save_path=str_replace($php_url,'',$php_path). '/';
(2)找到:
$root_path = $php_path . '../../../upload/';
修改为:
$root_path = $php_save_path . 'images/upload/'; //上传文件保存路径
(3)找到:
$root_url = $php_url . '../attached/';
修改为:
$save_url = '/images/upload/'; //上传文件保存路径
6、接下来修改ECSHOP后台编辑器调用
(1)打开后台产品 /admin/goods.php
找到:
create_html_editor('goods_desc', $goods['goods_desc']);
修改为
create_new_kindedit('goods_desc', $goods['goods_desc']);// 调用kindeditor编辑器
(2)后台文章:/admin/article.php
找到:
create_html_editor('FCKeditor1');
修改为
create_new_kindedit('FCKeditor1'); //调用kindeditor编辑器
找到:
create_html_editor('FCKeditor1',$article['content']);
修改为
create_new_kindedit('FCKeditor1',$article['content']); //调用kindeditor编辑器
kindeditor编辑器限制了最多只能上传20张图怎么办?
打开
/includes/kindeditor/kindeditor-all.js 中的
imageUploadLimit = K.undef(self.imageUploadLimit, 20),
修改红色数字为你想要的
打开
/includes/kindeditor/plugins/multiimage/multiimage.js
KindEditor.plugin('multiimage', function(K) {
var self = this, name = 'multiimage',
formatUploadUrl = K.undef(self.formatUploadUrl, true),
uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'),
imgPath = self.pluginsPath + 'multiimage/images/',
imageSizeLimit = K.undef(self.imageSizeLimit, '1MB'),
imageFileTypes = K.undef(self.imageFileTypes, '*.jpg;*.gif;*.png'),
imageUploadLimit = K.undef(self.imageUploadLimit, 20),
filePostName = K.undef(self.filePostName, 'imgFile'),
lang = self.lang(name + '.');
修改红色数字为你想要的
如果你的kindeditor编辑器已经正常使用了,可以把:
/article.php /goods.php 里的
require_once(ROOT_PATH . "includes/fckeditor/fckeditor.php");
注释掉或者删除掉,再把/includes/fckeditor 目录删除,这样就完全更换了ECSHOP的编辑器了
再见了fckeditor
使用过ECSHOP后台产品、文章编辑的朋友都知道ECSHOP编辑器是'FCKeditor,'FCK官早已经不再更新FCKeditor了,但是ECSHOP却一直还在使用,FCKeditor浏览器的缺点:漏洞多,容易被不怀好意的人利用;不能一次上传多张图片。。。。。
最近发现有网友发过关于用kindeditor替换FCKeditor的文章,感觉FCKeditor还不错。于是就是baidu、google上搜,现把我的使用经验分享给大家。
先来欣赏一下kindeditor编辑器的多图上传功能
下面是实现替换kindeditor编辑器的步骤及方法:
1、从kindedito官网上下载最新版的kindeditor-4.1.10.zip
2、解压kindeditor-4.1.10.zip到kindeditor文件夹, 并将kindeditor上传 /includes目录下
3、打开/admin/includes/lib_main.php
找到 create_html_editor 函数,
/**
* 生成编辑器
* @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);
}
把它替换为:
function create_new_kindedit($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 : '100%',
height: '400px',
resizeType: 0 //固定宽高
});
});
</script>
<textarea id=\"$input_name\" name=\"$input_name\" style='width:100%;height:400px;'>$input_value</textarea>
";
$smarty->assign('FCKeditor', $kindeditor);
}
不管是UTF-8、还是 GBK都适用。 注意一定要加上charset='utf-8'
4、修改includes/kindeditor/php/upload_json.php :
(1)找到:
//文件保存目录路径
在它的下面添加:
$php_save_path=str_replace($php_url,'',$php_path). '/'; //将上传的文件保存根目录了
(2)找到:
$save_path = $php_path . '../attached/';
修改为:
$save_url = 'images/upload/'; //上传文件保存路径
(3)找到:
$save_url = $php_url . '../attached/';
修改为:
$save_url = '/images/upload/'; //上传文件保存路径
5、.浏览服务器路径修改includes/kindeditor/php/file_manager_json.php
(1)在$php_url = dirname($_SERVER['PHP_SELF']) . '/'; 的下面添加:
$php_save_path=str_replace($php_url,'',$php_path). '/';
(2)找到:
$root_path = $php_path . '../../../upload/';
修改为:
$root_path = $php_save_path . 'images/upload/'; //上传文件保存路径
(3)找到:
$root_url = $php_url . '../attached/';
修改为:
$save_url = '/images/upload/'; //上传文件保存路径
6、接下来修改ECSHOP后台编辑器调用
(1)打开后台产品 /admin/goods.php
找到:
create_html_editor('goods_desc', $goods['goods_desc']);
修改为
create_new_kindedit('goods_desc', $goods['goods_desc']);// 调用kindeditor编辑器
(2)后台文章:/admin/article.php
找到:
create_html_editor('FCKeditor1');
修改为
create_new_kindedit('FCKeditor1'); //调用kindeditor编辑器
找到:
create_html_editor('FCKeditor1',$article['content']);
修改为
create_new_kindedit('FCKeditor1',$article['content']); //调用kindeditor编辑器
kindeditor编辑器限制了最多只能上传20张图怎么办?
打开
/includes/kindeditor/kindeditor-all.js 中的
imageUploadLimit = K.undef(self.imageUploadLimit, 20),
修改红色数字为你想要的
打开
/includes/kindeditor/plugins/multiimage/multiimage.js
KindEditor.plugin('multiimage', function(K) {
var self = this, name = 'multiimage',
formatUploadUrl = K.undef(self.formatUploadUrl, true),
uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'),
imgPath = self.pluginsPath + 'multiimage/images/',
imageSizeLimit = K.undef(self.imageSizeLimit, '1MB'),
imageFileTypes = K.undef(self.imageFileTypes, '*.jpg;*.gif;*.png'),
imageUploadLimit = K.undef(self.imageUploadLimit, 20),
filePostName = K.undef(self.filePostName, 'imgFile'),
lang = self.lang(name + '.');
修改红色数字为你想要的
如果你的kindeditor编辑器已经正常使用了,可以把:
/article.php /goods.php 里的
require_once(ROOT_PATH . "includes/fckeditor/fckeditor.php");
注释掉或者删除掉,再把/includes/fckeditor 目录删除,这样就完全更换了ECSHOP的编辑器了
再见了fckeditor
0 0
- ecshop彻底编辑器为kindeditor实现在多张图片上传(个人修正)
- ecshop编辑器kindeditor上传图片添加水印插件
- kindeditor编辑器上传图片
- 使用kindeditor来替换ecshop的fckeditor编辑器,让ecshop可以批量上传图片
- 使用kindeditor来替换ecshop的fckeditor编辑器,让ecshop可以批量上传图片
- KindEditor实现多图片上传
- ecshop将编辑器更换为kindeditor
- Kindeditor实现图片上传
- ecshop更换升级FCKeditor编辑器到Kindeditor,支持图片批量上传,和百度地图添加
- 在项目中集成kindeditor图片上传和编辑器功能
- KindEditor 在线编辑器 自定义文件上传与图片管理器实现
- kindeditor图片上传 struts2实现
- Ecshop 编辑器 FCKeditor更换为Kindeditor 完整替换
- KindEditor编辑器的图片上传问题
- PHP 编辑器 kindEditor 上传图片失败 解决方案
- KindEditor编辑器上传图片超过限制
- KindEditor 自定义插件:实现在内容编辑器中选中任意一张图片将其设置为文章封面缩略图
- KindEditor 修改多图片上传显示限制大小和张数
- 应该注意的一些事
- eclipse的html插件的下载和安装过程【图文教程】
- Java内存管理与回收机制
- sublime text2在windows中配置ctags插件
- HDU 1754 I Hate It(线段树模版)
- ecshop彻底编辑器为kindeditor实现在多张图片上传(个人修正)
- Oracle存在则更新,不存在则插入应用
- 远程桌面连接工具VNC——license Key
- ubuntu 重置 root 密码
- lambda的形式 C++11标准
- 长时间停留在calculating requirements and dependencies 的解决方案
- zoj2412 Farm Irrigation 搜索dfs
- 【Android】高仿大众点评中的范围选择控件之RangeSeekBar
- 扩张欧几里得算法