holy shit

寺夺喜从天降

编辑器FCKeditor2.6.3使用实例

一:下载
http://www.fckeditor.net/demo

二:压缩
1、保留根目录fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml、fckeditor_php4.php、fckeditor_php5.php及fckeditor.php其他的文件都删掉;
2、删除目录/editor/_source(事实上,所有_开头的文件夹或文件都是可以删除的);
3、删除/editor/filemanager/browser/default/connectors/下除PHP目录的所有目录
4、删除/editor/lang/下的除了 en.js, zh.js, zh-cn.js三个文件的所有文件

三:配置
1、启用中文语言包:打开Ffckconfig.js,修改第62行 FCKConfig.DefaultLanguage = ‘en’ ;将en改为zh-cn,
注:在FCKeditor2.6.3中,默认的支持的语言即为PHP,所以不用修改第276,277行。如果需要支持其他语言,请修改这里。
2、启用PHP文件上传功能:打开fckeditor/editor/filemanager/connectors/php/config.php第30行找到:$Config['Enabled'] = false 改成: $Config['Enabled'] = true 设置上传存放目录:第34行找到:$Config['UserFilesPath'] = ‘/userfiles/’ 改成: $Config['UserFilesPath'] = ‘改你自己的路径’

四,代码
<form action="test.php" method="POST">
<?php
include 'jinlin_smarty/fckeditor/fckeditor.php';                
$obj_editor=new FCKeditor('editor');
$obj_editor->Config['SkinPath']='/jinlin_smarty/fckeditor/editor/skins/silver/';
$obj_editor->BasePath='/jinlin_smarty/fckeditor/';
$obj_editor->Value=$about['content'];
$obj_editor->ToolbarSet='Basic';
$obj_editor->Width='700px';
$obj_editor->Height='500px';
$obj_editor->create();
?>
<input type="submit" value="ok">
</form>
//使用$_POST['editor']获取值

五:设置工具组
FCKConfig.ToolbarSets["Basic"] = [
 ['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
 ['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
 ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat','FitWindow','ShowBlocks'],
 '/',
 ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
 ['OrderedList','UnorderedList','-','Outdent','Indent'],
 ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
 ['Link','Unlink','Anchor'],
 ['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
 '/',
 ['Style','FontFormat','FontName','FontSize'],
 ['TextColor','BGColor'],
] ;

六,工具参考
EditSource 显示HTML源代码
StrikeThrough 删除线
Save 保存
NewPage 新建空白页面
Superscrīpt 上标
Subscrīpt 下标
Preview 预览
JustifyLeft 左对齐
Cut 剪切
Copy 复制
Paste 粘贴
JustifyCenter 居中对齐
JustifyRight 右对齐
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 背景色

posted @ 2011-03-23 15:10  潜水鱼  阅读(736)  评论(0编辑  收藏  举报

holy shit on foot