﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-计算机技術文摘-随笔分类-Dkingcms</title><link>http://www.cnitblog.com/cici/category/8950.html</link><description /><language>zh-cn</language><lastBuildDate>Mon, 10 Aug 2015 01:28:03 GMT</lastBuildDate><pubDate>Mon, 10 Aug 2015 01:28:03 GMT</pubDate><ttl>60</ttl><item><title>kingcms后台编辑器不能用,kingcms更换编辑器</title><link>http://www.cnitblog.com/cici/archive/2015/08/05/90168.html</link><dc:creator>计算机技术博客</dc:creator><author>计算机技术博客</author><pubDate>Wed, 05 Aug 2015 15:12:00 GMT</pubDate><guid>http://www.cnitblog.com/cici/archive/2015/08/05/90168.html</guid><description><![CDATA[ kingcms后台编辑器好像自从用了告别了IE6就不再好用，网上找了很多资料终于找到解决的办法并测试成功。

方案：把kingcms后台编辑器更换为<a href="http://kindeditor.net/">kindeditor</a> 最新版本是4.1.10　更换成功后比原来的FCKeditor更好用，

步骤　
１、下载kindeditor
２、上传至服务器的admin/system/editor目录下并把文件夹改名为"kindeditor"
３、在page/system/fun.asp文件里找到public sub form_editor(l1,l2,l3,l4)函数，在函数select case lcase(r_editor)语句里再加一个case，代码如下：
case"kindediter"
Il ""
Il ""
Il "<script charset='utf-8' src='../system/editor/kindediter/kindeditor.js'></script>"
Il "<script charset='utf-8' src='../system/editor/kindediter/lang/zh_CN.js'></script>"
Il "<script charset='utf-8' src='../system/editor/kindediter/plugins/code/prettify.js'></script>"
Il "<script>"
Il "  KindEditor.ready(function(K) {"
Il "  var editor1 = K.create(""textarea[name='"&l1&"']"", {"
Il "  cssPath : '../system/editor/kindediter/plugins/code/prettify.css',"
Il "  uploadJson : '../system/editor/kindediter/asp/upload_json.asp',"
Il "  fileManagerJson : '../system/editor/kindediter/asp/file_manager_json.asp',"
Il "  allowFileManager : true,"
Il "  afterCreate : function() {"
Il "  var self = this;"
Il "  K.ctrl(document, 13, function() {"
Il "  self.sync();"
Il "  K('form[name=form1]')[0].submit();"
Il "  });"
Il "  K.ctrl(self.edit.doc, 13, function() {"
Il "  self.sync();"
Il "  K('form[name=form1]')[0].submit();"
Il "  });"
Il "  }"
Il "  });"
Il "  prettyPrint();"
Il "  });"
Il "</script>"
Il "<textarea name='"&l1&"' style='width:800px;height:490px;visibility:hidden;'>"& formencode(l3) &"</textarea>"

三、默认的KindEditor文件包没有上传图片加水印功能，需要另外修改相关文件，配置方法《ASP中配置Kindeditor上传图片选择添加水印功能》，不过我制作的精简文件包已经配置了水印功能。

四、需要注意的是，配置里的放图片与附件目录的是../../../../../up_files/，也就是网站的根目录里的up_files目录，如果你想修改，可以修改这几个文件：
1、dj_KindEditer/asp/file_manager_json.asp
'根目录路径，可以指定绝对路径，比如 /var/www/attached/
rootPath = "../../../../../up_files/"
'根目录URL，可以指定绝对路径，比如 http://www.yoursite.com/attached/
rootUrl = aspUrl & "../../../../../up_files/"

2、dj_KindEditer/asp/upload_json.asp
'文件保存目录路径
savePath = "../../../../../up_files/"
'文件保存目录URL
saveUrl = aspUrl & "../../../../../up_files/"
文中所说办法来自http://www.cnit618.com/html/kyxt/kingcms/3077.htm <img src ="http://www.cnitblog.com/cici/aggbug/90168.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/cici/" target="_blank">计算机技术博客</a> 2015-08-05 23:12 <a href="http://www.cnitblog.com/cici/archive/2015/08/05/90168.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>kingcms使用手记</title><link>http://www.cnitblog.com/cici/archive/2015/08/05/90167.html</link><dc:creator>计算机技术博客</dc:creator><author>计算机技术博客</author><pubDate>Wed, 05 Aug 2015 15:11:00 GMT</pubDate><guid>http://www.cnitblog.com/cici/archive/2015/08/05/90167.html</guid><description><![CDATA[  1、kingcms后台列表上方的菜单出现[[common/listk]　影响美观可以通过修改 page/模块目录/language/zh-cn.xml 在段中加入目录列表就ＯＫ！
 ２、更新网站，通过导入功能导入文章后，不能再添加文章，但是可以修改，可能是由于导入数据库修改了Ｋid的属性，（原本是"自动编号"改为"数字"） 改决办法删除"kid"字段，再新建一个"kid"字段并设置为"自动编号"和"主键&#8221;即可  

3、kingcms做站的朋友估计有的留意到了，这个cms生成的页面，代码头部总是自动加入了两行如下的代码:

<script type="text/javascript">var king_page='page/';</script>
<script src="/page/system/inc/fun.js" type="text/javascript"></script>

让人一看就知道是kingcms做的站，不爽吧。

这两句代码是kc用来提供页面一些特殊功能使用的，比如页面自动更新、文章热度数字的动态加载等。不过一般没什么大用，如果你用不到这些特殊的js效果的功能，首页还是自己手工更新生成，那么你完全可以去掉这两行代码，如何去掉哪，方法如下。

首先打开page/system/fun.asp文件，用记事本打开即可，打开后查找字符串 var king_page= 会找到如下的一段代码:

public function read(l1,l2)'读取模板 l1:外部 l2:内部
 dim l3,l4,l7,l8,l9
 '检索缓存
 dim hi
 hi = replace(king_filepath,"/","-") & "-c_t_" & md5(l1 & "|" & l2,1) 
 If Not IsEmpty(Application(hi)) then 
  read = Application(hi)
  Exit Function
 End If
 
 l7="../../"&king_templates&"/"&l1
 if isexist(l7)=false then l7="../../"& king_templates&"/"&king_default_template
 l8=readfile(l7)'读取waibu模板内容
 l8=replacee(l8,"(\<\/head\>)","<script type=""text/javascript"">var king_page='"&page&"';</script>"&vbcrlf&"<script src="""&inst&"/" & page&"system/inc/fun.js"" type=""text/javascript""></script>"&vbcrlf&"</head>")

 l3="../../"& king_templates&"/inside/"&l2'读取内部模板
 if isexist(l3)=false then l3="../../"& king_templates&"/inside/"&split(l2,"/")(0)&"/"&king_default_template
 l4=readfile(l3)

 if cstr(l2)="" then
  l9=l8
 else
  l9=llllI(l8,l4,"(\{king:)(inside) {0,}?(\/\})")
 end if
 read=formatpath(l9)&l11(1)
 Application(hi) = read
end function

要特别留意上面我加红的那行，这行代码就是自动在生成的页面中加入对fun.js的调用的。直接删掉这行代码，保存即可。

修改好后重新生成一下文件试试，讨厌的fun.js引用是不是不见了哪。呵呵
<img src ="http://www.cnitblog.com/cici/aggbug/90167.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/cici/" target="_blank">计算机技术博客</a> 2015-08-05 23:11 <a href="http://www.cnitblog.com/cici/archive/2015/08/05/90167.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>