位置: IT常识 - 正文

织梦dedecms自带文本编辑器ckeditor更换为kindeditor编辑器带代码高亮(将织梦dedecms转换到wordpress)

编辑:rootadmin

推荐整理分享织梦dedecms自带文本编辑器ckeditor更换为kindeditor编辑器带代码高亮(将织梦dedecms转换到wordpress),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:织梦使用教程,织梦cms要钱吗,织梦cms怎么样,织梦cms可以商用吗,织梦cms可以商用吗,将织梦dedecms转换到wordpress,织梦cms怎么样,将织梦dedecms转换到wordpress,内容如对您有帮助,希望把文章链接给更多的朋友!

在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编辑器的支持

织梦dedecms自带文本编辑器ckeditor更换为kindeditor编辑器带代码高亮(将织梦dedecms转换到wordpress)

在它的上面加入

elseif($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=<<<HTML<linkrel="stylesheet"href="{$GLOBALS['cfg_cmspath']}/include/kindeditor/themes/default/default.css"/><linkrel="stylesheet"href="{$GLOBALS['cfg_cmspath']}/include/kindeditor/plugins/code/prettify.css"/><scriptsrc="{$GLOBALS['cfg_cmspath']}/include/kindeditor/kindeditor-min.js"></script><scriptsrc="{$GLOBALS['cfg_cmspath']}/include/kindeditor/lang/zh_CN.js"></script><scriptsrc="{$GLOBALS['cfg_cmspath']}/include/kindeditor/plugins/code/prettify.js"></script><scripttype="text/javascript">KindEditor.ready(function(K){vareditor1=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$itemconfigallowFileManager:{$allowFileManager},afterBlur:function(){this.sync();}});prettyPrint();});</script><textareaname="{$fname}"style="height:{$nheight}px;visibility:hidden;width:100%;">{$fvalue}</textarea>HTML;if($gtype=="print"){echo$code;}else{return$code;}}

dedecms gbk编码程序的

打开include/inc/inc_fun_funAdmin.php找到

else {

/*

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

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

在它的上面加入

elseif($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=<<<HTML<linkrel="stylesheet"href="{$GLOBALS['cfg_cmspath']}/include/kindeditor/themes/default/default.css"/><linkrel="stylesheet"href="{$GLOBALS['cfg_cmspath']}/include/kindeditor/plugins/code/prettify.css"/><scriptsrc="{$GLOBALS['cfg_cmspath']}/include/kindeditor/kindeditor-min.js"charset="gb2312"></script><scriptsrc="{$GLOBALS['cfg_cmspath']}/include/kindeditor/lang/zh_CN.js"charset="gb2312"></script><scriptsrc="{$GLOBALS['cfg_cmspath']}/include/kindeditor/plugins/code/prettify.js"charset="gb2312"></script><scripttype="text/javascript">KindEditor.ready(function(K){vareditor1=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$itemconfigallowFileManager:{$allowFileManager},afterBlur:function(){this.sync();}});prettyPrint();});</script><textareaname="{$fname}"style="height:{$nheight}px;visibility:hidden;width:100%;">{$fvalue}</textarea>HTML;if($gtype=="print"){echo$code;}else{return$code;}}

最后

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

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

<link type="text/css" rel="stylesheet" href="/include/kindeditor/plugins/code/prettify.css"/>

<script type="text/javascript" src="/include/kindeditor/plugins/code/prettify.js"></script>

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

<script>prettyPrint();</script>

注意,一定要放在body的结束符之前,如果在页面头部

本文链接地址:https://www.jiuchutong.com/zhishi/310840.html 转载请保留说明!

上一篇:php之kohana框架的安装详解(php框架symfony)

下一篇:织梦模板DEDECMS数据库分表储存数据负载性能优化(织梦模板安装完整教程)

  • 荣耀magic3至臻版支持反向充电吗(荣耀magic3至臻版上市时间)

  • 华为nova6上市日期(华为nova6什么时候上市的,上市价格)

  • 在excel中在单元格中输入3/5的方法(在excel中在单元格中输入=12>24)

  • ls120在bios里是什么意思(bios s1)

  • 苹果腾讯会议没有共享屏幕(苹果腾讯会议没有声音)

  • 发出的朋友圈能不能重新编辑(发出的朋友圈能编辑吗)

  • 苹果8跟se有什么区别(苹果8和se1)

  • 手机盖板和外屏的区别(手机盖板和外屏是一个东西吗)

  • word里下划线怎么弄(word 下划线)

  • 华为mate30prohd怎么关闭(华为mate30pro手机hd开关在哪里)

  • 微信运动延迟几个小时(微信运动延迟几十秒)

  • ipad只能关机充电咋办(ipad只能关机充电开机充不了电是什么原因)

  • ie浏览器怎么截屏(ie浏览器怎么截图)

  • 北斗定位终端怎么使用(北斗终端的操作使用方法)

  • 小米手环怎么设置睡眠(小米手环怎么设置锁屏密码)

  • iphone11支持指纹解锁吗(苹果11支持指纹解锁功能吗?)

  • 美团拼团一定要好友吗(美团拼团一定要认识吗)

  • 荣耀4和小米3手环对比(小米4和华为荣耀6性能哪个好)

  • 苹果怎么取消icloud自动续费(苹果怎么取消icloud续费)

  • Ps图层怎么用(ps图层怎么用正片叠底)

  • 摩拜单车如何付费(摩拜单车付款在哪里)

  • 猎豹浏览器如何卸载(猎豹浏览器如何截长图)

  • win11安装组策略编辑器ADMX模板的方法步骤(win11 组策略)

  • 情人节海报怎么设计(情人节海报怎么画简单)

  • PHP的几个常用加密函数(php添加)

  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设 电脑维修 湖南楚通运网络