Fckeditor + Ckfinder 的配置详情

Fckeditor 图片上传后只能看见到图片列表,无意中发现ckfinder 的样式真好看,而且能结合到一起!故写此文!

以下是Fckeditor + Ckfinder 的配置详情:

 

首先把下回来的ckfinder放到Fckeditor(就是你原来放Fck的目录下,ckfinder必须有FCK才可以用哦,她属于FCK的一庞大插件)的饿editor目录下,然后把ckfinder目录里的bin下的CKFinder.dll拷贝到网站目录bin下。然后开始设置配置:打开ckfinder目录下的config.ascx文件
修改地方有:
1、设置访问权限

public override bool CheckAuthentication()

{
        // WARNING : DO NOT simply return "true". By doing so, you are allowing
        // "anyone" to upload and list the files in your server. You must implement
        // some kind of session validation here. Even something very simple as...
        //
                //return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
        return true;//(增加这句,如果你需要设置打开ckfinder访问权限可以在这里设置哦,我这里就不考虑权限了直接打开。)
        //
        // ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
        // user logs on your system.

    
   //return false;//(注释这句,默认这句未被注释)
    }



2
、设置文件访问目录

引用内容

BaseUrl = "/ckfinder/userfiles/";

这是上传文件的地址,也是ckfinder浏览文件的位置了。我们设置成

BaseUrl = "/fckeditor/editor/ckfinder/userfiles/";//这个路径可以自己设



3
、设置生成缩略图

        Thumbnails.Url = BaseUrl + "_thumbs/";
        Thumbnails.Dir = "";
        Thumbnails.Enabled = true;
        Thumbnails.MaxWidth = 100;
        Thumbnails.MaxHeight = 100;
        Thumbnails.Quality = 80;


具体干啥应该看参数名称就知道了吧。。。
文件后面的代码是设置上传文件类型和大小等等,大家看参数应该都可以明白,这里略过。
4、修改原Fck配置文件以结合FCK和ckfinder。
打开/fckeditor/目录下的fckconfig.js,到最下面:

FCKConfig.LinkBrowser = true ;
FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'ckfinder/ckfinder.html' ;
FCKConfig.LinkBrowserWindowWidth    = FCKConfig.ScreenWidth * 0.7 ;        // 70%
FCKConfig.LinkBrowserWindowHeight    = FCKConfig.ScreenHeight * 0.7 ;    // 70%

FCKConfig.ImageBrowser = true ;
FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'ckfinder/ckfinder.html?type=Images' ;
FCKConfig.ImageBrowserWindowWidth  = FCKConfig.ScreenWidth * 0.7 ;    // 70% ;
FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ;    // 70% ;

FCKConfig.FlashBrowser = true ;
FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'ckfinder/ckfinder.html?type=Flash' ;
FCKConfig.FlashBrowserWindowWidth  = FCKConfig.ScreenWidth * 0.7 ;    //70% ;
FCKConfig.FlashBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ;    //70% ;

FCKConfig.LinkUpload = true ;
FCKConfig.LinkUploadURL = FCKConfig.BasePath +'ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files' ;
FCKConfig.LinkUploadAllowedExtensions    = ".(7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip)$" ;            // empty for all
FCKConfig.LinkUploadDeniedExtensions    = "" ;    // empty for no one

FCKConfig.ImageUpload = true ;
FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images' ;
FCKConfig.ImageUploadAllowedExtensions    = ".(jpg|gif|jpeg|png|bmp)$" ;        // empty for all
FCKConfig.ImageUploadDeniedExtensions    = "" ;                            // empty for no one

FCKConfig.FlashUpload = true ;
FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash' ;
FCKConfig.FlashUploadAllowedExtensions    = ".(swf|flv)$" ;        // empty for all
FCKConfig.FlashUploadDeniedExtensions    = "" ;                    // empty for no one



红色部分是修改部分,权限问题可以根据自己的需要打开哦。
就这样了

 

Ckfinder是收费的于是在页面上出现了他们的一些版权信息清理掉:

ckfinder_ie.js ckfinder_gecko.js 文件中分别注释掉:

/*en.call(window,qo);// 注销版权 Modify By Mamm | 2009-9-4 16:20*/

转载于:https://www.cnblogs.com/malaohu/archive/2011/03/10/1980009.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值