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


    最终效果

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

    • qq客服快速添加
    • ckplayer播放器,支持本地flv,mp4(iis环境记得添加MIME类型,.mp4类型为application/x-shockwave-flash)
    • 动态百度地图
    • 快速快捷键分页标签插入

    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')
    {
    	$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
    <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-min.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) {
    		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();
    	});
    </script>
    <textarea name="{$fname}" style="height:{$nheight}px;visibility:hidden; 100%;">{$fvalue}</textarea>
    HTML;
    	if($gtype=="print")
    	{
    		echo $code;
    	}
    	else
    	{
    		return $code;
    	}
    }

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

  • 相关阅读:
    Leetcode(680) ;验证回文字符串 Ⅱ
    mysql常用操作语句
    组合索引问题
    php生成一维码以及保存-转载
    php后台实现页面跳转的方法-转载
    php操作表格(写)
    虚拟机复制后上网冲突的问题
    centos下安装nginx(转载)
    虚拟机与宿主机可以互相ping通,但是外网不能
    防火墙设置:虚拟机ping不通主机,但是主机可以ping通虚拟机(转载)
  • 原文地址:https://www.cnblogs.com/dedehtml/p/9901297.html
Copyright © 2020-2023  润新知