手机
当前位置:查字典教程网 >编程开发 >网页编辑器 >FCKeditor2.3 For PHP 详细整理的使用参考
FCKeditor2.3 For PHP 详细整理的使用参考
摘要:参考一首先到:http://www.fckeditor.net去下载FCKeditor放到网站根目录。精简说明:删除所有"_"开头的文件和文...

参考一

首先到:http://www.fckeditor.net去下载FCKeditor

放到网站根目录。

精简说明:

删除所有"_"开头的文件和文件夹

删除语言包中除中文和英文以外的语言

删除skin目录下除默认皮肤以外的文件夹

filemanager/browser/default/connectors/目录下除php以外的文件

filemanager/upload/目录下除php以外的文件

表情文件夹及表情按钮

配置说明:

fckeditor.php :

BasePath为默认Fckeditor的目录,也可以在调用的时候指定.

fckconfig.js :

AutoDetectLanguage 建议关闭,在DefaultLanguage中手动指定默认语言:zh-cn.

ToolbarSets FCKeditor的功能按纽,可自行定制.

_FileBrowserLanguage,_QuickUploadLanguage 指定文件浏览及上传使用的语言,我指定php.

editorfilemanagerbrowserdefaultconnectorsphpconfig.php

editorfilemanageruploadphpconfig.php

$Config['Enabled'] 是否允许上传

$Config['UserFilesPath'] 默认上传路径,可以更改但必须在相应的目录下建这个名称的目录。

配置 FCKeditor的toolbar功能按钮可以很容易地进行定制,你可以依据你的需要在FCKeditor的配置文件FCKeditorfck_config.js中进行定制,增加类似config.ToolbarSets["name"] = [ ][ ]; (这里中括号里面的内容自定)使用时只需把$oFCKeditor->ToolbarSet = 'Default' 改为$oFCKeditor->ToolbarSet = 'name' 即可。

工具栏功能说明:

功能名称

含义

功能名称

含义

EditSource

显示HTML源代码

StrikeThrough

删除线

Save

保存

Subscript

下标

NewPage

新建空白页面

Superscript

上标

Preview

预览

JustifyLeft

左对齐

Cut

剪切

JustifyCenter

居中对齐

Copy

复制

JustifyRight

右对齐

Paste

粘贴

JustifyFull

两端对齐

PasteText

纯文本粘贴

InsertOrderedList

自动编号

PasteWord

来自Word的粘贴

InsertUnorderedList

项目符号

Print

打印

Outdent

减少缩进

SpellCheck

拼写检查

Indent

增加缩进

Find

查找

ShowTableBorders

显示表格线

Replace

替换

ShowDetails

显示明细

Undo

撤销

Form

添加Form动作

Redo

还原

Checkbox

复选框

SelectAll

全选

Radio

单选按钮

RemoveFormat

去除格式

Input

单行文本框

Link

插入/编辑 链接

Textarea

滚动文本框

RemoveLink

去除连接

Select

下拉菜单

Anchor

锚点

Button

按钮

Image

插入/编辑 图片

ImageButton

图片按钮

Table

插入/编辑 表格

Hidden

隐藏

Rule

插入水平线

Zoom

显示比例

SpecialChar

插入特殊字符

FontStyleAdv

系统字体

UniversalKey

软键盘

FontStyle

字体样式

Smiley

插入表情符号

FontFormat

字体格式

About

关于

Font

字体

Bold

粗体

FontSize

字体大小

Italic

斜体

TextColor

文字颜色

Underline

下划线

BGColor

背景色

使用方法:

test.php文件

<form action="./action.php" method="post" target="_blank">

<?php

include_once("FCKeditor/fckeditor.php");

$sBasePath = 'http://127.0.0.1/FCKeditor/';

$oFCKeditor = new FCKeditor('input');

$oFCKeditor->BasePath = $sBasePath ;

$oFCKeditor->Width = '100%';

$oFCKeditor->Height = '100px';

$ofCKeditor->ToolbarSet='Default';

$oFCKeditor->Value = 'Hello World!';

echo $oFCKeditor->CreateHtml();

?>

<input type="submit" value="确定">

</form>

action.php文件

<?php

if ( isset( $_POST ) )

$postArray = &$_POST ;

foreach ( $postArray as $sForm => $value )

{

$postedValue = htmlspecialchars( stripslashes( $value ) ) ;

echo $postedValue;

//另外的处理语句。

?>

}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

参考二

PHP中使用FCKeditor2.3.2配置

FCKeditor2.3.2在线编辑器非常好用,完全支持文件上传。今天baidu了一下午终于搞定了。 下载FCKeditor2.3.2,解压至FCKeditor。

1首先删除不必要的文件节省空间。凡是以_开头的文件如_samples,_testcases和一些用不到的.asp、.jsp、.cfm文件统统干掉。

2修改fckconfig.js

FCKConfig.AutoDetectLanguage = true ;//是否自动检测语言

FCKConfig.DefaultLanguage= 'zh-cn' ;//设置语言

FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;//设置皮肤

FCKConfig.TabSpaces = 1 ;//tab是否有效

FCKConfig.ToolbarStartExpanded = true ;//编辑工具条是否出现,等点“展开工具栏”时才出现

FCKConfig.FontNames= '宋体;黑体;隶书;楷体_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;//添加中文字体

修改FCKeditoreditorcssfck_editorarea.css

设置默认字体及大小

body, td

{

font-family: Arial, Verdana, Sans-Serif;

font-size: 14px;

}

3关于文件上传的设置

修改fckconfig.js

var _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php

var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | php

修改fckeditoreditorfilemanagerbrowserdefaultconnectorsphp

$Config['Enabled'] = true ;

$Config['UserFilesPath'] = '/UserFiles/' ;//设置上传的文件夹,可自己指定

修改fckeditoreditorfilemanageruploadphp

$Config['Enabled'] = true ;

$Config['UseFileType'] = true ;

$Config['UserFilesPath'] = '/UserFiles/' ;//同上要一样

4引入在线编辑器时只需

<?php

include("fckeditor/fckeditor.php") ;

$oFCKeditor = new FCKeditor('FCKeditor1') ;//实例化

$oFCKeditor->BasePath = 'fckeditor/';//这个路径一定要和上面那个引入路径一致,否则会报错:找不到fckeditor.html页面

//$oFCKeditor->Value = '' ;

$oFCKeditor->Width = '100%' ;

$oFCKeditor->Height = '300' ;

$oFCKeditor->Create() ;

?>

JS用alert( FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML( true ))得到FCKeditor1的值;

PHP用$_POST['FCKeditor1']得到FCKeditor1的值。

参考三

FCKeditor是sourceforge.net上面的一个开源项目,主要是实现在线网页编辑器的功能,官方网站为http://www.fckeditor.net ,在服务器端支持ASP.Net、ASP、ClodFusion、PHP、Java等语言,并且支持IE 5+、Mozilla 、Netscape等主流浏览器。目前最新版本为2.0 Beta 2,但是目前2.0 Beta版还不支持PHP,所以这里我选择使用了1.6版本。

首先我们先到http://sourceforge.net/projects/fckeditor/ 下载FCKeditor_1.6.zip,并将其解压缩到你的网站子目录里面,并将文件夹名改为FCKeditor。进入到FCKeditor/目录下,打开_test/目录,里面含有各种编程语言调用FCKeditor的方法,其中与PHP有关的文件有2个文件:

test.php //提交数据页面

testsubmit.php //显示数据页面

大家可以看一下,了解FCKeditord的调用方法,下面是我简写了一个test程序:

<?php

if($_POST["ADD"]){

$Content=$_POST['EditorDefault'];

echo $Content;

//变量$Content就是我们在FCKeditord里面编辑的内容,这里可以将其保存到数据库里面

}

?>

<html>

<head>

<?php

//引入在线编辑器

include("../FCKeditor/fckeditor.php") ;

?>

</head>

<body>

<br>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" language="javascript">

<?php

$oFCKeditor = new FCKeditor ;

// FCKeditor所在目录,[b:91beb51adf]这个路径一定要和上面那个引入路径一致,否则会报错:找不到fckeditor.html页面[/b:91beb51adf]

$oFCKeditor->BasePath = '../FCKeditor/' ;

// 将FCKeditor实例化

$oFCKeditor->CreateFCKeditor( 'EditorDefault', '100%', 300 ) ;

?>

<INPUT type="submit" name="ADD" value="提交">

</form>

</body>

</html>

从上面的例子中我们可以看到要使用FCKeditor,首先要执行

include("../FCKeditor/fckeditor.php") ;语句来引用FCKeditor。然后执行

$oFCKeditor = new FCKeditor ;

$oFCKeditor->BasePath = '../FCKeditor/' ;

$oFCKeditor->CreateFCKeditor( 'EditorDefault', '100%', 300 ) ;

来实例化FCKeditor,如果是编辑页面则再加入一行:

//$Content可以是从数据库中读取出来的数据

$oFCKeditor->Value = $Content ;

默认情况下,上传图片功能仅对应于ASP方式,要想实现在PHP下上传文件,还得对FCKeditor的配置文件进行修改。打开/ FCKeditor/js/fck_config.js(这是FCKeditor的主配置文件),定位到文件的最下面那段被//注释掉的内容,将

//##

//## Image Browsing

//##

config.ImageBrowser = true ;

// Custom Page URL

config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_html/browse.html" ;

//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_php/browse.php" ;

//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_jsp/browse.jsp?type=img" ;

//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_asp/browse.asp" ;

//##

//## Image Upload

//##

config.ImageUpload = true ;

// Page that effectivelly upload the image.

config.ImageUploadURL = config.BasePath + "filemanager/upload/asp/upload.asp" ;

//config.ImageUploadURL = config.BasePath + "filemanager/upload/aspx/upload.aspx" ;

//config.ImageUploadURL = config.BasePath + "filemanager/upload/cfm/upload.cfm" ;

//config.ImageUploadURL = config.BasePath + "filemanager/upload/php/upload.php" ;

//config.ImageUploadURL = config.BasePath + "filemanager/upload/jsp/upload.jsp" ;

改为

//##

//## Image Browsing

//##

config.ImageBrowser = true ;

// Custom Page URL config.

ImageBrowserURL = "filemanager/browse/sample_html/browse.html" ;

config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_php/browse.php" ;

//##

//## Image Upload

//##

config.ImageUpload = true ;

// Page that effectivelly upload the image.

config.ImageUploadURL = config.BasePath + "filemanager/upload/php/upload.php" ;

最后再修改2个文件:

/FCKeditor/filemanager/upload/php/upload.php

第22行

$UPLOAD_BASE_URL = '/userimages/';

/FCKeditor/filemanager/browse/sample_php/browse.php

第20行

$IMAGES_BASE_URL = '/FCKeditor/userimages/';

这两处定义了图片上传到哪个目录,可以自行定义,不过一定要确保该目录存在,不然上传图片时会报错。

然后我们把FCKeditor目录下的用不到的.asp、.jsp、. cfm文件和_test、_ aspnet、_developers、_docs、_jsp目录都删掉以节省空间。好啦,FCKeditor的基本使用方法就讲到这里,大家感兴趣的话可以到我的网站来看看效果:http://www.shaof.com 。

补充:

在FCKeditor官方的网站注明FCKeditor目前支持3种浏览器:IE5+,Mozilla and Netscape。但在实验中发现使用IE5.0是不支持图片上传功能,只有将IE升级到5.5或者6.0才能支持图片上传功能。而对于刚出的Mozilla Firefox 1.0 RC1以及Mozilla1.6(Linux环境),则完全无法使用FCKeditor。

以下是使用IE5.0和IE6.0时的截图。

FCKeditor截图

使用IE5.0时,看不到“上传”提示

SATAND 回复于:2004-10-31 17:28:06

粗读了js文件,可扩展性还好但是功能有限

放弃,作为纪念品收藏

参考四

在线编辑器FCKeditor在PHP中的使用方法

在线编辑器FCKeditor在PHP中的使用方法 (转帖)

原作者:tjyihui 出处: phpx.com

FCKeditor是sourceforge.net上面的一个开源项目,主要是实现在线网页编辑器的功能,官方网站为http://www.fckeditor.net ,在服务器端支持ASP.Net、ASP、ClodFusion、PHP、Java等语言,并且支持IE 5+、Mozilla 、Netscape等主流浏览器。目前最新版本为2.0 Beta 2,但是目前2.0 Beta版还不支持PHP,所以这里我选择使用了1.6版本。下面是FCKeditor的一个截图:

首先我们先到http://sourceforge.net/projects/fckeditor/ 下载FCKeditor_1.6.zip,并将其解压缩到你的网站子目录里面,并将文件夹名改为FCKeditor。进入到FCKeditor/目录下,打开_test/目录,里面含有各种编程语言调用FCKeditor的方法,其中与PHP有关的文件有2个文件:

test.php //提交数据页面

testsubmit.php //显示数据页面

大家可以看一下,了解FCKeditord的调用方法,下面是我简写了一个test程序:

<?php

if($_POST["ADD"]){

$Content=$_POST['EditorDefault'];

echo $Content;

//变量$Content就是我们在FCKeditord里面编辑的内容,这里可以将其保存到数据库里面

}

?>

<html>

<head>

<?php

//引入在线编辑器

include("../FCKeditor/fckeditor.php") ;

?>

</head>

<body>

<br>

<form action="<?phpecho $_SERVER['PHP_SELF'];?>"method="post" language="javascript">

<?php

$oFCKeditor = new FCKeditor ;

// FCKeditor所在目录

$oFCKeditor->BasePath = '../FCKeditor/' ;

// 将FCKeditor实例化

$oFCKeditor->CreateFCKeditor( 'EditorDefault', '100%', 300 ) ;

?>

<INPUT type="submit" name="ADD" value="提交">

</form>

</body>

</html>

从上面的例子中我们可以看到要使用FCKeditor,首先要执行

include("../FCKeditor/fckeditor.php") ;语句来引用FCKeditor。然后执行

$oFCKeditor = new FCKeditor ;

$oFCKeditor->BasePath = '../FCKeditor/' ;

$oFCKeditor->CreateFCKeditor( 'EditorDefault', '100%', 300 ) ;

来实例化FCKeditor,如果是编辑页面则再加入一行:

//$Content可以是从数据库中读取出来的数据

$oFCKeditor->Value = $Content ;

默认情况下,上传图片功能仅对应于ASP方式,要想实现在PHP下上传文件,还得对FCKeditor的配置文件进行修改。打开/ FCKeditor/js/fck_config.js(这是FCKeditor的主配置文件),定位到文件的最下面那段被//注释掉的内容,将

//##

//## Image Browsing

//##

config.ImageBrowser = true ;

// Custom Page URL

config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_html/browse.html" ;

//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_php/browse.php" ;

//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_jsp/browse.jsp?type=img" ;

//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_asp/browse.asp" ;

//##

//## Image Upload

//##

config.ImageUpload = true ;

// Page that effectivelly upload the image.

config.ImageUploadURL = config.BasePath + "filemanager/upload/asp/upload.asp" ;

//config.ImageUploadURL = config.BasePath + "filemanager/upload/aspx/upload.aspx" ;

//config.ImageUploadURL = config.BasePath + "filemanager/upload/cfm/upload.cfm" ;

//config.ImageUploadURL = config.BasePath + "filemanager/upload/php/upload.php" ;

//config.ImageUploadURL = config.BasePath + "filemanager/upload/jsp/upload.jsp" ;

改为

//##

//## Image Browsing

//##

config.ImageBrowser = true ;

// Custom Page URL config.

ImageBrowserURL = "filemanager/browse/sample_html/browse.html" ;

config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_php/browse.php" ;

//##

//## Image Upload

//##

config.ImageUpload = true ;

// Page that effectivelly upload the image.

config.ImageUploadURL = config.BasePath + "filemanager/upload/php/upload.php" ;

最后再修改2个文件:

/FCKeditor/filemanager/upload/php/upload.php

第22行

$UPLOAD_BASE_URL = '/userimages/';

/FCKeditor/filemanager/browse/sample_php/browse.php

第20行

$IMAGES_BASE_URL = '/FCKeditor/userimages/';

这两处定义了图片上传到哪个目录,可以自行定义,不过一定要确保该目录存在,不然上传图片时会报错。

然后我们把FCKeditor目录下的用不到的.asp、.jsp、. cfm文件和_test、_ aspnet、_developers、_docs、_jsp目录都删掉以节省空间。好啦,FCKeditor的基本使用方法就讲到这里,大家感兴趣的话可以到我的网站来看看效果:http://www.shaof.com 。

参考五

FCKeditor是目前互联网上最好的在线编辑器,功能强大,支持IE 5.5+ (Windows), Firefox 1.0+, Mozilla 1.3+ and Netscape 7.1+.浏览器,无平台限制,能够在Windows, Mac and Linux上正常运行,可以和多种WEB语言融合,如ASP.Net 、ASP、ColdFusion、PHP、Java、 Active-FoxPro、Lasso、Perl、Python,还有多语言支持,提供50多种语言包,是一种开源软件。最新的版本是2.4.3,下载地址:http://www.fckeditor.net/download

FCKeditor作为一种支持多平台,多语言的编辑器,下载之后就可以直接在程序或者网页中使用。有时由于系统并不需要如此之多的功能,所以还是需要进行一些简单的修改,配置更加适合自己的网站的个性编辑器。

一、优化FCKeditor文件夹和文件:

下载FCKeditor并解压之后,会产生_samples和editor两个文件夹和几个文件,全部删除以_开头的文件夹和文件,因为这些都是FCKeditor的一些例子而已,可以学习一下,但上传到网站服务器上就大可不必了,删除。在根目录下,还有几个fckeditor.asp,fckeditor.php,fckeditor.js......等其它文件,这个就看你的网站服务器和网站需要什么程序语言,有PHP,ASP,PERL,.NET等,我选择的是脚本配置文件fckeditor.js,还有三个文件fckconfig.js、fckstyles.xml、fcktemplates.xml是必需的文件,其它的可以全部删除。

打开editor文件夹,进入lang文件夹,这里面是FCKeditor的语言包来的,一般国内选择en.js和zh.js和zh-cn.js文件就可以了,加上必需的文件fcklanguagemanager.js(此文件是2.4版本以下必需的),其它的文件可以完全删除。

之后打开editor/filemanager文件夹,如果不要求在上传图片或者文件的时候显示服务器上的内容,可以选择删除filemanager文件夹下的brower文件夹。然后进入upload文件夹,里面是各种程序语言的上传文件,选择你需要的那个程序语言文件夹,其它的删除。

进入editor/Plugins文件夹,如果你不需要这些额外的FCKeditor插件的话,把里面的文件夹全部删除。

进入editor/skins文件夹,里面是编辑器的皮肤文件,default文件是默认的灰色面板的编辑器,Office2003和silver是另外加载的,看哪个好看就选择哪个,然后其它的删除。

另外,editor/dialog文件夹里是一些编辑器的对话框,如果选择基本的一些功能的话,可以相应的选择其文件,把其它的删除也是可以的。

到这里,编辑器的文件夹优化基本OK了,精简了许多,更加方便了服务器的上传和使用。

二、FCKeditor的基本配置修改:

fckconfig.js是FCKeditor编辑器的配置文件,不涉及到工具按钮的增加的话修改这里面的配置完全可以了。

下面列举的是fckconfig.js里的配置选项:

AutoDetectLanguage=true/false 自动检测语言

BaseHref="" _fcksavedurl="""" 相对链接的基地址

ContentLangDirection="ltr/rtl" 默认文字方向

ContextMenu=字符串数组,右键菜单的内容

CustomConfigurationsPath="" 自定义配置文件路径和名称

Debug=true/false 是否开启调试功能,这样,当调用FCKDebug.Output()时,会在调试窗中输出内容

DefaultLanguage="" 缺省语言

EditorAreaCss="" 编辑区的样式表文件

EnableSourceXHTML=true/false 为TRUE时,当由可视化界面切换到代码页时,把HTML处理成XHTML

EnableXHTML=true/false 是否允许使用XHTML取代HTML

FillEmptyBlocks=true/false 使用这个功能,可以将空的块级元素用空格来替代

FontColors="" 设置显示颜色拾取器时文字颜色列表

FontFormats="" 设置显示在文字格式列表中的命名

FontNames="" 字体列表中的字体名

FontSizes="" 字体大小中的字号列表

ForcePasteAsPlainText=true/false 强制粘贴为纯文本

ForceSimpleAmpersand=true/false 是否不把&符号转换为XML实体

FormatIndentator="" 当在源码格式下缩进代码使用的字符

FormatOutput=true/false 当输出内容时是否自动格式化代码

FormatSource=true/false 在切换到代码视图时是否自动格式化代码

FullPage=true/false 是否允许编辑整个HTML文件,还是仅允许编辑BODY间的内容

GeckoUseSPAN=true/false 是否允许SPAN标记代替B,I,U标记

IeSpellDownloadUrl=""下载拼写检查器的网址

ImageBrowser=true/false 是否允许浏览服务器功能

ImageBrowserURL="" 浏览服务器时运行的URL

ImageBrowserWindowHeight="" 图像浏览器窗口高度

ImageBrowserWindowWidth="" 图像浏览器窗口宽度

LinkBrowser=true/false 是否允许在插入链接时浏览服务器

LinkBrowserURL="" 插入链接时浏览服务器的URL

LinkBrowserWindowHeight=""链接目标浏览器窗口高度

LinkBrowserWindowWidth=""链接目标浏览器窗口宽度

Plugins=object 注册插件

PluginsPath="" 插件文件夹

ShowBorders=true/false 合并边框

SkinPath="" 皮肤文件夹位置

SmileyColumns=12 图符窗列数

SmileyImages=字符数组 图符窗中图片文件名数组

SmileyPath="" 图符文件夹路径

SmileyWindowHeight 图符窗口高度

SmileyWindowWidth 图符窗口宽度

SpellChecker="ieSpell/Spellerpages" 设置拼写检查器

StartupFocus=true/false 开启时FOCUS到编辑器

StylesXmlPath="" 设置定义CSS样式列表的XML文件的位置

TabSpaces=4 TAB键产生的空格字符数

ToolBarCanCollapse=true/false 是否允许展开/折叠工具栏

ToolbarSets=object 允许使用TOOLBAR集合

ToolbarStartExpanded=true/false 开启是TOOLBAR是否展开

UseBROnCarriageReturn=true/false 当回车时是产生BR标记还是P或者DIV标记

下面详细的说明一下一些常用的配置选项:

FCKConfig.DefaultLanguage = 'en' ; //选择编辑器的语言,editor/lang/文件夹下面的有相应的语言脚本文件。

FCKConfig.ToolbarStartExpanded = true ;//载入编辑器的时候展开还是收缩工具按钮。

FCKConfig.ToolbarSets["Default"] 和 FCKConfig.ToolbarSets["Basic"]是载入的时候显示全部工具按钮还是部分基本按钮。可以在fckeditor.js或者fckeditor.asp/php等文件中设置。

FCKConfig.ContextMenu这个是编辑器的右键配置文件,可以自己增减对应按钮。

FCKConfig.LinkBrowser = false ;//浏览服务器上的文件,如果选择false不允许的话,接下去的几行可以相应的注释掉。后面的FCKConfig.ImageBrowser = false ;FCKConfig.FlashBrowser = false ;也是如此。如果选择允许的话,将相应的程序语言部分的注释去掉。

FCKConfig.LinkUpload = true ;FCKConfig.ImageUpload = true ;FCKConfig.FlashUpload = true ;这三个配置选项是设置文件上传的,如果不允许用户上传文件,则把true修改为false即可。如果允许,请在相应的程序语言里选择,即把对应的注释行去掉即可。

修改完毕之后再打开相应的程序语言的FCKeditor文件继续。

三、修改编辑器载入时的配置:

打开fckeditor.js或者fckeditor.asp/php/pl等文件,这些文件的配置情况都是差不多的。这里拿fckeditor.js说明。

Width:编辑器宽度。

Height:编辑器高度。

ToolbarSet:编辑器工具按钮:default或者basic。

BasePath:编辑器所在目录,建议使用根目录形式。

其它的就可以设置默认的就可以了。

四、使用FCKeditor编辑器:

1、ASP程序语言载入编辑器:

包含文件fckeditor.asp文件,然后在相应的地方加入下面的代码:

<%

Dim oFCKeditor

Set oFCKeditor = New FCKeditor

oFCKeditor.BasePath = "/"

oFCKeditor.ToolbarSet = "Default"

oFCKeditor.Width = "100%"

oFCKeditor.Height = "400"

oFCKeditor.Value = rs("Content")

oFCKeditor.Create "Content"

%>

2、JS程序语言载入编辑器:

引用脚本fckeditor.js文件,在相应的地方加入下面的代码:

<script type="text/javascript">

var oFCKeditor = new FCKeditor( 'Content' ) ;

oFCKeditor.BasePath = '/' ;

oFCKeditor.ToolbarSet = 'Basic' ;

oFCKeditor.Width = '100%' ;

oFCKeditor.Height = '400' ;

oFCKeditor.Value = '' ;

oFCKeditor.Create() ;

</script>

JS语言版本的还有一种替换文本框加快页面显示的文件,在这里我选择的是点击编辑框才出现编辑器,引用fckeditor.js文件,加入如下代码:

<script type="text/javascript">

<>

</script><div id="preContent"><textarea id="Content"></textarea></div>

3、PHP程序语言载入编辑器:

包含fckeditor.php文件,在相应的地方加入下面的代码:

<?php

$oFCKeditor = new FCKeditor('Content') ;

$oFCKeditor->BasePath= "../FCKeditor/" ;

$oFCKeditor->Value= '' ;

$oFCKeditor->Create() ;

?>

【FCKeditor2.3 For PHP 详细整理的使用参考】相关文章:

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

ThinkPHP中FCKeditor编辑器的使用方法

FckEditor 中文配置手册详细说明

比较不错的修改FCKEditor的修改方法

php下FCKeditor2.6.5网页编辑器的使用方法

CKEditor 附插入代码的插件

nicedit 轻量级编辑器 使用心得

FCKEditor SyntaxHighlighter整合实现代码高亮显示

添加FCKeditor插件需要注意的地方

autogrow 让FCKeditor高度随内容增加的插件

精品推荐
分类导航