K9 通用版 博客版 主题版 地方门户版 企业版 |   企业(ASP) 分类 使用 分享 疑问 模板 建议 帮助 错误 其他
+新建主题 [Ajax]
填写帐号密码即可完成注册
+新建话题 最新回复排序 最新主题排序 精华帖子

KingCMS 5asp 广告菜单编辑器修改

1Next >

99163 发表于:10-09-03 13:17 编辑于:09-03 13:21 [添加收藏] 楼主 [回复] #Top#
99163 人气:865 积分:1901 金币:6081
KC元老 灌水狂人

为了自己更新的方便,还是将KingCMS的编辑器改了一下,找了好几个编辑器,不是传输数据有问题就是不符合XHTML编码,有个不错呢又不能上传图片,而KingCMS自带的FCKeditor编辑器会自动加上<p>和<br />,最后找到了这个精简版本的FCKeditor,改好的效果如下,这个编辑器和KingCMS自带的部分是分开的,也就是说后台无论如何修改编辑器的属性不影响这里。

KingCMS5asp广告菜单编辑器修改[图1]

上传部分的代码是用的最新的FCKeditor部分,尽量避免漏洞的威胁吧,至于有没有没空研究了。

先下载这个文件压缩包 解压到KingCMS的Admin/System/editor/目录下,确保直接路径应该是这样
Admin/System/editor/SmallEditor/fckconfig.js
Admin/System/editor/SmallEditor/editor/fckeditor.html
如果自行修改了Admin目录的名称,根据需要自行修改。

现在来修改程序,我提供两种方式的修改吧,打开page/system/fun.asp,搜索 'form_editor
第一种方式是在后台的选择编辑器中可以选择 ,那么找到这个部分

public sub form_editor(l1,l2,l3,l4)
dim I1,configpath
if cstr(l4)="0" then l4=""
Il "<p id=""editor""><label>"&l2&"</label>"
select case lcase(r_editor)
case lcase(king_fckeditor_path)
   dim ofckeditor
   set ofckeditor=new fckeditor
'   ofckeditor.toolbarset="Default"
   ofckeditor.basepath="../system/editor/"&king_fckeditor_path&"/"
   ofckeditor.value=l3
   ofckeditor.create l1
   set ofckeditor=nothing
case"ewebeditor"

在case"ewebeditor"上面插入下面这一段

case"samlleditor"
   dim sfckeditor
   set sfckeditor=new fckeditor
sfckeditor.toolbarset="Default"
    sfckeditor.Width= "90%"
   sfckeditor.basepath="../system/editor/SmallEditor/"
   sfckeditor.value=l3
   sfckeditor.create l1
   set sfckeditor=nothing

保存就可以了,这样后台应该可以选择samlleditor了,选择后所有的编辑器都变成了这个,然后找到Admin/ad/index.asp

找到这段代码
<textarea name=""adtext"" rows=""15"" cols=""10"" class=""in5"">"&formencode(data(1,0))&"</textarea>"
Il king.check("adtext|0|"&encode(ad.lang("check/text")))
将其注释掉,然后加入
Il king.form_editor("adtext",ad.lang("label/text"),data(1,0),"adtext|0|"&encode(ad.lang("check/text")))
就大功告成了

第二种方法其实很简单

将public sub form_editor(l1,l2,l3,l4)这个函数整段复制出来,去掉中间不要的比如case"ewebeditor" 和case"codepress"部分,如下,加入橙色部分

public sub form_smalleditor(l1,l2,l3,l4)
dim I1,configpath
if cstr(l4)="0" then l4=""
Il "<p id=""editor""><label>"&l2&"</label>"
select case lcase("samlleditor")


case lcase(king_fckeditor_path)
   dim ofckeditor
   set ofckeditor=new fckeditor
ofckeditor.toolbarset="Default"
   ofckeditor.basepath="../system/editor/"&king_fckeditor_path&"/"
   ofckeditor.value=l3
   ofckeditor.create l1
   set ofckeditor=nothing

case"samlleditor"
   dim sfckeditor
   set sfckeditor=new fckeditor
sfckeditor.toolbarset="Default"
    sfckeditor.Width= "90%"
   sfckeditor.basepath="../system/editor/SmallEditor/"
   sfckeditor.value=l3
   sfckeditor.create l1
   set sfckeditor=nothing

case else'包括html
   configpath="../system/editor"&r_editor&"/config.inc"
   if isexist(configpath) then
    I1=readfile(configpath)'读取内容
    I1=replace(I1,"{king:break/}",hem2js(king_break))'换行代码
    I1=replace(I1,"{king:value/}",formencode(l3))'内容替换
    I1=replace(I1,"{king:name/}",l1)'name替换
    Il I1
   else
    Il "<style type=""text/css"">@import ""../system/editor/html/style.css"";</style>"
    Il "<script type=""text/javascript"">var textbox='"&l1&"';var king_break='"&htm2js(king_break)&"'</script>"
    Il "<script src=""../system/editor/html/htm.js"" type=""text/javascript""></script>"
    Il "<img src=""../system/editor/html/button.gif"" onclick=""javascript:gethtml(this,event);"" onmousemove=""showTitle(this,event);"" id=""k_htmimg""/>"
    Il "<br />"
    Il "<div id=""k_color""><img src=""../system/editor/html/color.gif"" onclick=""javascript:getIndex(this,event);"" onmousemove=""showColor(this,event)""/></div>"
    Il "<iframe style=""width:0;height:0;border:0;"" id=""dtf""></iframe>"
    Il "<textarea name="""&l1&""" rows=""25"" cols=""100"" id=""txt"" onclick=""javascript:storeCaret(this);hiddenDiv();"">"&formencode(l3)&"</textarea>"
    Il "<script type=""text/javascript"">txtContent=document.getElementById(""txt"");dtf=document.getElementById(""dtf"");</script>"
   end if
end select
Il king.check(l4)
Il "</p>"
end sub

然后打开Admin/ad/index.asp,对应的将

<textarea name=""adtext"" rows=""15"" cols=""10"" class=""in5"">"&formencode(data(1,0))&"</textarea>"
Il king.check("adtext|0|"&encode(ad.lang("check/text")))
将其注释掉,然后加入
Il king.form_smalleditor("adtext",ad.lang("label/text"),data(1,0),"adtext|0|"&encode(ad.lang("check/text")))

这样广告系统的编辑器就和整站的分开了,要修改就自己动手修改了。

另外附带说两句Fckeditor我打开了上传ConfigIsEnabled = True,关闭的话改成False,设置了上传的目录为ConfigUserFilesPath = "/up-files/image/other/"

修改的话自行打开SmallEditor/editor/filemanager/upload/asp/config.asp进行修改


SinCS 发表于:10-09-03 13:20 沙发 [回复] #Top#
SinCS 人气:1148 积分:28 金币:73406
VIP 管理团队 特殊贡献
百度图片,引用错误。
99163 发表于:10-09-03 13:21 板凳 [回复] #Top#
99163 人气:865 积分:1901 金币:6081
KC元老 灌水狂人
已修证,请帮忙移到 ASP类,呵呵,发的时候,没选到
SinCS 发表于:10-09-03 13:23 4楼 [回复] #Top#
SinCS 人气:1148 积分:28 金币:73406
VIP 管理团队 特殊贡献
养成归类的好习惯,也有利于被需要的人关注。
网尘 发表于:10-09-03 19:08 5楼 [回复] #Top#
网尘 人气:29 积分:4 金币:78
要金币啊?郁闷。我有几个,看看。
网尘 发表于:10-09-03 19:09 6楼 [回复] #Top#
网尘 人气:29 积分:4 金币:78
有没有人用过这个编辑器?好用吗?现在真的很想尝试换一下编辑器。
wssxxj 发表于:10-09-03 19:29 7楼 [回复] #Top#
wssxxj 人气:179 积分:70 金币:1323
KC元老
不错,支持下
cityker 发表于:10-10-20 18:16 8楼 [回复] #Top#
cityker 人气:200 积分:462 金币:11745
KC ASP5换了服务器,那个鸟服务器不知道什么问题。不能上传图片。
所以求救
1,有没有检测系统支持不支持组件的工具,这样可以针对性让IDC调整,不然他不知道要调什么。
2,有没有解决方法,比如更换编辑器解决。

多谢
ayan77777 发表于:14-10-31 18:07 9楼 [回复] #Top#
ayan77777 人气:2 积分:0 金币:104
厉害

1Next >

发表回复

帐号 匿名发布 审核后可见 [加载完整在线编辑器]
内容
验证码
KingCMS 内容管理系统

关于我们 联系我们 广告报价 付款方式 站点导航

Copyright © 2004-2015 Focuznet All rights reserved.

广州唯众网络科技有限公司 粤ICP备08008106号