fckeditor在php中的用法(添加于修改寫成了函數(shù))
更新時間:2009年12月15日 12:32:35 作者:
這里就不多說了,看代碼。后面有說明。
復(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)于一個input控件,相當(dāng)于是一個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)于一個input控件,相當(dāng)于是一個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安裝及配置方法圖文教程
相關(guān)文章
xhEditor 免費(fèi)的國產(chǎn)HTML在線編輯器
在線編輯器,CKeditor+CKfinder的組合是首選的,可惜CKfinder要收費(fèi),黃金搭檔只有1個是免費(fèi)的,又不想用回老版本,所以站長只好另尋他路。2011-06-06百度編輯器 如何獲取光標(biāo)位置與不同幀內(nèi)的節(jié)點(diǎn)
當(dāng)我們console.log(domUtils)的時候,可以在控制臺中,看見很多domUtils下的方法,這些方法都是用于操作節(jié)點(diǎn)的,findParentByTagName()顧名思義,獲取的是節(jié)點(diǎn),當(dāng)我們的光標(biāo)在編輯器內(nèi)容處,而我們要獲取相應(yīng)內(nèi)容外層節(jié)點(diǎn)的id以及各種屬性,就需要通過domUtils來獲得不同幀內(nèi)的節(jié)點(diǎn)2012-07-07關(guān)于CKeditor的非主流個性應(yīng)用的設(shè)置
因?yàn)槲业木W(wǎng)站需要一個編輯器,所以用周末時間研究了一下CKeditor,終于最終修改成了合適的樣子。2009-12-12KindEditor 4.x 在線編輯器常用方法小結(jié)
要修改默認(rèn)后臺程序處理文件,修改plugins(插件文件夾)下的JavaScript內(nèi)容fileManagerJson改為自己使用程序語言2011-11-11asp.net 為FCKeditor開發(fā)代碼高亮插件實(shí)現(xiàn)代碼
昨天已經(jīng)將BlogEngine的可視化編輯器換成了FCKeditor,作為一個程序員,在博客中插入代碼是很重要的一塊。網(wǎng)上現(xiàn)有的都是修改FCKeditor的fckeditorcode_gecko.js和fckeditorcode_ie.js以達(dá)到InsertCode的目的。這個方法非常麻煩,當(dāng)要使用FCKeditor新版本時都要重新修改這兩個文件,非常影響我們的效率。2008-08-08FCKeditor 和 SyntaxHighlighter 代碼高亮插件的整合
FCKeditor 和 SyntaxHighlighter 代碼高亮插件的整合方法,里面有下載,可以根據(jù)需要結(jié)合自己的fckeditor版本。2010-04-04