Home >Backend Development >PHP Tutorial >Configuring the online editor FCKeditor_PHP tutorial in PHP environment
Notes on trial of online editor FCKeditor 2.0 in PHP environment
1. Introduction
FCKeditor 2.0 RC1 version was launched on November 30, 2004. According to its official website: This is the first stable version of FCKeditor 2.0 version. You can now consider officially using it. Currently supported backend languages are ASP, ASP.Net, PHP and ColdFusion.
After a simple trial, the author found that the online editor version 2.0 does have many improvements over version 1.6. First, the file structure of FCKeditor is clearer, making it easier to deploy it in your own system. In addition, version 2.0 finally supports the Firefox 1.0 browser, which will win more users for FCKeditor. Without further ado, let us quickly learn how to install and configure FCKeditor 2.0.
2. Installation and examples
First, go to http://sourceforge.net/projects/fckeditor/ to download FCKeditor 2.0 RC1 (554K), unzip it into your website directory, and change the folder name to FCKeditor. For example, if your website is placed under the directory shaof, create 3 subdirectories in this directory:
n FCKeditor: Stores the FCKeditor online editor downloaded from the website
n upimages: used to store uploaded images
n admin: The test page is stored in it
The structure of the website is as follows:
/FCKeditor //FCKeditor directory
/UserFiles //Upload file directory
/admin
test.php //Submit data page
testsubmit.php //Display data page
Enter the FCKeditor directory and open the _samples directory, which contains sample program pages for calling FCKeditor in various programming languages. The php directory contains some examples of using PHP to call FCKeditor. You can take a look to learn how to call FCKeditord. The following is a test.php program I abbreviated and placed in the admin directory under the root directory of the website:
if($_POST["ADD"]){
$Content=$_POST['EditorDefault'];
echo $Content;
//The variable $Content is the content we edited in FCKeditord. It can be saved to the database here and the code is omitted.
}
3. Configure the online editor
The configuration file of FCKeditor 2.0 is FCKeditorfckconfig.js, and several important configuration items are as follows:
1. Toolbar settings
By default, FCKeditor will call the following toolbar buttons, which you can increase or decrease according to your needs. It should be noted that the buttons in version 2.0 and version 1.6 are not exactly the same, and some buttons have been deleted or renamed.
//##
//## Toolbar Buttons Sets
//##
FCKConfig.ToolbarSets["Default"] = [
['Source','-','Save','NewPage','Preview'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink'],
['Image','Table','Rule','SpecialChar','Smiley'],
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['About']
] ;
2. Simplified Chinese settings
Edit edit/lang/fcklanguagemanager.js