phpfckeditor
A. php中將fckeditor中的圖片或文字怎麼插入到mysql資料庫中,在其他頁面中從資料庫中取出顯示,高手指點!
fckeditor 編輯器會自動生成一個hidden <textarea> 屬性name="abc" 用$_POST['abc']獲取編輯框的內容插入資料庫
B. 關於PHP中使用FCKeditor的問題
使用這個函數strip_tags在插入前把html標記全部刪除
不過使用FCKeditor的目的一般就是要保留html標記的 如果你不用 那麼直接使用表單不就好了嗎,這樣豈不是更簡單
C. PHP 使用fckeditor
<script src="../../fckeditor2/fckeditor.js"></script>
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'detail' ) ;
oFCKeditor.BasePath = '../../fckeditor2/' ;
oFCKeditor.ToolbarSet = 'Default' ;
oFCKeditor.Width = '100%' ;
oFCKeditor.Height = '250px' ;
oFCKeditor.Value = '{--$arr.detail--}' ;
oFCKeditor.Create() ;
</script>
{--$arr.detail--} 是你讀取的欄位已默認顯示,自己修改
D. PHP怎麼定義FCKeditor功能按鈕
在使用fckeditor 的過程中,經常需要根據實際需要來設置工具欄,顯示或隱藏工具欄上的部分按鈕。在默認情況下,fckeditor顯示了全部的工具欄。在fckconfig.js中有兩個工具欄的配置方案,一個是Default,一個是Basic。我們可以按照他的格式自定義幾個選項。FCKConfig.ToolbarSets["c1"] = [
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['FitWindow','ShowBlocks','-','About'] // No comma for the last row.
] ;在頁面中使用fckeditor時可以寫成這樣var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.ToolbarSet="c1";
E. PHP fckeditor怎麼導入
首先引入文件然後以下操作
$fck = new Fckeditor("名稱");
$fck->BasePath="路徑";
$fck->Width="設定寬度";
$fck->Height="設定高度";
需要調用 就直接$fck->Create();就ok啦!!
F. FCKeditor在php是怎麼用的啊
function CreateEditor ($act,$id,$url) { #調用FCKeditor並補完發表文章的表單,act=0:發表新文章 =1修改文章
include("editor/fckeditor.php"); //FCKeditor已存放到此目錄下
$oEditor = new FCKeditor ("content"); //對應於一個input控制項,相當於是一個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']; //若是修改文章,則將原文章內容放進編輯器
$oEditor -> Create(); //創建編輯器
echo '</p>';
echo '<p><input type="submit" class="button" value="P o s t"></p>';
echo '</form>';
}
G. php問題 FCKeditor 需要在伺服器上安裝什麼組件嗎
FCKeditor 無需安裝組件
配置細節如下:
說起 這個,更是郁悶,網上找了N篇資料,那是越看越迷糊啊,最後還是自己看代碼搞定的。為了方便日後學習也小記一下吧。
1、下載FCKeditor 多國語言版
2、解壓後為文件夾減肥:
刪除/FCKeditor/目錄下除fckconfig.js, fckeditor.js, fckstyles.xml, fcktemplates.xml,fckeditor.php五個文件以外的所有文件
刪除目錄/editor/_source,_testcases(基本上,所有_開頭的文件夾或文件都是可選的),
刪除/editor/filemanager/browser/default/connectors/下除PHP目錄的所有目錄
刪除/editor/filemanager/upload/下的除PHP目錄的所有目錄
刪除/editor/lang/下的除了 en.js, zh.js, zh-cn.js三個文件的所有文件
3.
打開/FCKeditor/fckconfig.js
修改
var FCKConfig.DefaultLanguage = 'zh-cn' ;
var _FileBrowserLanguage = 'php' ;
var _QuickUploadLanguage = 'php' ;
要開啟文件上傳的話,還需要配置FCKeditor/editor/filemanager/upload/php/config.php以及/ FCKeditor/editor/filemanager/browser/default/connectors/php/config.php
(上傳中文名文件會亂碼)
4.調用方法
將FCKeditor放在網站根目錄
在PHP文件裡面,包含/FCKeditor/fckeditor.php文件
//包含fckeditor類
include("../FCKeditor/fckeditor.php") ;
//設置編輯器路徑
$sBasePath = "/FCKeditor/";
//創建一個Fckeditor,表單的名稱為ipaddr
$oFCKeditor = new FCKeditor('ipaddr') ;
$oFCKeditor->BasePath = $sBasePath ;
//設置表單初始值
$oFCKeditor->Value = 'This is some <strong>sample text</strong>' ;
$oFCKeditor->Create() ;
//還可設置
$oFCKeditor->Width
$oFCKeditor->Height
$oFCKeditor->ToolbarSet
5.定製
a.定製調用路徑
直接將FCKeditor目錄改為editor/,並且在調用的時候指定根路徑為/editor/。
b.定製風格
可以通過修改editor/skins目錄下的Skin來定製風格,主要是修改CSS。
c.定製toolbar
在fckconfig.js中,默認定製好了Default,Basic兩種toolbar,你也可以根據格式定製自己的toolbar,並且在php中使用$oFCKeditor->ToolbarSet=toolbarname調用
d.定製字體
將fckconfig.js裡面的FCKConfig.FontNames字體列表前面加上:
宋體;黑體;隸書;楷體_GB2312;
(注意保存為UTF8格式)
e.關閉文件上傳
i. 將fckconfig.js裡面的FCKConfig.LinkBrowser,FCKConfig.ImageBrowser, FCKConfig.FlashBrowser,FCKConfig.LinkUpload,FCKConfig.ImageUpload,FCKConfig.FlashUpload 設置為false.
ii.直接將filemanager裡面的php文件刪降
iii.定製toolbars
最重要的一點,你需要更改filemanager下面的php文件,只有認證的用戶才可以訪問。
f.注意事項:請用Editplus之類的編輯器編輯配置文件,注意保存格式為utf8.
