AspCms 升级百度编辑器

     1.下载百度编辑器

   网址:http://ueditor.baidu.com/website/download.html

  2.上传百度编辑器到admin下

  3.修改调用编辑器的文件

   _content/_Content/AspCms_ContentAdd.asp
   _content/_Content/AspCms_ContentEdit.asp
   _content/_About/AspCms_AboutEdit.asp
   _content/_Sort/AspCms_SortEdit.asp
   _content/_Sort/AspCms_Sortadd.asp

  4.依次引用ueditor.all.min.js    ueditor.config.js   euditor/themes/default/css/ueditor.css

        <script src="../../ueditor/ueditor.all.min.js" type="text/javascript"></script>

        <script  src="../../ueditor/ueditor.config.js" type="text/javascript"></script>

        <link rel="stylesheet" type="text/css" href="../../ueditor/themes/default/css/ueditor.css" />

     5.替换调用编辑器的代码

 1 <%Dim oFCKeditor:Set oFCKeditor = New FCKeditor
    :oFCKeditor.BasePath
="../../editor/"
    
:oFCKeditor.ToolbarSet="AdminMode"
    
:oFCKeditor.Width="615"
    
:oFCKeditor.Height="300"
    
:oFCKeditor.Value=decodeHtml(Content)
    :oFCKeditor.Create
"Content" 2 3 'Default,AdminMode,Simple,UserMode,Basic 4 %> 5 <script type="text/javascript"> 6 function SetEditorPage(EditorName, ContentStr) { 7 var oEditor = FCKeditorAPI.GetInstance(EditorName) ; 8 oEditor.Focus(); 9 //setTimeout(function() { oEditor.Focus(); }, 100); 10 oEditor.InsertHtml(ContentStr); 11 } 12 </script>

    更换为

1 <textarea name="Content" id="myEditor" style="width:780px;"><%=content%></textarea>
2 <script type="text/javascript">
3     UE.getEditor('myEditor')
4 </script>

    6.修改Uploader.Class.asp

  行 203-215

 1 Private Function CheckOrCreatePath( ByVal path )
 2     
 3     Set fs = Server.CreateObject("Scripting.FileSystemObject")
 4     Dim parts
 5     parts = Split( path, "/" )
 6     path = ""
 7     For Each part in parts
 8         path = path + part + "/"
 9         If fs.FolderExists( path ) = False Then
10             fs.CreateFolder( path )
11         End If
12     Next
13 End Function

  修改为:

 1 Public Function CreateDir(ByVal crDirname) 
 2   Dim M_fso 
 3   CreateDir=False 
 4   Set M_fso = CreateObject("Scripting.FileSystemObject") 
 5   If (M_fso.FolderExists(crDirname)) Then 
 6    CreateDir=False 
 7   Else 
 8    M_fso.CreateFolder(crDirname) 
 9    CreateDir=True 
10   End If 
11   Set M_fso = Nothing 
12  End Function 
13  
14  Function CheckOrCreatePath(byval LocalPath) '建立目录的程序,如果有多级目录,则一级一级的创建 
15   on error resume next 
16   LocalPath = replace(LocalPath,"\","/") 
17   set FileObject = server.createobject("Scripting.FileSystemObject") 
18   patharr = split(LocalPath,"/") 
19   path_level = ubound(patharr) 
20   for i = 0 to path_level 
21   if i=0 then pathtmp=patharr(0) & "/" else pathtmp = pathtmp & patharr(i) & "/" 
22   cpath = left(pathtmp,len(pathtmp)-1) 
23   if not FileObject.FolderExists(cpath) then FileObject.CreateFolder cpath 
24   next 
25   set FileObject = nothing 
26   if err.number<>0 then 
27   CreateDIR = false 
28   err.Clear 
29   else 
30   CreateDIR = true 
31   end if 
32  End Function

  7.修改config.json

posted @ 2014-08-26 16:11  Say丶No  阅读(654)  评论(0编辑  收藏  举报