国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 織夢DEDE > 正文

織夢dedecms自帶文本編輯器ckeditor更換為kindeditor編輯器帶代碼高亮

2024-07-12 08:59:54
字體:
供稿:網(wǎng)友

在kindeditor基礎(chǔ)上添加了如下功能

1、qq客服快速添加

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

3、動(dòng)態(tài)百度地圖

kindeditor織夢版(gbk/utf8)打包下載

云盤下載:http://pan.baidu.com/s/1dF1WKJv            密碼: vwea

該版本為4.1.10,需要4.1.4版本的請移步《織夢整合編輯器Kindeditor 4.1.4 GBK+UTF一鍵安裝》

 

下載解壓,選擇對(duì)應(yīng)的編碼版本,把include文件夾上傳到網(wǎng)站根目錄

最后給dedecms添加kindeditor編輯器調(diào)用代碼

dedecms utf8編碼程序的

打開 include/inc/inc_fun_funAdmin.php 找到

 else {

        /*

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

        // 當(dāng)前版本,暫時(shí)取消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 = <<<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;width: 100%;">{$fvalue}</textarea>HTML;	if($gtype=="print")	{		echo $code;	}	else	{		return $code;	}}

 

dedecms gbk編碼程序的

打開 include/inc/inc_fun_funAdmin.php 找到

 else {

        /*

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

        // 當(dāng)前版本,暫時(shí)取消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 = <<<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" charset="gb2312"></script><script src="{$GLOBALS['cfg_cmspath']}/include/kindeditor/lang/zh_CN.js" charset="gb2312"></script><script src="{$GLOBALS['cfg_cmspath']}/include/kindeditor/plugins/code/prettify.js" charset="gb2312"></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;width: 100%;">{$fvalue}</textarea>HTML;	if($gtype=="print")	{		echo $code;	}	else	{		return $code;	}}

 

最后

后臺(tái)-系統(tǒng)-系統(tǒng)基本參數(shù)-核心設(shè)置-Html編輯器 ,填寫kindeditor

織夢dedecms自帶文本編輯器ckeditor更換為kindeditor編輯器帶代碼高亮

要實(shí)現(xiàn)代碼高亮需在前臺(tái)模板頁(比如我的是aricle_aritlce.htm)需引入以下幾個(gè)文件:

<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的結(jié)束符之前,如果在頁面頭部聲明是沒效果的。


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 保定市| 梁平县| 浮山县| 绥宁县| 民乐县| 莱州市| 峨边| 奉新县| 油尖旺区| 壤塘县| 富宁县| 灵石县| 洮南市| 延吉市| 汉源县| 拉萨市| 天峨县| 义马市| 苏尼特左旗| 嘉义市| 平远县| 宁陕县| 汝州市| 钟山县| 盐津县| 龙川县| 台南县| 元江| 荔浦县| 綦江县| 永平县| 广宁县| 淮滨县| 利川市| 罗山县| 清原| 浠水县| 耿马| 甘洛县| 江阴市| 汨罗市|