ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

织梦富文本编辑器ckeditor更换为kindeditor

2020-08-09 08:03:19  阅读:311  来源: 互联网

标签:文本编辑 false ckeditor items kindeditor extendconfig etype include


最终效果

操作教程

kindeditor基础上添加了如下功能

  • qq客服快速添加
  • mp4、mp3、第三方视频播放 (iis环境记得添加MIME类型,.mp4类型为application/x-shockwave-flash)
  • 快速快捷键分页标签插入

使用前必须先解决以下2个问题,已经解决的跳过

1、上传的mp4文件提示多媒体文件类型不在许可列表和站内媒体选择无法显示

https://www.dedehtml.com/notes/dede-mediatype.html

2、织梦文章内容保存第三方视频iframe变图片的解决方法

https://www.dedehtml.com/notes/iframe-images.html

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

https://pan.baidu.com/s/1lZTuPJnOcNcf7JLKkRohbw 密码: wfaa

使用教程

1、选择对应的编码版本下载,解压得到dialogkindeditor,把这2个文件夹上传到网站include文件夹里

2、打开 include/inc/inc_fun_funAdmin.php 找到

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

在它上面加入

else if($GLOBALS['cfg_html_editor']=='kindeditor')
{
	$fvalue = dede_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 = "<link rel=\"stylesheet\" href=\"{$GLOBALS['cfg_cmspath']}/include/kindeditor/themes/default/default.css\" /><link rel=\"stylesheet\" href=\"{$GLOBALS['cfg_cmspath']}/include/kindeditor/plugins/code/prettify.css\" /><script src=\"{$GLOBALS['cfg_cmspath']}/include/kindeditor/kindeditor-all.js\"></script><script src=\"{$GLOBALS['cfg_cmspath']}/include/kindeditor/lang/zh-CN.js\"></script><script src=\"{$GLOBALS['cfg_cmspath']}/include/kindeditor/plugins/code/prettify.js\"></script><script type=\"text/javascript\">KindEditor.ready(function(K) {editor1 = K.create('textarea[name=\"{$fname}\"]', {imageSizeLimit : '10MB',imageUploadLimit : 100,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();});</script><textarea name=\"{$fname}\" style=\"height:{$nheight}px;visibility:hidden;width:100%;\">{$fvalue}</textarea>";
	if($gtype=="print")
	{
		echo $code;
	}
	else
	{
		return $code;
	}
}

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

会员和评论里面的kindeditor编辑器图片上传没有本地上传按钮的解决方法

打开 /include/inc/inc_fun_funAdmin.php 找到

$uploadJson = "";

注释或者删除它

继续找到

$extendconfig = 'allowImageUpload : false,';

注释或者删除它

标签:文本编辑,false,ckeditor,items,kindeditor,extendconfig,etype,include
来源: https://www.cnblogs.com/dedemao/p/13461502.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有