当前日期时间
当前时间:
网站标志
Logo
全站搜索
广告位
phpweb图片广告
广告位
phpweb图片广告
自定内容

phpweb已经是国内最强的的开源电子商务系统了,但并非完美,因为任何...

互联网3年一轮回,京东凡客等电商品牌在三年之前也不过是小打小闹,而如...

电商已经成为趋势,传统行业的竞争已经逐渐演变到网络上,也有不少用Weboss...

phpweb系统是固定的模式,适用于大部分行业与需求。但有一些行业还是有自己...

当前位置
文章正文

phpweb更换kindeditor编辑器

发表:管理员  发表时间:2013-07-30 14:12:11   阅读:(2762)次  

    都知道phpweb自带的编辑器很不好用,有的时候提交会出现很多问题!

今天开始动工把phpweb的编辑器给换了

首先更换news 模块下的编辑器

1.到kindeditor 官方网站上面下载最新的kindeditor包。

2.删除不用的文件夹,asp,jsp等

3.把kindeditor 的文件夹放入phpweb 根目录下

4.打开news/admin/news_conadd.php 大概108行处

 

   <input type="hidden" name="body" value="<?php echo $body; ?>" />

<script type="text/javascript" src="../../kedit/KindEditor.js"></script>

<script type="text/javascript">

var editor = new KindEditor("editor");

editor.hiddenName = "body";

editor.editorWidth = "680px";

editor.editorHeight = "300px";

editor.skinPath = "../../kedit/skins/default/";

editor.uploadPath = "../../kedit/upload_cgi/upload.php";

editor.imageAttachPath="news/pics/";

editor.iconPath = "../../kedit/icons/";

editor.show();

function KindSubmit() {

editor.data();

}

</script>

更换为

 <script charset="utf-8" src="../../kindeditor/kindeditor.js"></script>

<script charset="utf-8" src="../../kindeditor/lang/zh_CN.js"></script>

<script>

var editor;

KindEditor.ready(function(K) {

editor = K.create('#editor_id',{

width:'680px',

height:'300px',

uploadJson:'upload_json.php',

fileManagerJson : 'file_manager_json.php',

allowFileManager : true,

syncType:"form",

afterCreate : function() {

var self = this;

self.sync();

},

afterChange : function() {

var self = this;

self.sync();

},

afterBlur : function() {

var self = this;

self.sync();

}

});

});

</script>

<textarea  name="body" id="editor_id" style="width:680px;height:300px;"/><?php echo $body;?></textarea>

注意:红色标注处,按照官方提供的demo.php文件中写的方法,得不到textarea 里面的内容!

5.复制kindeditor\php文件夹下面upload_json.php和file_manager_json.php 文件到news\admin下

修改2个文件

//文件保存目录路径

$save_path = $php_path . '../attached/';

//文件保存目录URL

$save_url = $php_url . '../attached/';

更换为


//文件保存目录路径

$save_path = $php_path . '../pics/';

//文件保存目录URL


$save_url = $php_url . '../pics/';

 

假如我们资讯/文章对您有所帮助,您可以通过扫描捐赠二维码支持一下我们~

感谢您对我们的支持,您的小小支持让我们有信心走得更远!

脚注信息
© 2005-2015 草莓互联(100cm.cn) 广州同福信息科技有限公司 版权所有,并保留所有权利。

广州市东莞庄一横路116号 粤ICP备11046216号

经营性网站备案信息 广州网络警察报警平台 不良信息举报中心  百度信誉档案 广州工商红盾网 可信网站认证