清心语轩

在喧嚣的尘世,找寻心灵的恬静

清心语轩
当前位置: 首页 > 网站建设 > 正文

将PJ3内置的FCK编辑器改为xhEditor编辑器

FCK编辑器实在是太臃肿,我一般都不使用,除非需要使用表格,毕竟UBB没有表格功能,PJ4又迟迟不发布,所以就只能自己动手更换编辑器了。之前也尝试过,不知道为什么最后放弃了,今天心血来潮,就又试着更换了一下,这次还是比较顺利,能够完美的兼容,只是那个附件上传功能,我就没有去折腾它了,毕竟我不使用附件功能。我的空间实在是太小,放图片什么的都太奢侈了,所以我的图片都是放在photobucket的图床上面,速度相当的快,而且管理方便,何乐而不为呢。

下面我把我的方法共享出来,也许你会需要,顺便也自己备份一下。

-------------华丽的分割线-------------

1、将下载的xheditor.js以及xheditor_emot、xheditor_plugins和xheditor_skin三个文件夹上传到根目录下的xheditor文件夹。

2、打开header.asp文件

在之前添加代码:





注:因为我之前已经上传过jquery.js文件,所以这次直接调用,如果没有,请上传到相关目录。

3、打开blogpost.asp文件

找到代码:



把以上代码修改为:



找到代码:

<%
if log_editType=0 then
Dim sBasePath
sBasePath = "fckeditor/"
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = sBasePath
oFCKeditor.Config("AutoDetectLanguage") = False
oFCKeditor.Config("DefaultLanguage")    = "zh-cn"
oFCKeditor.Value = ""
oFCKeditor.Create "Message"
else
UBB_TextArea_Height="200px;"
UBB_AutoHidden=False
UBBeditor("Message")
end if
%>

把以上代码修改为:

<%
If log_editType = 0 Then
%>

<%
Else
UBB_TextArea_Height = "200px;"
UBB_AutoHidden = False
UBBeditor("Message")
End If
%>

找到代码:

<%
if log_editType=0 then
Dim oFCKeditor1
Set oFCKeditor1 = New FCKeditor
oFCKeditor1.BasePath = sBasePath
oFCKeditor1.Height="150"
oFCKeditor1.ToolbarSet="Basic"
oFCKeditor1.Config("AutoDetectLanguage") = False
oFCKeditor1.Config("DefaultLanguage")    = "zh-cn"
oFCKeditor1.Value = ""
oFCKeditor1.Create "log_Intro"
else
%>

<%
end if
%>

把以上代码修改为:

<%
If log_editType = 0 Then
%>

<%
Else
%>

<%
End If
%>

4、打开blogedit.asp文件

找到代码:

<%
if log_editType=0 then
Dim sBasePath
sBasePath = "fckeditor/"
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = sBasePath
oFCKeditor.Config("AutoDetectLanguage") = False
oFCKeditor.Config("DefaultLanguage")    = "zh-cn"
oFCKeditor.Value = UnCheckStr(lArticle.logMessage)
oFCKeditor.Create "Message"
else
UBB_TextArea_Height="200px;"
UBB_AutoHidden=False
UBB_Msg_Value=UBBFilter(UnCheckStr(lArticle.logMessage))
UBBeditor("Message")
end if
%>

把以上代码修改为:

<%
If log_editType = 0 Then
%>

<%
Else
UBB_TextArea_Height = "200px;"
UBB_AutoHidden = False
UBB_Msg_Value = UBBFilter(UnCheckStr(lArticle.logMessage))
UBBeditor("Message")
End If
%>

找到代码:

<%
if log_editType=0 then
Dim oFCKeditor1
Set oFCKeditor1 = New FCKeditor
oFCKeditor1.BasePath = sBasePath
oFCKeditor1.Height="150"
oFCKeditor1.ToolbarSet="Basic"
oFCKeditor1.Config("AutoDetectLanguage") = False
oFCKeditor1.Config("DefaultLanguage")    = "zh-cn"
oFCKeditor1.Value = UnCheckStr(lArticle.logIntro)
oFCKeditor1.Create "log_Intro"
else
%>

<%
end if
%>

把以上代码修改为:

<%
If log_editType = 0 Then
%>

<%
Else
%>

<%
End If
%>

相关推荐

发表评论

gravatar

最新评论

  1. Lvtu
    6楼
    2012-11-06 18:01 广东 回复

    春哥,xhEditor模式下日志中需要插入代码时,具体是怎么编辑的?例如你的日志中的代码是怎么插入进去的,然后使用SyntaxHihglighter高亮!

  2. Lvtu
    5楼
    2012-11-02 16:57 广东 回复

    我现用的CKeditor, 有时间也试一下这个东东。。。

  3. Lvtu
    4楼
    2012-11-02 16:50 广东 回复

    春哥,你现在也用的这个?
    日志中的代码高亮是怎么折腾的?

    • 上善若水
      2012-11-02 16:53 重庆 回复

      @Lvtu我现在发表日志都是用的xhEditor,已经彻底把UBB给抛弃了,代码高亮用的SyntaxHihglighter高亮插件。

  4. Lvtu
    地板
    2012-11-02 16:43 广东 回复

    PJ4用的也是这个东东,EE刚加了图片防盗链。。。

    • 上善若水
      2012-11-02 16:44 重庆 回复

      @Lvtu恩。这个编辑器确实比较不错,加载速度也相当OK。就是感觉表格功能不够强大。

  5. liaokai
    板凳
    2012-10-31 19:36 山西 回复

    [qq02]pj4内侧群里前段时间说pj4马上出,正在调试,打算参加内侧呢,呵呵

  6. 数学人
    沙发
    2012-10-27 11:46 广东 回复

    博主,PJ4还会出吗?我见Zblog都有新版了。并且原来的pJ3有些功能已落后了