免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1344 | 回复: 0
打印 上一主题 下一主题

PHP中使用FCKeditor 配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-09-26 17:16 |只看该作者 |倒序浏览

下载FCKeditor2.x版後,解压至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' ;//添加中文字体
3.修改FCKeditor\editor\css\fck_editorarea.css
设置默认字体及大小
body, td
{
font-family: Arial, Verdana, Sans-Serif;
font-size: 14px;
}
4.关于文件上传的设置
修改fckconfig.js
var _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php
var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | php
修改fckeditor\editor\filemanager\browser\default\connectors\php
$Config['Enabled'] = true ;
$Config['UserFilesPath'] = '/UserFiles/' ;//设置上传的文件夹,可自己指定
修改fckeditor\editor\filemanager\upload\php
$Config['Enabled'] = true ;
$Config['UseFileType'] = true ;
$Config['UserFilesPath'] = '/UserFiles/' ;//同上要一样
5.引入在线编辑器时只需
Html代码

  • SPAN class=hilite2>phpSPAN>   
  • include("SPAN class=hilite1>fckeditorSPAN>/SPAN class=hilite1>fckeditorSPAN>.SPAN class=hilite2>phpSPAN>") ;   
  • $oSPAN class=hilite1>FCKeditorSPAN> = new SPAN class=hilite1>FCKeditorSPAN>('SPAN class=hilite1>FCKeditorSPAN>1') ;//实例化   
  • $oSPAN class=hilite1>FCKeditorSPAN>->BasePath = 'fckeditor/';//这个路径一定要和上面那个引入路径一致,否则会报错:找不到SPAN class=hilite1>fckeditorSPAN>.html页面   
  • //$oSPAN class=hilite1>FCKeditorSPAN>->Value = '' ;   
  • $oSPAN class=hilite1>FCKeditorSPAN>->Width = '100%' ;     
  • $oSPAN class=hilite1>FCKeditorSPAN>->Height = '300' ;     
  • $oSPAN class=hilite1>FCKeditorSPAN>->Create() ;   
  • ?>  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的值。

    本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/80828/showart_1226540.html
  • 您需要登录后才可以回帖 登录 | 注册

    本版积分规则 发表回复

      

    北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年举报专区
    中国互联网协会会员  联系我们:huangweiwei@itpub.net
    感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP