導航:首頁 > 編程語言 > fckeditorphp配置

fckeditorphp配置

發布時間:2023-04-02 02:16:47

A. php環境下Fckeditor上傳圖片,如果是自定義的上傳類該如何去調用、需要哪些配置呢

換成ckeidter到配置文件在編輯器目錄下,有個config配置文件 ,在這裡面寫入如下代碼
CKEDITOR.editorConfig = function( config )
{config.filebrowserImageUploadUrl ='./static/ckeditor/upload.php?type=img';}路徑可以根據情況自己修改,upload為你自己的上傳類,具體的接受參數你可以從網上自己看看!!!

B. php 中的FCKeditor,我想在FCKeditor文件夾外面調用fckeditor,怎麼配置

先要在你想調用編輯器的文件中引用:include "fckeditor/fckeditor.php";
然後在你想放編輯器的地方寫上:
<?php
$oFCKeditor = new FCKeditor('content') ;
$oFCKeditor->BasePath = 'fckeditor/' ;
$oFCKeditor->ToolbarSet = 'Default' ;
$oFCKeditor->InstanceName = 'content' ;
$oFCKeditor->Width = '100%' ;
$oFCKeditor->Height = '400' ;
$oFCKeditor->Value = '';
$oFCKeditor->Create() ;
?>

C. FCKEditor 2.5編輯器設置及修改方法For PHP

fck的一般配置用fckconfig.js就可以搞定了,如果你想改一下他的動態代碼可以打開fck下的editor\filemanager\connectors目錄,裡面都是他支持的語言,
(asp,aspx,cfm,lasso,perl,php,py)
你可以根據你使用的語言來改,比如php
其他都可以刪除,

FCKeditor的精簡及修改
http://www.phperz.com/php/php-article/122022H007227.html

D. 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.

E. 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";

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. FCKeditor_2.5在 php的配置方法

下載FCKeditor,解壓至FCKeditor。

1.首先刪除不必要的文件節省空間。凡是以_開頭的文件如_samples,_testcases和一些用不到的.asp、.jsp、.cfm文件統統幹掉。

2.修改fckconfig.js
FCKConfig.AutoDetectLanguage = true ;//是否自動檢測語言
FCKConfig.DefaultLanguage = 'zh-cn' ;//設置語言
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;//設置皮膚
FCKConfig.TabSpaces = 1 ;//tab是否有效
FCKConfig.ToolbarStartExpanded = true ;//編輯工具條是否出現,等點「展開工具欄」時才出現
FCKConfig.FontNames = '宋體;黑體;隸書;楷體_GB2312;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;//添加中文字體

3.修改FCKeditor\editor\css\fck_editorarea.css
設置默認字體及大小
body, td
{
font-family: Arial, Verdana, Sans-Serif;
font-size: 14px;
}

4.關於文件上傳的設置

修改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/' ;//設置上傳的文件夾,可自己指定

修改fckeditor\editor\filemanager\upload\php
$Config['Enabled'] = true ;
$Config['UseFileType'] = true ;
$Config['UserFilesPath'] = '/UserFiles/' ;//同上要一樣

5.引入在線編輯器時只需
<?php
include("fckeditor/fckeditor.php") ;
$oFCKeditor = new FCKeditor('FCKeditor1') ;//實例化
$oFCKeditor->BasePath = 'fckeditor/';//這個路徑一定要和上面那個引入路徑一致,否則會報錯:找不到fckeditor.html頁面
//$oFCKeditor->Value = '' ;
$oFCKeditor->Width = '100%' ;
$oFCKeditor->Height = '300' ;
$oFCKeditor->Create() ;
?>

JS用alert( FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML( true ))得到FCKeditor1的值;
PHP用$_POST['FCKeditor1']得到FCKeditor1的值。

閱讀全文

與fckeditorphp配置相關的資料

熱點內容
程序員那麼可愛孩子還在嗎 瀏覽:513
以下哪些是資料庫編程技術 瀏覽:164
水冷壓縮冷凝機組 瀏覽:176
小米路由器app怎麼加黑名單 瀏覽:433
證券交易2012pdf 瀏覽:208
單線程和多線程編譯 瀏覽:155
游戲被加密了刪不了怎麼辦 瀏覽:475
二建6米的柱子加密多少箍筋 瀏覽:648
怎麼簡單易懂的了解伺服器 瀏覽:356
mcpe怎麼看伺服器地址 瀏覽:994
螢石雲智能鎖添加密碼 瀏覽:503
股票自動化交易編程 瀏覽:471
android自定義窗口 瀏覽:921
工程動力學pdf 瀏覽:179
騰訊的雲伺服器是bgp嗎 瀏覽:945
excel弘編程 瀏覽:912
什麼人不適合做程序員 瀏覽:675
喜購app怎麼樣 瀏覽:804
交換機查鄰居命令 瀏覽:343
渲染卡在正在編譯場景幾何體 瀏覽:316