參考一
首先到:http://www.fckeditor.net去下載FCKeditor
放到網(wǎng)站根目錄。
精簡(jiǎn)說明:
刪除所有"_"開頭的文件和文件夾
刪除語言包中除中文和英文以外的語言
刪除skin目錄下除默認(rèn)皮膚以外的文件夾
filemanager/browser/default/connectors/目錄下除php以外的文件
filemanager/upload/目錄下除php以外的文件
表情文件夾及表情按鈕
配置說明:
fckeditor.php :
BasePath為默認(rèn)Fckeditor的目錄,也可以在調(diào)用的時(shí)候指定.
fckconfig.js :
AutoDetectLanguage 建議關(guān)閉,在DefaultLanguage中手動(dòng)指定默認(rèn)語言:zh-cn.
ToolbarSets FCKeditor的功能按紐,可自行定制.
_FileBrowserLanguage,_QuickUploadLanguage 指定文件瀏覽及上傳使用的語言,我指定php.
editor/filemanager/browser/default/connectors/php/config.php
editor/filemanager/upload/php/config.php
$Config['Enabled'] 是否允許上傳
$Config['UserFilesPath'] 默認(rèn)上傳路徑,可以更改但必須在相應(yīng)的目錄下建這個(gè)名稱的目錄。
配置 FCKeditor的toolbar功能按鈕可以很容易地進(jìn)行定制,你可以依據(jù)你的需要在FCKeditor的配置文件FCKeditor/fck_config.js中進(jìn)行定制,增加類似config.ToolbarSets["name"] = [ ][ ]; (這里中括號(hào)里面的內(nèi)容自定)使用時(shí)只需把$oFCKeditor->ToolbarSet = 'Default' 改為$oFCKeditor->ToolbarSet = 'name' 即可。
工具欄功能說明:
功能名稱 | 含義 | 功能名稱 | 含義 |
EditSource | 顯示HTML源代碼 | StrikeThrough | 刪除線 |
Save | 保存 | Subscript | 下標(biāo) |
NewPage | 新建空白頁面 | Superscript | 上標(biāo) |
Preview | 預(yù)覽 | JustifyLeft | 左對(duì)齊 |
Cut | 剪切 | JustifyCenter | 居中對(duì)齊 |
Copy | 復(fù)制 | JustifyRight | 右對(duì)齊 |
Paste | 粘貼 | JustifyFull | 兩端對(duì)齊 |
PasteText | 純文本粘貼 | InsertOrderedList | 自動(dòng)編號(hào) |
PasteWord | 來自Word的粘貼 | InsertUnorderedList | 項(xiàng)目符號(hào) |
Print | 打印 | Outdent | 減少縮進(jìn) |
SpellCheck | 拼寫檢查 | Indent | 增加縮進(jìn) |
Find | 查找 | ShowTableBorders | 顯示表格線 |
Replace | 替換 | ShowDetails | 顯示明細(xì) |
Undo | 撤銷 | Form | 添加Form動(dòng)作 |
Redo | 還原 | Checkbox | 復(fù)選框 |
SelectAll | 全選 | Radio | 單選按鈕 |
RemoveFormat | 去除格式 | Input | 單行文本框 |
Link | 插入/編輯 鏈接 | Textarea | 滾動(dòng)文本框 |
RemoveLink | 去除連接 | Select | 下拉菜單 |
Anchor | 錨點(diǎn) | Button | 按鈕 |
Image | 插入/編輯 圖片 | ImageButton | 圖片按鈕 |
Table | 插入/編輯 表格 | Hidden | 隱藏 |
Rule | 插入水平線 | Zoom | 顯示比例 |
SpecialChar | 插入特殊字符 | FontStyleAdv | 系統(tǒng)字體 |
UniversalKey | 軟鍵盤 | FontStyle | 字體樣式 |
Smiley | 插入表情符號(hào) | FontFormat | 字體格式 |
About | 關(guān)于 | Font | 字體 |
Bold | 粗體 | FontSize | 字體大小 |
Italic | 斜體 | TextColor | 文字顏色 |
Underline | 下劃線 | BGColor | 背景色 |
使用方法:
test.php文件
<form action="./action.php" method="post" target="_blank">
<?php
include_once("FCKeditor/fckeditor.php");
$sBasePath = 'http://127.0.0.1/FCKeditor/';
$oFCKeditor = new FCKeditor('input');
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Width = '100%';
$oFCKeditor->Height = '100px';
$ofCKeditor->ToolbarSet='Default';
$oFCKeditor->Value = 'Hello World!';
echo $oFCKeditor->CreateHtml();
?>
<input type="submit" value="確定">
</form>
action.php文件
<?php
if ( isset( $_POST ) )
$postArray = &$_POST ;
foreach ( $postArray as $sForm => $value )
{
$postedValue = htmlspecialchars( stripslashes( $value ) ) ;
echo $postedValue;
//另外的處理語句。
?>
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
參考二
PHP中使用FCKeditor2.3.2配置
FCKeditor2.3.2在線編輯器非常好用,完全支持文件上傳。今天baidu了一下午終于搞定了。 下載FCKeditor2.3.2,解壓至FCKeditor。
1首先刪除不必要的文件節(jié)省空間。凡是以_開頭的文件如_samples,_testcases和一些用不到的.asp、.jsp、.cfm文件統(tǒng)統(tǒng)干掉。
2修改fckconfig.js
FCKConfig.AutoDetectLanguage = true ;//是否自動(dòng)檢測(cè)語言
FCKConfig.DefaultLanguage = 'zh-cn' ;//設(shè)置語言
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;//設(shè)置皮膚
FCKConfig.TabSpaces = 1 ;//tab是否有效
FCKConfig.ToolbarStartExpanded = true ;//編輯工具條是否出現(xiàn),等點(diǎn)“展開工具欄”時(shí)才出現(xiàn)
FCKConfig.FontNames = '宋體;黑體;隸書;楷體_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;//添加中文字體
修改FCKeditor/editor/css/fck_editorarea.css
設(shè)置默認(rèn)字體及大小
body, td
{
font-family: Arial, Verdana, Sans-Serif;
font-size: 14px;
}
3關(guān)于文件上傳的設(shè)置
修改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/' ;//設(shè)置上傳的文件夾,可自己指定
修改fckeditor/editor/filemanager/upload/php
$Config['Enabled'] = true ;
$Config['UseFileType'] = true ;
$Config['UserFilesPath'] = '/UserFiles/' ;//同上要一樣
4引入在線編輯器時(shí)只需
<?php
include("fckeditor/fckeditor.php") ;
$oFCKeditor = new FCKeditor('FCKeditor1') ;//實(shí)例化
$oFCKeditor->BasePath = 'fckeditor/';//這個(gè)路徑一定要和上面那個(gè)引入路徑一致,否則會(huì)報(bào)錯(cuò):找不到fckeditor.html頁面
//$oFCKeditor->Value = '' ;
$oFCKeditor->Width = '100%' ;
$oFCKeditor->Height = '300' ;
$oFCKeditor->Create() ;
?>
JS用alert( FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML( true ))得到FCKeditor1的值;
PHP用$_POST['FCKeditor1']得到FCKeditor1的值。
參考三
FCKeditor是sourceforge.net上面的一個(gè)開源項(xiàng)目,主要是實(shí)現(xiàn)在線網(wǎng)頁編輯器的功能,官方網(wǎng)站為http://www.fckeditor.net ,在服務(wù)器端支持ASP.Net、ASP、ClodFusion、PHP、Java等語言,并且支持IE 5+、Mozilla 、Netscape等主流瀏覽器。目前最新版本為2.0 Beta 2,但是目前2.0 Beta版還不支持PHP,所以這里我選擇使用了1.6版本。
首先我們先到http://sourceforge.net/projects/fckeditor/ 下載FCKeditor_1.6.zip,并將其解壓縮到你的網(wǎng)站子目錄里面,并將文件夾名改為FCKeditor。進(jìn)入到FCKeditor/目錄下,打開_test/目錄,里面含有各種編程語言調(diào)用FCKeditor的方法,其中與PHP有關(guān)的文件有2個(gè)文件:
test.php //提交數(shù)據(jù)頁面
testsubmit.php //顯示數(shù)據(jù)頁面
大家可以看一下,了解FCKeditord的調(diào)用方法,下面是我簡(jiǎn)寫了一個(gè)test程序:
<?php
if($_POST["ADD"]){
$Content=$_POST['EditorDefault'];
echo $Content;
//變量$Content就是我們?cè)贔CKeditord里面編輯的內(nèi)容,這里可以將其保存到數(shù)據(jù)庫里面
}
?>
<html>
<head>
<?php
//引入在線編輯器
include("../FCKeditor/fckeditor.php") ;
?>
</head>
<body>
<br>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" language="javascript">
<?php
$oFCKeditor = new FCKeditor ;
// FCKeditor所在目錄,[b:91beb51adf]這個(gè)路徑一定要和上面那個(gè)引入路徑一致,否則會(huì)報(bào)錯(cuò):找不到fckeditor.html頁面[/b:91beb51adf]
$oFCKeditor->BasePath = '../FCKeditor/' ;
// 將FCKeditor實(shí)例化
$oFCKeditor->CreateFCKeditor( 'EditorDefault', '100%', 300 ) ;
?>
<INPUT type="submit" name="ADD" value="提交">
</form>
</body>
</html>
從上面的例子中我們可以看到要使用FCKeditor,首先要執(zhí)行
include("../FCKeditor/fckeditor.php") ;語句來引用FCKeditor。然后執(zhí)行
$oFCKeditor = new FCKeditor ;
$oFCKeditor->BasePath = '../FCKeditor/' ;
$oFCKeditor->CreateFCKeditor( 'EditorDefault', '100%', 300 ) ;
來實(shí)例化FCKeditor,如果是編輯頁面則再加入一行:
//$Content可以是從數(shù)據(jù)庫中讀取出來的數(shù)據(jù)
$oFCKeditor->Value = $Content ;
默認(rèn)情況下,上傳圖片功能僅對(duì)應(yīng)于ASP方式,要想實(shí)現(xiàn)在PHP下上傳文件,還得對(duì)FCKeditor的配置文件進(jìn)行修改。打開/ FCKeditor/js/fck_config.js(這是FCKeditor的主配置文件),定位到文件的最下面那段被//注釋掉的內(nèi)容,將
//##
//## Image Browsing
//##
config.ImageBrowser = true ;
// Custom Page URL
config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_html/browse.html" ;
//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_php/browse.php" ;
//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_jsp/browse.jsp?type=img" ;
//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_asp/browse.asp" ;
//##
//## Image Upload
//##
config.ImageUpload = true ;
// Page that effectivelly upload the image.
config.ImageUploadURL = config.BasePath + "filemanager/upload/asp/upload.asp" ;
//config.ImageUploadURL = config.BasePath + "filemanager/upload/aspx/upload.aspx" ;
//config.ImageUploadURL = config.BasePath + "filemanager/upload/cfm/upload.cfm" ;
//config.ImageUploadURL = config.BasePath + "filemanager/upload/php/upload.php" ;
//config.ImageUploadURL = config.BasePath + "filemanager/upload/jsp/upload.jsp" ;
改為
//##
//## Image Browsing
//##
config.ImageBrowser = true ;
// Custom Page URL config.
ImageBrowserURL = "filemanager/browse/sample_html/browse.html" ;
config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_php/browse.php" ;
//##
//## Image Upload
//##
config.ImageUpload = true ;
// Page that effectivelly upload the image.
config.ImageUploadURL = config.BasePath + "filemanager/upload/php/upload.php" ;
最后再修改2個(gè)文件:
/FCKeditor/filemanager/upload/php/upload.php
第22行
$UPLOAD_BASE_URL = '/userimages/';
/FCKeditor/filemanager/browse/sample_php/browse.php
第20行
$IMAGES_BASE_URL = '/FCKeditor/userimages/';
這兩處定義了圖片上傳到哪個(gè)目錄,可以自行定義,不過一定要確保該目錄存在,不然上傳圖片時(shí)會(huì)報(bào)錯(cuò)。
然后我們把FCKeditor目錄下的用不到的.asp、.jsp、. cfm文件和_test、_ aspnet、_developers、_docs、_jsp目錄都刪掉以節(jié)省空間。好啦,F(xiàn)CKeditor的基本使用方法就講到這里,大家感興趣的話可以到我的網(wǎng)站來看看效果:http://www.shaof.com 。
補(bǔ)充:
在FCKeditor官方的網(wǎng)站注明FCKeditor目前支持3種瀏覽器:IE5+,Mozilla and Netscape。但在實(shí)驗(yàn)中發(fā)現(xiàn)使用IE5.0是不支持圖片上傳功能,只有將IE升級(jí)到5.5或者6.0才能支持圖片上傳功能。而對(duì)于剛出的Mozilla Firefox 1.0 RC1以及Mozilla1.6(Linux環(huán)境),則完全無法使用FCKeditor。
以下是使用IE5.0和IE6.0時(shí)的截圖。
FCKeditor截圖
使用IE5.0時(shí),看不到“上傳”提示
SATAND 回復(fù)于:2004-10-31 17:28:06
粗讀了js文件,可擴(kuò)展性還好但是功能有限
放棄,作為紀(jì)念品收藏
參考四
在線編輯器FCKeditor在PHP中的使用方法
在線編輯器FCKeditor在PHP中的使用方法 (轉(zhuǎn)帖)
原作者:tjyihui 出處: phpx.com
FCKeditor是sourceforge.net上面的一個(gè)開源項(xiàng)目,主要是實(shí)現(xiàn)在線網(wǎng)頁編輯器的功能,官方網(wǎng)站為http://www.fckeditor.net ,在服務(wù)器端支持ASP.Net、ASP、ClodFusion、PHP、Java等語言,并且支持IE 5+、Mozilla 、Netscape等主流瀏覽器。目前最新版本為2.0 Beta 2,但是目前2.0 Beta版還不支持PHP,所以這里我選擇使用了1.6版本。下面是FCKeditor的一個(gè)截圖:
首先我們先到http://sourceforge.net/projects/fckeditor/ 下載FCKeditor_1.6.zip,并將其解壓縮到你的網(wǎng)站子目錄里面,并將文件夾名改為FCKeditor。進(jìn)入到FCKeditor/目錄下,打開_test/目錄,里面含有各種編程語言調(diào)用FCKeditor的方法,其中與PHP有關(guān)的文件有2個(gè)文件:
test.php //提交數(shù)據(jù)頁面
testsubmit.php //顯示數(shù)據(jù)頁面
大家可以看一下,了解FCKeditord的調(diào)用方法,下面是我簡(jiǎn)寫了一個(gè)test程序:
<?php
if($_POST["ADD"]){
$Content=$_POST['EditorDefault'];
echo $Content;
//變量$Content就是我們?cè)贔CKeditord里面編輯的內(nèi)容,這里可以將其保存到數(shù)據(jù)庫里面
}
?>
<html>
<head>
<?php
//引入在線編輯器
include("../FCKeditor/fckeditor.php") ;
?>
</head>
<body>
<br>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" language="javascript">
<?php
$oFCKeditor = new FCKeditor ;
// FCKeditor所在目錄
$oFCKeditor->BasePath = '../FCKeditor/' ;
// 將FCKeditor實(shí)例化
$oFCKeditor->CreateFCKeditor( 'EditorDefault', '100%', 300 ) ;
?>
<INPUT type="submit" name="ADD" value="提交">
</form>
</body>
</html>
從上面的例子中我們可以看到要使用FCKeditor,首先要執(zhí)行
include("../FCKeditor/fckeditor.php") ;語句來引用FCKeditor。然后執(zhí)行
$oFCKeditor = new FCKeditor ;
$oFCKeditor->BasePath = '../FCKeditor/' ;
$oFCKeditor->CreateFCKeditor( 'EditorDefault', '100%', 300 ) ;
來實(shí)例化FCKeditor,如果是編輯頁面則再加入一行:
//$Content可以是從數(shù)據(jù)庫中讀取出來的數(shù)據(jù)
$oFCKeditor->Value = $Content ;
默認(rèn)情況下,上傳圖片功能僅對(duì)應(yīng)于ASP方式,要想實(shí)現(xiàn)在PHP下上傳文件,還得對(duì)FCKeditor的配置文件進(jìn)行修改。打開/ FCKeditor/js/fck_config.js(這是FCKeditor的主配置文件),定位到文件的最下面那段被//注釋掉的內(nèi)容,將
//##
//## Image Browsing
//##
config.ImageBrowser = true ;
// Custom Page URL
config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_html/browse.html" ;
//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_php/browse.php" ;
//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_jsp/browse.jsp?type=img" ;
//config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_asp/browse.asp" ;
//##
//## Image Upload
//##
config.ImageUpload = true ;
// Page that effectivelly upload the image.
config.ImageUploadURL = config.BasePath + "filemanager/upload/asp/upload.asp" ;
//config.ImageUploadURL = config.BasePath + "filemanager/upload/aspx/upload.aspx" ;
//config.ImageUploadURL = config.BasePath + "filemanager/upload/cfm/upload.cfm" ;
//config.ImageUploadURL = config.BasePath + "filemanager/upload/php/upload.php" ;
//config.ImageUploadURL = config.BasePath + "filemanager/upload/jsp/upload.jsp" ;
改為
//##
//## Image Browsing
//##
config.ImageBrowser = true ;
// Custom Page URL config.
ImageBrowserURL = "filemanager/browse/sample_html/browse.html" ;
config.ImageBrowserURL = config.BasePath + "filemanager/browse/sample_php/browse.php" ;
//##
//## Image Upload
//##
config.ImageUpload = true ;
// Page that effectivelly upload the image.
config.ImageUploadURL = config.BasePath + "filemanager/upload/php/upload.php" ;
最后再修改2個(gè)文件:
/FCKeditor/filemanager/upload/php/upload.php
第22行
$UPLOAD_BASE_URL = '/userimages/';
/FCKeditor/filemanager/browse/sample_php/browse.php
第20行
$IMAGES_BASE_URL = '/FCKeditor/userimages/';
這兩處定義了圖片上傳到哪個(gè)目錄,可以自行定義,不過一定要確保該目錄存在,不然上傳圖片時(shí)會(huì)報(bào)錯(cuò)。
然后我們把FCKeditor目錄下的用不到的.asp、.jsp、. cfm文件和_test、_ aspnet、_developers、_docs、_jsp目錄都刪掉以節(jié)省空間。好啦,F(xiàn)CKeditor的基本使用方法就講到這里,大家感興趣的話可以到我的網(wǎng)站來看看效果:http://www.shaof.com 。
參考五
FCKeditor是目前互聯(lián)網(wǎng)上最好的在線編輯器,功能強(qiáng)大,支持IE 5.5+ (Windows), Firefox 1.0+, Mozilla 1.3+ and Netscape 7.1+.瀏覽器,無平臺(tái)限制,能夠在Windows, Mac and Linux上正常運(yùn)行,可以和多種WEB語言融合,如ASP.Net 、ASP、ColdFusion、PHP、Java、 Active-FoxPro、Lasso、Perl、Python,還有多語言支持,提供50多種語言包,是一種開源軟件。最新的版本是2.4.3,下載地址:http://www.fckeditor.net/download
FCKeditor作為一種支持多平臺(tái),多語言的編輯器,下載之后就可以直接在程序或者網(wǎng)頁中使用。有時(shí)由于系統(tǒng)并不需要如此之多的功能,所以還是需要進(jìn)行一些簡(jiǎn)單的修改,配置更加適合自己的網(wǎng)站的個(gè)性編輯器。
一、優(yōu)化FCKeditor文件夾和文件:
下載FCKeditor并解壓之后,會(huì)產(chǎn)生_samples和editor兩個(gè)文件夾和幾個(gè)文件,全部刪除以_開頭的文件夾和文件,因?yàn)檫@些都是FCKeditor的一些例子而已,可以學(xué)習(xí)一下,但上傳到網(wǎng)站服務(wù)器上就大可不必了,刪除。在根目錄下,還有幾個(gè)fckeditor.asp,fckeditor.php,fckeditor.js......等其它文件,這個(gè)就看你的網(wǎng)站服務(wù)器和網(wǎng)站需要什么程序語言,有PHP,ASP,PERL,.NET等,我選擇的是腳本配置文件fckeditor.js,還有三個(gè)文件fckconfig.js、fckstyles.xml、fcktemplates.xml是必需的文件,其它的可以全部刪除。
打開editor文件夾,進(jìn)入lang文件夾,這里面是FCKeditor的語言包來的,一般國(guó)內(nèi)選擇en.js和zh.js和zh-cn.js文件就可以了,加上必需的文件fcklanguagemanager.js(此文件是2.4版本以下必需的),其它的文件可以完全刪除。
之后打開editor/filemanager文件夾,如果不要求在上傳圖片或者文件的時(shí)候顯示服務(wù)器上的內(nèi)容,可以選擇刪除filemanager文件夾下的brower文件夾。然后進(jìn)入upload文件夾,里面是各種程序語言的上傳文件,選擇你需要的那個(gè)程序語言文件夾,其它的刪除。
進(jìn)入editor/Plugins文件夾,如果你不需要這些額外的FCKeditor插件的話,把里面的文件夾全部刪除。
進(jìn)入editor/skins文件夾,里面是編輯器的皮膚文件,default文件是默認(rèn)的灰色面板的編輯器,Office2003和silver是另外加載的,看哪個(gè)好看就選擇哪個(gè),然后其它的刪除。
另外,editor/dialog文件夾里是一些編輯器的對(duì)話框,如果選擇基本的一些功能的話,可以相應(yīng)的選擇其文件,把其它的刪除也是可以的。
到這里,編輯器的文件夾優(yōu)化基本OK了,精簡(jiǎn)了許多,更加方便了服務(wù)器的上傳和使用。
二、FCKeditor的基本配置修改:
fckconfig.js是FCKeditor編輯器的配置文件,不涉及到工具按鈕的增加的話修改這里面的配置完全可以了。
下面列舉的是fckconfig.js里的配置選項(xiàng):
AutoDetectLanguage=true/false 自動(dòng)檢測(cè)語言
BaseHref="" _fcksavedurl="""" 相對(duì)鏈接的基地址
ContentLangDirection="ltr/rtl" 默認(rèn)文字方向
ContextMenu=字符串?dāng)?shù)組,右鍵菜單的內(nèi)容
CustomConfigurationsPath="" 自定義配置文件路徑和名稱
Debug=true/false 是否開啟調(diào)試功能,這樣,當(dāng)調(diào)用FCKDebug.Output()時(shí),會(huì)在調(diào)試窗中輸出內(nèi)容
DefaultLanguage="" 缺省語言
EditorAreaCss="" 編輯區(qū)的樣式表文件
EnableSourceXHTML=true/false 為TRUE時(shí),當(dāng)由可視化界面切換到代碼頁時(shí),把HTML處理成XHTML
EnableXHTML=true/false 是否允許使用XHTML取代HTML
FillEmptyBlocks=true/false 使用這個(gè)功能,可以將空的塊級(jí)元素用空格來替代
FontColors="" 設(shè)置顯示顏色拾取器時(shí)文字顏色列表
FontFormats="" 設(shè)置顯示在文字格式列表中的命名
FontNames="" 字體列表中的字體名
FontSizes="" 字體大小中的字號(hào)列表
ForcePasteAsPlainText=true/false 強(qiáng)制粘貼為純文本
ForceSimpleAmpersand=true/false 是否不把&符號(hào)轉(zhuǎn)換為XML實(shí)體
FormatIndentator="" 當(dāng)在源碼格式下縮進(jìn)代碼使用的字符
FormatOutput=true/false 當(dāng)輸出內(nèi)容時(shí)是否自動(dòng)格式化代碼
FormatSource=true/false 在切換到代碼視圖時(shí)是否自動(dòng)格式化代碼
FullPage=true/false 是否允許編輯整個(gè)HTML文件,還是僅允許編輯BODY間的內(nèi)容
GeckoUseSPAN=true/false 是否允許SPAN標(biāo)記代替B,I,U標(biāo)記
IeSpellDownloadUrl=""下載拼寫檢查器的網(wǎng)址
ImageBrowser=true/false 是否允許瀏覽服務(wù)器功能
ImageBrowserURL="" 瀏覽服務(wù)器時(shí)運(yùn)行的URL
ImageBrowserWindowHeight="" 圖像瀏覽器窗口高度
ImageBrowserWindowWidth="" 圖像瀏覽器窗口寬度
LinkBrowser=true/false 是否允許在插入鏈接時(shí)瀏覽服務(wù)器
LinkBrowserURL="" 插入鏈接時(shí)瀏覽服務(wù)器的URL
LinkBrowserWindowHeight=""鏈接目標(biāo)瀏覽器窗口高度
LinkBrowserWindowWidth=""鏈接目標(biāo)瀏覽器窗口寬度
Plugins=object 注冊(cè)插件
PluginsPath="" 插件文件夾
ShowBorders=true/false 合并邊框
SkinPath="" 皮膚文件夾位置
SmileyColumns=12 圖符窗列數(shù)
SmileyImages=字符數(shù)組 圖符窗中圖片文件名數(shù)組
SmileyPath="" 圖符文件夾路徑
SmileyWindowHeight 圖符窗口高度
SmileyWindowWidth 圖符窗口寬度
SpellChecker="ieSpell/Spellerpages" 設(shè)置拼寫檢查器
StartupFocus=true/false 開啟時(shí)FOCUS到編輯器
StylesXmlPath="" 設(shè)置定義CSS樣式列表的XML文件的位置
TabSpaces=4 TAB鍵產(chǎn)生的空格字符數(shù)
ToolBarCanCollapse=true/false 是否允許展開/折疊工具欄
ToolbarSets=object 允許使用TOOLBAR集合
ToolbarStartExpanded=true/false 開啟是TOOLBAR是否展開
UseBROnCarriageReturn=true/false 當(dāng)回車時(shí)是產(chǎn)生BR標(biāo)記還是P或者DIV標(biāo)記
下面詳細(xì)的說明一下一些常用的配置選項(xiàng):
FCKConfig.DefaultLanguage = 'en' ; //選擇編輯器的語言,editor/lang/文件夾下面的有相應(yīng)的語言腳本文件。
FCKConfig.ToolbarStartExpanded = true ;//載入編輯器的時(shí)候展開還是收縮工具按鈕。
FCKConfig.ToolbarSets["Default"] 和 FCKConfig.ToolbarSets["Basic"]是載入的時(shí)候顯示全部工具按鈕還是部分基本按鈕。可以在fckeditor.js或者fckeditor.asp/php等文件中設(shè)置。
FCKConfig.ContextMenu這個(gè)是編輯器的右鍵配置文件,可以自己增減對(duì)應(yīng)按鈕。
FCKConfig.LinkBrowser = false ;//瀏覽服務(wù)器上的文件,如果選擇false不允許的話,接下去的幾行可以相應(yīng)的注釋掉。后面的FCKConfig.ImageBrowser = false ;FCKConfig.FlashBrowser = false ;也是如此。如果選擇允許的話,將相應(yīng)的程序語言部分的注釋去掉。
FCKConfig.LinkUpload = true ;FCKConfig.ImageUpload = true ;FCKConfig.FlashUpload = true ;這三個(gè)配置選項(xiàng)是設(shè)置文件上傳的,如果不允許用戶上傳文件,則把true修改為false即可。如果允許,請(qǐng)?jiān)谙鄳?yīng)的程序語言里選擇,即把對(duì)應(yīng)的注釋行去掉即可。
修改完畢之后再打開相應(yīng)的程序語言的FCKeditor文件繼續(xù)。
三、修改編輯器載入時(shí)的配置:
打開fckeditor.js或者fckeditor.asp/php/pl等文件,這些文件的配置情況都是差不多的。這里拿fckeditor.js說明。
Width:編輯器寬度。
Height:編輯器高度。
ToolbarSet:編輯器工具按鈕:default或者basic。
BasePath:編輯器所在目錄,建議使用根目錄形式。
其它的就可以設(shè)置默認(rèn)的就可以了。
四、使用FCKeditor編輯器:
1、ASP程序語言載入編輯器:
包含文件fckeditor.asp文件,然后在相應(yīng)的地方加入下面的代碼:
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/"
oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "400"
oFCKeditor.Value = rs("Content")
oFCKeditor.Create "Content"
%>
2、JS程序語言載入編輯器:
引用腳本fckeditor.js文件,在相應(yīng)的地方加入下面的代碼:
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'Content' ) ;
oFCKeditor.BasePath = '/' ;
oFCKeditor.ToolbarSet = 'Basic' ;
oFCKeditor.Width = '100%' ;
oFCKeditor.Height = '400' ;
oFCKeditor.Value = '' ;
oFCKeditor.Create() ;
</script>
JS語言版本的還有一種替換文本框加快頁面顯示的文件,在這里我選擇的是點(diǎn)擊編輯框才出現(xiàn)編輯器,引用fckeditor.js文件,加入如下代碼:
<script type="text/javascript">
<!--
function ShowEditor() {
var oFCKeditor = new FCKeditor( 'Content' ) ;
oFCKeditor.BasePath = "../FCKeditor/" ;
oFCKeditor.Value = '' ;
oFCKeditor.ReplaceTextarea() ;
}
//-->
</script><div id="preContent"><textarea id="Content" onclick="javascript:ShowEditor();"></textarea></div>
3、PHP程序語言載入編輯器:
包含fckeditor.php文件,在相應(yīng)的地方加入下面的代碼:
<?php
$oFCKeditor = new FCKeditor('Content') ;
$oFCKeditor->BasePath = "../FCKeditor/" ;
$oFCKeditor->Value = '' ;
$oFCKeditor->Create() ;
?>
新聞熱點(diǎn)
疑難解答