\website_root
\index.php
\FCKeditor
<Form name="frm1">
<?php
//引用FCKeditor.php這個文件,基本的類和數據結構都在這裏
include_once("FCKeditor/fckeditor.php");
//創建FCKeditor對象的實例。myFCKeditor即提交後,接收數據頁面 $_POST['myFCKeditor']使用
$FCKeditor=new FCKeditor('myFCKeditor');
//FCKeditor所在的位置,這裏它的位置就是'FCKeditor' 文件夾
$FCKeditor->BasePath='./FCKeditor/';
//工具按鈕設置
$FCkeditor->ToolbarSet='Default';
//設置它的寬度
$FCKeditor->Width='100%';
//設置它的高度
$FCKeditor->Height='300px';
//生成
$FCkeditor->Create();
?>
</Form>
<INPUT name="myFCKeditor" id="myFCKeditor" style="DISPLAY: none" type=hidden>
<INPUT id="myFCKeditor___Config" style="DISPLAY: none" type=hidden>
<IFRAME id="myFCKeditor___Frame" src="FCKeditor/editor/fckeditor.html?InstanceName=myFCKeditor&Toolbar=Default" frameBorder=0 width=100% scrolling=no height=300>
</IFRAME>
</Form>
<script>
<input type=button onclick="alert(document.all.frm1.myFCKeditor.value);" value="GetHtml">
</script>
你會發現彈談出的窗口沒內容。
function getContentValue()
{
var oEditor = FCKeditorAPI.GetInstance('myFCKeditor');
var acontent = oEditor.GetXHTML();
return acontent;
}
</script>
<input type=button onclick="alert(getContentValue());">
StrikeThrough 刪除線
Save 保存
NewPage 新建空白頁面
Superscript 上標
Subscript 下標
Preview 預覽
JustifyLeft 左對齊
Cut 剪切
Copy 複製
Paste 粘貼
JustifyCenter 居中對齊
JustifyRight 右對齊
JustifyFull 兩端對齊
PasteText 純文本粘貼
InsertOrderedList 自動編號
PasteWord 來自Word的粘貼
InsertUnorderedList 項目符號
Print 打印
Outdent 減少縮進
SpellCheck 拼寫檢查
Indent 增加縮進
Find 查找
ShowTableBorders 顯示錶格線
Replace 替換
ShowDetails 顯示明細
Undo 撤銷
Form 添加Form動作
Redo 還原
Checkbox 複選框
SelectAll 全選
Radio 單選按鈕
RemoveFormat 去除格式
Input 單行文本框
Link 插入/編輯 鏈接
Textarea 滾動文本框
RemoveLink 去除連接
Select 下拉菜單
Anchor 錨點
Button 按鈕
Image 插入/編輯 圖片
ImageButton 圖片按鈕
Table 插入/編輯 表格
Hidden 隱藏
Rule 插入水平線
Zoom 顯示比例
SpecialChar 插入特殊字符
FontStyleAdv 系統字體
UniversalKey 軟鍵盤
FontStyle 字體樣式
Smiley 插入表情符號
FontFormat 字體格式
About 關於
Font 字體
Bold 粗體
FontSize 字體大小
Italic 斜體
TextColor 文字顏色
Underline 下劃線
BGColor 背景色
FCKconfig.ToolbarSets["Default"] = [
['EditSource','Save','NewPage','Preview','-','Cut','Copy','Paste','PasteText','-','Find','Replace','-','Undo','Redo','-','SelectAll','-','Link','RemoveLink','-','Image','Table','Rule','SpecialChar','Smiley'] ,
['Bold','Italic','Underline','-','JustifyLeft','JustifyCenter','JustifyRight','-','InsertOrderedList','InsertUnorderedList','-','Form','Checkbox','Radio','Input','Textarea','Select','Button','-','FontStyleAdv','TextColor']
];
FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
];
查找$Config['Enabled'],將它設置爲'true';查找$Config['UserFilesPath'],將它設置圖片的目錄,這個目錄是相對於主目錄的。
查找$Config['Enabled'],將它設置爲'true';查找$Config['UseFileType'],將它設置上傳文件的目錄,最好與上面的圖片目錄相同。