復(fù)制代碼 代碼如下:
function CreateEditor ($act,$id,$url) { #調(diào)用FCKeditor并補(bǔ)完發(fā)表文章的表單,act=0:發(fā)表新文章 =1修改文章
include("editor/fckeditor.php"); //FCKeditor已存放到此目錄下
$oEditor = new FCKeditor ("content"); //對應(yīng)于一個(gè)input控件,相當(dāng)于是一個(gè)name=content的textarea
$oEditor -> BasePath = 'editor/'; //配置基本信息
$oEditor -> Width = "100%";
$oEditor -> Height = "400";
if( $act ) {
$query = "SELECT title,content FROM article WHERE id=$id";
$result = mysql_query($query);
$fillin = mysql_fetch_array($result);
}
echo 'form action="'.$url.'" method="post">';
echo 'p>Title: input type="text" class="text" class="text" name="title" size="100" value="'.$fillin['title'].'">/p>p>';
if( $act ) $oEditor -> Value = $fillin['content']; //若是修改文章,則將原文章內(nèi)容放進(jìn)編輯器
$oEditor -> Create(); //創(chuàng)建編輯器
echo '/p>';
echo 'p>input type="submit" class="button" value="P o s t">/p>';
echo '/form>';
}
如果是編輯頁面:(直接把下面的放在文本區(qū)域就可以了)
復(fù)制代碼 代碼如下:
?php
include("../../../FCKeditor/fckeditor.php"); //FCKeditor已存放到此目錄下
$oEditor = new FCKeditor ("content"); //對應(yīng)于一個(gè)input控件,相當(dāng)于是一個(gè)name=content的textarea
$oEditor -> BasePath = '../../../FCKeditor/'; //配置基本信息
$oEditor -> Width = "100%";
$oEditor -> Height = "400";
$oEditor -> Value = $list['content']; //若是修改文章,則將原文章內(nèi)容放進(jìn)編輯器
$oEditor -> Create(); //創(chuàng)建編輯器
?>
您可能感興趣的文章:- PHP中CKEditor和CKFinder配置問題小結(jié)
- 針對PHP環(huán)境下Fckeditor編輯器上傳圖片配置詳細(xì)教程
- 探討fckeditor在Php中的配置詳解
- fckeditor編輯器在php中的配置方法
- php下安裝配置fckeditor編輯器的方法
- php下FCKeditor2.6.5網(wǎng)頁編輯器的使用方法
- php ckeditor上傳圖片文件名亂碼解決方法
- php fckeditor 調(diào)用的函數(shù)
- 將FCKeditor導(dǎo)入PHP+SMARTY的實(shí)現(xiàn)方法
- jQuery+PHP發(fā)布的內(nèi)容進(jìn)行無刷新分頁(Fckeditor)
- php版本CKEditor 4和CKFinder安裝及配置方法圖文教程