大 哥

导航

fck使用配置

添加视频插件:

1、解压文件到 FCKeditor\editor\plugins,命名为Media
2、修改配置文件 FCKeditor\fckconfig.js ,包括启用插件和添加按钮。

 

  1. FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;         //找到这一句,配置插件路径   
  2. FCKConfig.Plugins.Add( 'Media''en,zh,zh-cn' ) ;  //启用插件   
  3.      
  4. …………  //中间代码省略   
  5.      
  6. FCKConfig.ToolbarSets["Default"] = [     
  7.     ['Source','Templates'],     
  8.     ['FontName','FontSize'],     
  9.     ['TextColor','BGColor'],     
  10.     ['Image','Flash'],  //可以用Media替换Flash   
  11.     ['Table','Rule'],     
  12.     ['FitWindow','ShowBlocks'],     
  13.    ['Smiley','SpecialChar','Media'], //或者加入Media按钮   
  14.     '/',     
  15.     ['PasteText','PasteWord','RemoveFormat'],     
  16.     ['Undo','Redo','Find','Replace'],     
  17.     ['Bold','Italic','Underline','StrikeThrough'],     
  18.     ['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],     
  19.     ['JustifyLeft','JustifyCenter','JustifyRight'],     
  20.     ['Anchor','Link','Unlink'//我的按钮的配置,可能和你的不太一样   
  21. ] ;    

找到类似代码添加如下内容:

FCKConfig.ImageUpload = true ;
FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension + '?Type=Image' ;
FCKConfig.ImageUploadAllowedExtensions = ".(jpg|gif|jpeg|png|bmp)$" ;  // empty for all
FCKConfig.ImageUploadDeniedExtensions = "" ; 

添加如下内容:

  1. FCKConfig.MediaUpload = true ;   
  2. FCKConfig.MediaUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' +    
  3.        _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Media' ;   
  4. FCKConfig.MediaUploadAllowedExtensions = ".(avi|asf)$" ;  // empty for all   
  5. FCKConfig.MediaUploadDeniedExtensions = "" ;       // empty for no one  

下载地址:http://dev.fckeditor.net/ticket/382

 

Media.zip Download (23.9 KB) - added by alfonsoml 3 years ago.
adjusted the way to get paths

 

 

1. 检查并修改web.config,添加的内容如下:
<appSettings>
      <add key="FCKEditor:BasePath" value="/fckeditor/"/>
      <add key="FCKeditor:UserFilesPath" value="/userfiles/"/>
</appSettings>
 
一定需要注意的是,路径以"/"结尾,否则会出错。
 
2. 可能需要对config.ascx进行修改:
// URL path to user files.
UserFilesPath = "/userfiles/";
 
// The connector tries to resolve the above UserFilesPath automatically.
// Use the following setting it you prefer to explicitely specify the
// absolute path. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' URL must point to the same directory.
UserFilesAbsolutePath = "";
 
同时,FCKEditor针对image/flash/file/media上传类型,会各自添加相应的子目录:
TypeConfig[ "Flash" ].FilesPath                    = "%UserFilesPath%flash/";
……
TypeConfig[ "Media" ].FilesPath                    = "%UserFilesPath%media/";
 
你也可以进一步对上述code进行扩展,如针对不同的用户,自动建立对应的子目录,将用户的文件进行隔离和分开。示例代码如下:
string imagepath = "%UserFilesPath%" + m_userName + "/image/";
TypeConfig["Image"].FilesPath = imagepath;
TypeConfig["Image"].FilesAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/");
TypeConfig["Image"].QuickUploadPath = imagepath;
TypeConfig["Image"].QuickUploadAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%");
 
最后,还需要修改FCKEditor下面的fckconfig.js 配置文件:
找到:FCKConfig.DefaultLanguage ='en'   改为 FCKConfig.DefaultLanguage ='zh-cn'
找到:var _FileBrowserLanguage = 'php' 改为 var _FileBrowserLanguage = 'aspx'
找到:var _QuickUploadLanguage= 'php' 改为 var _QuickUploadLanguage = 'aspx'
FCKConfig.FontNames         = '宋体;黑体;楷体_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;

 

posted on 2010-05-01 11:12  VIP-爷  阅读(244)  评论(0)    收藏  举报