FCKEditor v2.6 编辑器配置图解教程_网页编辑器

集成 FCKEditor v2.6(当前为最新版本)的基本步骤如下:
1. 下载FCKeditor 2.6 基本文件(Main Code)。将解压缩的文件复制到项目的editors/FCKEditorV2 目录下。  
2. 下载 FCKeditor.Net / ASP.NET 控件,复制FredCK.FCKeditorV2.dll 文件到项目的bin目录。

这样就基本可以FCKEditor v2.6 超强的编辑器了,当然还需要在Host Settings中设置默认的编辑器。
关于 FCKEditor 的一些基本配置信息,请参考如下的文章:

如需要使用文件上传功能,还需要修改代码FCKEditorV2/editor/filemanager/connectors/config.ascx(以ASPX代码为例)。这里限制只有登录的用户才可以使用文件上传功能,并且上传的文件只能上传到用户自己的目录。根据每个用户名自动创建对应的文件上传目录。


connectors/config.ascx 更新后的代码如下:

复制代码 代码如下:

/**
* This function must check the user session to be sure that he/she is
* authorized to upload and access files in the File Browser.
*/
private string m_userName;
private int m_userID;
private int m_boardID;
private bool m_isAuthenticated;

private 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 );
//
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs in your system.

string userName = HttpContext.Current.User.Identity.Name;

try
{
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
string[] parts = userName.Split(';');
if (parts.Length == 3)
{
m_userID = int.Parse(parts[0]);
m_boardID = int.Parse(parts[1]);
m_userName = parts[2];
m_isAuthenticated = true;
}
}
}
catch (Exception)
{
m_userName = "";
m_userID = 0;
m_boardID = 0;
m_isAuthenticated = false;
}

return m_isAuthenticated;
}

public override void SetConfig()
{
// SECURITY: You must explicitly enable this "connector". (Set it to "true").
Enabled = CheckAuthentication();

// 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 = "";

// Due to security issues with Apache modules, it is recommended to leave the
// following setting enabled.
ForceSingleExtension = true;

// Allowed Resource Types
AllowedTypes = new string[] { "File", "Image", "Flash", "Media" };

// For security, HTML is allowed in the first Kb of data for files having the
// following extensions only.
HtmlExtensions = new string[] { "html", "htm", "xml", "xsd", "txt", "js" };

TypeConfig[ "File" ].AllowedExtensions = new string[] { "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" };
TypeConfig[ "File" ].DeniedExtensions = new string[] { };
string filepath = "%UserFilesPath%" + m_userName + "/file/";
TypeConfig["File"].FilesPath = filepath;
TypeConfig["File"].FilesAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%file/");
TypeConfig["File"].QuickUploadPath = filepath; // "%UserFilesPath%" + m_userName + "/";
TypeConfig["File"].QuickUploadAbsolutePath = filepath; // (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%");

TypeConfig[ "Image" ].AllowedExtensions = new string[] { "bmp", "gif", "jpeg", "jpg", "png" };
TypeConfig[ "Image" ].DeniedExtensions = new string[] { };
string imagepath = "%UserFilesPath%" + m_userName + "/image/";
TypeConfig["Image"].FilesPath = imagepath;
TypeConfig["Image"].FilesAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%image/");
TypeConfig["Image"].QuickUploadPath = imagepath; // "%UserFilesPath%" + m_userName + "/";
TypeConfig["Image"].QuickUploadAbsolutePath = (UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%");

TypeConfig[ "Flash" ].AllowedExtensions = new string[] { "swf", "flv" };
TypeConfig[ "Flash" ].DeniedExtensions = new string[] { };
TypeConfig[ "Flash" ].FilesPath = "%UserFilesPath%flash/";
TypeConfig[ "Flash" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%flash/" );
TypeConfig[ "Flash" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "Flash" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );

TypeConfig[ "Media" ].AllowedExtensions = new string[] { "aiff", "asf", "avi", "bmp", "fla", "flv", "gif", "jpeg", "jpg", "mid", "mov", "mp3", "mp4", "mpc", "mpeg", "mpg", "png", "qt", "ram", "rm", "rmi", "rmvb", "swf", "tif", "tiff", "wav", "wma", "wmv" };
TypeConfig[ "Media" ].DeniedExtensions = new string[] { };
TypeConfig[ "Media" ].FilesPath = "%UserFilesPath%media/";
TypeConfig[ "Media" ].FilesAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%media/" );
TypeConfig[ "Media" ].QuickUploadPath = "%UserFilesPath%";
TypeConfig[ "Media" ].QuickUploadAbsolutePath = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
}

时间: 2024-08-31 00:31:22

FCKEditor v2.6 编辑器配置图解教程_网页编辑器的相关文章

针对PHP环境下Fckeditor编辑器上传图片配置详细教程_网页编辑器

开启Fckeditor上传图片功能 考虑到目录安全性问题,默认Fckeditor2.6.6上传功能并未开启,所以第一步我们必须开启Fckeditor上传功能,这里需要注意,由于PHP版本Fckeditor上传功能需要用到chomod函数对新建目录进行权限设置,所以请务必确认在启用Fckeditor上传功能时PHP环境的用户具有创建和更改上传目录的权限. 如果没有开启Fckeditor上传功能,在点击插入/编辑图像按钮,选择上传,在选择完要上传的文件后点击发送到服务器上按钮时会报错误信息如下 复制

FCKeditor 网页在线编辑器的使用方法_网页编辑器

它不需要安装任何形式的客户端,兼容绝大多数主流浏览器,支持ASP.Net.ASP.ColdFusion .PHP.Jsp.Active-FoxPro.Lasso.Perl.ython 等编程环境. 官方网站 http://www.fckeditor.net/ 官方文档 http://wiki.fckeditor.net/ 下载地址 http://www.fckeditor.net/download/default.html FCKeditor安装和配置 下载FCKeditor2.63.zip和F

kindSoft在线网页编辑器简单的配置参数介绍_网页编辑器

对于网页编辑器对做项目的时候是非常的又用的一个编辑器,大大的减轻了开发人员的负担,感觉KindSoft是一个不错的选择,因此也在不断的使用. 下面对一些简单的配置进行归纳一下: 首先是将下载的KindSoft文件导入到项目的目录下: 复制代码 代码如下: <script src="../Content/kindeditor-4.1.4/kindeditor-all.js" type="text/javascript"></script> &l

FCKeditor + SyntaxHighlighter 让代码高亮着色插件_网页编辑器

FCKeditor是现在最为流行的开源编辑器,SyntaxHighlighter是一个用JS实现的代码高亮显示插件,可以最小化修改您的程序实现效果,最终效果截图: 演示网页: 下载FCKeditor + SyntaxHighlighter插件包:fck_SyntaxHighlighter打包版 下面分步介绍如何在FCKeditor环境中使用SyntaxHighlighter. 后台FCKeditor编辑器的修改 1.将包解压后,把 insertcode 文件夹上传到 FCKeditor编辑器的e

FCKeditor 在chrome中不显示问题_网页编辑器

网上有人说如下修改就可以,不过也要看你用的是什么系统,程序员的水平就决定了兼容性问题,不过可以试试. this.EnableSafari = true ; // This is a temporary property, while Safari support is under development. 把false修改为true之后显示正常 应该是chrome使用的内核WebKit的问题,需要修改safari的支持 建议以后广大程序员开发的时候要注意浏览器的兼容性问题. fckeditor

免费开源百度编辑器(UEditor)使用方法_网页编辑器

UEditor效果图 一.简介 UEditor是一个开源免费的编辑器,由百度web前端研发部开发所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于BSD协议,允许自由使用和修改代码. 官方网站:http://ueditor.baidu.com/ 二.下载地址 官方下载:http://ueditor.baidu.com/website/download.html 官网上下载完整源码包,解压到任意目录,解压后的源码目录结构如下所示:    _examples:编辑器完整版的

FCKeditor 2.6.6在ASP中的安装及配置方法分享_网页编辑器

首先从FCKEditor官方下载最新的版本提供的下载地址 http://www.jb51.net/codes/21294.html 安装及配置方法:一.打开文件夹发现有许多文件对于ASP来说是用不到的:删除FCKEditor2.6.6中不必要的文件:解压缩FCKeditor_2.6.6.zip到你网站根目录 fckeditor文件夹中,同时把文件夹内带_的文件夹和文件一并删除:1.fckeditor目录下除editor目录.fckconfig.js.fckeditor.asp.fckeditor

ckeditor的使用和配置方法分享_网页编辑器

一.使用方法: 1.在页面<head>中引入ckeditor核心文件ckeditor.js <script type="text/javascript" src="ckeditor/ckeditor.js"></script> 2.在使用编辑器的地方插入HTML控件<textarea> <textarea id="TextArea1" cols="20" rows=&quo

dedecms5.5 最新版ckeditor编辑器整合教程_网页编辑器

CKEditor官方网站http://ckeditor.com/,可以到这个网站下载最新的3.0版本. 下载完成后,可以删掉_samples._source._tests这三个无用的文件夹: 打开lang文件夹,干掉除_languages.js.en.js.zh-cn.js以外的所有文件: 如果你不用office2003和v2两种皮肤,可以把skin目录下的这两个目录也都干掉. 清理完毕后的文件大小只有1M多了,可以在dede的include目录下新建一个文件夹ckeditor,把剩下的这些文件