fck使用配置
添加视频插件:
1、解压文件到 FCKeditor\editor\plugins,命名为Media
2、修改配置文件 FCKeditor\fckconfig.js ,包括启用插件和添加按钮。
- FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ; //找到这一句,配置插件路径
- FCKConfig.Plugins.Add( 'Media', 'en,zh,zh-cn' ) ; //启用插件
- ………… //中间代码省略
- FCKConfig.ToolbarSets["Default"] = [
- ['Source','Templates'],
- ['FontName','FontSize'],
- ['TextColor','BGColor'],
- ['Image','Flash'], //可以用Media替换Flash
- ['Table','Rule'],
- ['FitWindow','ShowBlocks'],
- ['Smiley','SpecialChar','Media'], //或者加入Media按钮
- '/',
- ['PasteText','PasteWord','RemoveFormat'],
- ['Undo','Redo','Find','Replace'],
- ['Bold','Italic','Underline','StrikeThrough'],
- ['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
- ['JustifyLeft','JustifyCenter','JustifyRight'],
- ['Anchor','Link','Unlink'] //我的按钮的配置,可能和你的不太一样
- ] ;
找到类似代码添加如下内容:
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 = "" ;
添加如下内容:
- FCKConfig.MediaUpload = true ;
- FCKConfig.MediaUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' +
- _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Media' ;
- FCKConfig.MediaUploadAllowedExtensions = ".(avi|asf)$" ; // empty for all
- FCKConfig.MediaUploadDeniedExtensions = "" ; // empty for no one
下载地址:http://dev.fckeditor.net/ticket/382
(23.9 KB) - added by alfonsoml 3 years ago.
1. 检查并修改web.config,添加的内容如下:
<appSettings>
<add key="FCKEditor:BasePath" value="/fckeditor/"/>
<add key="FCKeditor:UserFilesPath" value="/userfiles/"/>
</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' ;
浙公网安备 33010602011771号