搜尋
首頁php教程php手册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' ;//添加中文字体

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



陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱工具

mPDF

mPDF

mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),

SublimeText3 英文版

SublimeText3 英文版

推薦:為Win版本,支援程式碼提示!

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

Dreamweaver Mac版

Dreamweaver Mac版

視覺化網頁開發工具

VSCode Windows 64位元 下載

VSCode Windows 64位元 下載

微軟推出的免費、功能強大的一款IDE編輯器