FCKeditor 应用
来源:互联网 发布:h5制作软件易企秀 编辑:程序博客网 时间:2024/05/01 18:53
FCKeditor使用方法小结(php)
标签:学习笔记 php fckeditor使用
最近用php+mysql开发一个项目,里面用到了FCKeditor,下面对这个用法进行一下小结.首先说明一下我的FCKeditor版本是2.1多国语言版.
用法:1.我的网站目录是www.里面有如下文件夹和文件
/www
add.php
/include
/FCKeditor
2.调用FCKeditor的方法:
(1)在开头包含include("FCKeditor/fckeditor.php")
(2)在需要使用的的方加入
<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;//建立对象
$oFCKeditor->BasePath = 'FCKeditor/' ;//FCKeditor所在的位置
$oFCKeditor->ToolbarSet = 'Default' ;//工具按钮
$oFCKeditor->Create('EditorDefault', '60%',150) ;
?>
(此处basepath的路径一定要和上面include的路径一样.否则会找不到文件)
另外,对于这个输入内容的变量,如果要把它存入数据库,它的变量名为你建
立对象的名字.例如上面就是FCKeditor1
3.在FCKeditor/_samples/里面有个php调用的例子.如simples01.php
和sampleposteddata.php这两个.后面那个文件是输出变量名的php
程序,通过这个程序可以得到文本输入框内容的变量名.
4.配置 FCKeditor的toolbar功能按钮可以很容易地进行定制,你可以依据你
的需要在FCKeditor的配置文件FCKeditor/fck_config.js中进行定制
,一个功能按钮对应一个唯一的名称。
在fck_config.js中默认情况下已经设定好三种toolbar样式:Default(包
含全部功能),Accessibility和Basic。
让我们先来看看toolbar样式的定制格式:
config.ToolbarSets["ToolBarSetName"] = [ // Toolbar名
['Item 1','Item 2','-','Item 3','Item n'], // Toolbar第一行
['Item 4','-','Item 5','Item 6','Item n'] // Toolbar第二行
] ;
这里'-'的作用是创建一个分割条。
FCKeditor1.6为我们提供了60个编辑功能,具体功能如下:
默认的Default包含了FCKeditor的全部功能,个人感觉有些功能用不上,完全加载还会影响显示速度,所以我简化了一下,只加载了一些常用的功能:
1、打开FCKeditor/fck_config.js文件,添加如下代码
config.ToolbarSets["www"] = [
['EditSource','Save','NewPage','Preview','-','Cut','Copy','Paste','PasteText','-','Find','Replace','-','Undo','Redo','-','SelectAll','-','Link','RemoveLink','-','Image','Table','Rule','SpecialChar','Smiley'] ,
['Bold','Italic','Underline','-','JustifyLeft','JustifyCenter','JustifyRight','-','InsertOrderedList','InsertUnorderedList','-','Form','Checkbox','Radio','Input','Textarea','Select','Button','-','FontStyleAdv','TextColor'] ] ;
这样加载的速度就快多了。
使用时只需把$oFCKeditor->ToolbarSet = 'Default'
改为$oFCKeditor->ToolbarSet = 'www' 即可
ASP 的配置方法
在站点根目录下,新建一个index.asp页面,<body>段内加如下代码(调用编辑器):
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/FCKeditor/" //设置编辑器的路径,我站点根目录下的一个目录
oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "600"
oFCKeditor.Value = "" //这个是给编辑器初始值
oFCKeditor.Create "logbody" //以后编辑器里的内容都是由这个logbody取得,命名由你定
%>
加了这一段别忘了在index.asp前面第二行加上
<!--#include file="FCKeditor/fckeditor.asp" -->
把fckeditor.asp包含进来。切记切记!
就这么简单!
现在你只要把这个编辑器当成一个控件来使用,提取它的数据时用:request("logbody")
现在松口气吧。测试成功了。里面有些设置,去网上找些高级的使用说明来看吧。
《柠檬园主》的高级说明。我又从这里获得了帮助。
http://3rgb.com/b/?act=viewthread&threadid=324
- FCKeditor 应用
- FCKeditor应用
- FCKeditor的php应用
- FCKeditor编辑器的应用
- FCKeditor应用笔记
- FCKeditor的php应用
- JSF2.0应用FCKEditor
- 在线编辑器fckeditor应用
- 在线编辑器 FCKeditor 的应用
- 四大 FCKeditor 实战应用技巧
- 四大FCKeditor 实战应用技巧
- FCKeditor 的修改及应用
- FCKeditor的php应用 [转]
- FCKEditor的配置及应用
- FCKeditor分页符的应用
- PHP在线编辑器fckeditor应用
- FCKEditor
- FCKeditor
- 我的AjaxPage对象(Asp.NET 1.1)-借用2.0的Callback实现无刷新回调
- 用户点击Log In按钮后发生了什么?
- 用户点击Log In按钮后发生了什么?(续篇1)
- Sql Server数据库的备份和恢复措施
- Query参数parameter的操作
- FCKeditor 应用
- Asp.net给站点某目录增加Aspnet用户
- web server 错误:Server Application Unavailable
- 今天解决了两个关于.NET读取EXCEL文件的问题,记下来,很有用!
- asp.net1.1下权限配置系统从设计到实现(四)
- 征集佳句-精妙SQL语句收集
- 自定义用户访问权限
- 实现提交页面后滚动条自动移动问题
- 酷终端