PJ3富文本编辑器FCKeditor换成UEditor
作者:admin 日期:2024-09-17
在UEditor官网github.com/fex-team/ueditor/releases下载ASP版本文件(ueditor1_4_3_3-utf8-asp.zip),解压到PJBlog根目录UEditor文件夹中,然后按照下边方法修改即可。
第一步:创建一个新的asp文件(UEditor.asp)
ASP/Visual Basic代码
- <%
- Class UEditor
- private sBasePath
- private sInstanceName
- private sWidth
- private sHeight
- private sToolbarSet
- private sValue
- Private Sub Class_Initialize()
- sBasePath = "/UEditor"
- sWidth = "100%"
- sHeight = "200px"
- sToolbarSet = "Default"
- sValue = ""
- End Sub
- Public Property Let BasePath( basePathValue )
- sBasePath = basePathValue
- End Property
- Public Property Let InstanceName( instanceNameValue )
- sInstanceName = instanceNameValue
- End Property
- Public Property Let Width( widthValue )
- sWidth = widthValue
- End Property
- Public Property Let Height( heightValue )
- sHeight = heightValue
- End Property
- Public Property Let ToolbarSet( toolbarSetValue )
- sToolbarSet = toolbarSetValue
- End Property
- Public Property Let Value( newValue )
- If ( IsNull( newValue ) or IsEmpty( newValue ) ) Then
- sValue = ""
- Else
- sValue = newValue
- End If
- End Property
- ' Generates the instace of the editor in the HTML output of the page.
- Public Sub Create( instanceName )
- response.write CreateHtml( instanceName )
- end Sub
- ' Returns the html code that must be used to generate an instance of UEditor.
- Public Function CreateHtml( instanceName )
- dim html
- html = ""
- '加载编辑器的容器
- html = html & Replace(Replace(Replace(Replace("<script id=""{0}"" name=""{0}"" type=""text/plain"" style=""width:{1};height:{2};"">{3}</script>", "{0}", instanceName), "{1}", sWidth), "{2}", sHeight), "{3}", sValue)
- '实例化编辑器
- If sToolbarSet="Basic" Then
- html = html & Replace("<script type=""text/javascript"">UE.getEditor('{0}', {toolbars: [['fullscreen', 'source', 'undo', 'redo', 'bold']]});</script>", "{0}", instanceName)
- Else
- html = html & Replace("<script type=""text/javascript"">UE.getEditor('{0}', {toolbars: [['fullscreen', 'source', '|', 'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|','indent', 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|','undo', 'redo', '|','bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'selectall', 'cleardoc', '|','link', 'unlink', 'anchor', '|','simpleupload', 'insertimage', 'emotion', 'insertvideo', 'music', 'attachment', 'map', 'pagebreak', 'template', 'background', '|','date', 'time', 'spechars', 'snapscreen', '|','touppercase', 'tolowercase', '|','inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols']]});</script>", "{0}", instanceName)
- End If
- CreateHtml = html
- End Function
- Public Sub LoadScript()
- dim html
- html = ""
- html = html & "<script type=""text/javascript"" charset=""utf-8"" src=""" & sBasePath & "/ueditor.config.js""></script>"
- html = html & "<script type=""text/javascript"" charset=""utf-8"" src=""" & sBasePath & "/ueditor.all.min.js""> </script>"
- html = html & "<script type=""text/javascript"" charset=""utf-8"" src=""" & sBasePath & "/lang/zh-cn/zh-cn.js""></script>"
- Response.Write(html)
- End Sub
- End Class
- %>
第二步:修改blogpost.asp
- 删除
ASP/Visual Basic代码
- <!--#include file="FCKeditor/fckeditor.asp" -->
2.添加
ASP/Visual Basic代码
- <!--#include file="UEditor/UEditor.asp" -->
3.修改
找到下面代码
ASP/Visual Basic代码
- <label title="FCK在线编辑器" for="ET2" accesskey="K">
- <input name="log_editType" type="radio" id="ET2" value="0" /> FCKeditor</label></td>
替换
ASP/Visual Basic代码
- <label title="UEditor" for="ET2" accesskey="E"><input name="log_editType" type="radio" id="ET2" value="0" />UEditor</label>
4.修改
ASP/Visual Basic代码
- 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.Height = "350"
- oFCKeditor.Create "Message"
替换成
ASP/Visual Basic代码
- Dim oUEditor
- Set oUEditor = New UEditor
- oUEditor.LoadScript '只加载一次脚本
- oUEditor.Value = ""
- oUEditor.Create "Message"
5.修改
ASP/Visual Basic代码
- 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"
替换
ASP/Visual Basic代码
- Dim oUEditor1
- Set oUEditor1 = New UEditor
- oUEditor1.height = "100px"
- oUEditor1.ToolbarSet = "Basic"
- oUEditor1.Value = ""
- oUEditor1.Create "log_Intro"
第三步:修改Blogedit.asp
1.删除
XML/HTML代码
- <!--#include file="FCKeditor/fckeditor.asp" -->
2.添加
XML/HTML代码
- <!--#include file="UEditor/UEditor.asp" -->
3.修改
XML/HTML代码
- 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.Height = "350"
- oFCKeditor.Create "Message"
替换
XML/HTML代码
- Dim oUEditor
- Set oUEditor = New UEditor
- oUEditor.LoadScript '只加载一次脚本
- oUEditor.Value = UnCheckStr(lArticle.logMessage)
- oUEditor.Create "Message"
4.修改
XML/HTML代码
- 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"
替换
XML/HTML代码
- Dim oUEditor1
- Set oUEditor1 = New UEditor
- oUEditor1.Height = "100px"
- oUEditor1.ToolbarSet = "Basic"
- oUEditor1.Value = UnCheckStr(lArticle.logIntro)
- oUEditor1.Create "log_Intro"
第四步:修改Class/cls_logAction.asp
1.替换(有两个地方需要替换修改)
XML/HTML代码
- logIntro = closeHTML(CheckStr(SplitLines(logMessage, blog_introLine)))
替换成
XML/HTML代码
- logIntro = closeHTML(SplitLines(logMessage, blog_introLine))
2。依旧修改两个地方
XML/HTML代码
- weblog("log_Content") = CheckStr(logMessage)
替换成
XML/HTML代码
- If Int(logEditType) =1 Then
- weblog("log_Content") = CheckStr(logMessage)
- Else
- weblog("log_Content") = logMessage
- End If
第五步:修改ConContent.asp
删除
XML/HTML代码
- <!--#include file="FCKeditor/fckeditor.asp" -->
完成
[本日志由 admin 于 2024-09-17 02:07 AM 更新]
上一篇: 身份证号码使用XLOOKUP COUNTIF SUMIF 函数问题和解决办法下一篇: 测试UE编辑器
文章来自: 本站原创
Tags: 编辑器
发表评论