PHP中使用FCKeditor2.3.2配置
FCKeditor2.3.2在線編輯器非常好用,完全支持文件上傳。今天baidu了一下午終于搞定了。 下載FCKeditor2.3.2,解壓至FCKeditor。
1首先刪除不必要的文件節省空間。凡是以_開頭的文件如_samples,_testcases和一些用不到的.asp、.jsp、.cfm文件統統干掉。
2修改fckconfig.jsFCKConfig.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' ;//添加中文字體修改FCKeditoreditorcssfck_editorarea.css設置默認字體及大小body, td{font-family: Arial, Verdana, Sans-Serif;font-size: 14px;}
3關于文件上傳的設置修改fckconfig.jsvar _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | php
修改fckeditoreditorfilemanagerbrowserdefaultconnectorsphp$Config['Enabled'] = true ;$Config['UserFilesPath'] = '/UserFiles/' ;//設置上傳的文件夾,可自己指定修改fckeditoreditorfilemanageruploadphp$Config['Enabled'] = true ;$Config['UseFileType'] = true ;$Config['UserFilesPath'] = '/UserFiles/' ;//同上要一樣4引入在線編輯器時只需<?phpinclude('fckeditor/fckeditor.php') ;$oFCKeditor = new FCKeditor('FCKeditor1') ;//實例化$oFCKeditor->BasePath = 'fckeditor/';//這個路徑一定要和上面那個引入路徑一致,否則會報錯:找不到fckeditor.html頁面//$oFCKeditor->Value = '' ;$oFCKeditor-> ; $oFCKeditor-> ; $oFCKeditor->Create() ;?>JS用alert( FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML( true ))得到FCKeditor1的值;PHP用$_POST['FCKeditor1']得到FCKeditor1的值。
