Home php教程 php手册 PHP中使用FCKeditor2.3.2配置

PHP中使用FCKeditor2.3.2配置

Jun 21, 2016 am 08:54 AM
config php

  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' ;//添加中文字体

修改FCKeditor\editor\CSS\fck_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

修改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/' ;//同上要一样

4引入在线编辑器时只需

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的值。



Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

CakePHP Date and Time

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

CakePHP Project Configuration

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

CakePHP File upload

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

CakePHP Routing

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

Discuss CakePHP

CakePHP Quick Guide CakePHP Quick Guide Sep 10, 2024 pm 05:27 PM

CakePHP Quick Guide

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

How To Set Up Visual Studio Code (VS Code) for PHP Development

See all articles