织梦html编辑器,织梦dedecms自带文本编辑器ckeditor更换为kindeditor编辑器带代

织梦dedecms自带文本编辑器ckeditor更换为kindeditor编辑器带代

日期:2018-12-05 08:31

您的打赏帮助我们变得更好,谢谢支持!

167471014_1_20190802072430222.png

在kindeditor基础上添加了如下功能

1、qq客服快速添加

2、ckplayer播放器,支持本地flv,mp4

3、动态百度地图

kindeditor织梦版(gbk/utf8)打包下载

云盘下载:http://pan.baidu.com/s/1dF1WKJv            密码: vwea

该版本为4.1.10,需要4.1.4版本的请移步《织梦整合编辑器Kindeditor 4.1.4 GBK+UTF一键安装》

下载解压,选择对应的编码版本,把include文件夹上传到网站根目录

最后给dedecms添加kindeditor编辑器调用代码

dedecms utf8编码程序的

打开 include/inc/inc_fun_funAdmin.php 找到

else {

/*

// ------------------------------------------------------------------------

// 当前版本,暂时取消dedehtml编辑器的支持

在它的上面加入

else if($GLOBALS['cfg_html_editor']=='kindeditor')

{

$fvalue =htmlspecialchars($fvalue);

$uploadJson = $GLOBALS['cfg_cmspath']."/include/dialog/kindeditor_post.php";

$fileManagerJson = $GLOBALS['cfg_cmspath']."/include/dialog/kindeditor_manager.php";

$allowFileManager = 'true';

$extendconfig = '';

if($etype == 'Member' || $etype == 'MemberLit' || $etype == 'Diy' || $etype == 'Feedback')

{

$uploadJson = "";

$fileManagerJson = "";

$allowFileManager = 'false';

$extendconfig = 'allowImageUpload : false,';

$extendconfig .= 'allowFlashUpload : false,';

$extendconfig .= 'allowMediaUpload : false,';

$extendconfig .= 'allowFileUpload : false,';

}

$items['Member'] = "[

'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'cut', 'copy', 'paste',

'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',

'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',

'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',

'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',

'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',

'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'map', 'pagebreak',

'link', 'unlink', '|', 'about']";

$items['Small'] = $items['MemberLit'] = $items['Diy'] = "[

'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',

'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',

'insertunorderedlist', '|', 'emoticons', 'image', 'link']";

$items['Feedback']= "[

'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',

'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',

'insertunorderedlist', '|', 'emoticons']";

$itemconfig = '';

if(isset($items[$etype]))

{

$itemconfig = "items :{$items[$etype]},";

}

$session_id = session_id();

$code = <<

KindEditor.ready(function(K) {

var editor1 = K.create('textarea[name="{$fname}"]', {

cssPath : '{$GLOBALS['cfg_cmspath']}/include/kindeditor/plugins/code/prettify.css',

uploadJson : '$uploadJson',

fileManagerJson : '$fileManagerJson',

filterMode: false,//是否开启过滤模式

extraFileUploadParams: {

PHPSESSID : '{$session_id}'

},

$extendconfig

$itemconfig

allowFileManager : {$allowFileManager},

afterBlur: function(){this.sync();}

});

prettyPrint();

});

{$fvalue}

HTML;

if($gtype=="print")

{

echo $code;

}

else

{

return $code;

}

}

dedecms gbk编码程序的

打开 include/inc/inc_fun_funAdmin.php 找到

else {

/*

// ------------------------------------------------------------------------

// 当前版本,暂时取消dedehtml编辑器的支持

在它的上面加入

else if($GLOBALS['cfg_html_editor']=='kindeditor')

{

$fvalue =htmlspecialchars($fvalue);

$uploadJson = $GLOBALS['cfg_cmspath']."/include/dialog/kindeditor_post.php";

$fileManagerJson = $GLOBALS['cfg_cmspath']."/include/dialog/kindeditor_manager.php";

$allowFileManager = 'true';

$extendconfig = '';

if($etype == 'Member' || $etype == 'MemberLit' || $etype == 'Diy' || $etype == 'Feedback')

{

$uploadJson = "";

$fileManagerJson = "";

$allowFileManager = 'false';

$extendconfig = 'allowImageUpload : false,';

$extendconfig .= 'allowFlashUpload : false,';

$extendconfig .= 'allowMediaUpload : false,';

$extendconfig .= 'allowFileUpload : false,';

}

$items['Member'] = "[

'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'cut', 'copy', 'paste',

'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',

'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',

'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',

'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',

'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',

'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'map', 'pagebreak',

'link', 'unlink', '|', 'about']";

$items['Small'] = $items['MemberLit'] = $items['Diy'] = "[

'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',

'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',

'insertunorderedlist', '|', 'emoticons', 'image', 'link']";

$items['Feedback']= "[

'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',

'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',

'insertunorderedlist', '|', 'emoticons']";

$itemconfig = '';

if(isset($items[$etype]))

{

$itemconfig = "items :{$items[$etype]},";

}

$session_id = session_id();

$code = <<

KindEditor.ready(function(K) {

var editor1 = K.create('textarea[name="{$fname}"]', {

cssPath : '{$GLOBALS['cfg_cmspath']}/include/kindeditor/plugins/code/prettify.css',

uploadJson : '$uploadJson',

fileManagerJson : '$fileManagerJson',

filterMode: false,//是否开启过滤模式

extraFileUploadParams: {

PHPSESSID : '{$session_id}'

},

$extendconfig

$itemconfig

allowFileManager : {$allowFileManager},

afterBlur: function(){this.sync();}

});

prettyPrint();

});

{$fvalue}

HTML;

if($gtype=="print")

{

echo $code;

}

else

{

return $code;

}

}

最后

后台-系统-系统基本参数-核心设置-Html编辑器 ,填写kindeditor

167471014_2_20190802072430753.png

要实现代码高亮需在前台模板页(比如我的是aricle_aritlce.htm)需引入以下几个文件:

然后,在你文章模板页的前添加这一句:

注意,一定要放在body的结束符之前,如果在页面头部声明是没效果的。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值