FCKeditor installation (PHP) _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
FCKeditor installation (PHP ). 1. download the latest FCKEditor and decompress it. delete the FCKeditor directory except fckconfig. js, fckeditor. js, fckstyles. xml, fcktemplates. xml, fckeditor. delete directories from all files other than five php files. download the latest FCKEditor and decompress it.
2. delete all files except fckconfig. js, FCKeditor. js, fckstyles. xml, fcktemplates. xml, and fckeditor. php in the/fckeditor/directory.
Delete the directory/editor/_ source, _ testcases (basically, all folders or files starting with _ are optional ),
Delete all directories except the PHP directory in/editor/filemanager/browser/default/connectors/
Delete all directories except the PHP directory under/editor/filemanager/upload/
Delete all files except en. js, zh. js and zh-cn.js under/editor/lang/

3.
Open/FCKeditor/fckconfig. js
Modify
Var FCKConfig. DefaultLanguage = 'zh-cn ';
Var _ FileBrowserLanguage = 'php ';
Var _ QuickUploadLanguage = 'php ';
To enable file upload, you also need to configure FCKeditor \ editor \ filemanager \ upload \ php \ config. php and \ FCKeditor \ editor \ filemanager \ browser \ default \ connectors \ php \ config. php
(Garbled characters will occur when uploading a Chinese name file)

4. call method
Put FCKeditor in the website root directory
The PHP file contains the/FCKeditor/fckeditor. php file.
// Contains the fckeditor class
Include ("../FCKeditor/fckeditor. php ");
// Set the editor path
$ SBasePath = "/FCKeditor /";
// Create a Fckeditor with the form name ipaddr
$ OFCKeditor = new FCKeditor ('ipadd ');
$ OFCKeditor-> BasePath = $ sBasePath;
// Set the initial value of the form.
$ OFCKeditor-> Value = 'This is some Sample text';
$ OFCKeditor-> Create ();

// You can also set
$ OFCKeditor-> Width
$ OFCKeditor-> Height
$ OFCKeditor-> ToolbarSet

5. customization
A. Custom call path
Change the FCKeditor directory to editor/, and specify the root path as/editor/during the call /.
B. customized style
You can customize the style by modifying the Skin under the editor \ skins directory, mainly by modifying CSS.
C. Custom toolbar

In fckconfig. js, Default and Basic toolbar are customized by Default. you can also customize your own toolbar according to the format, and use $ oFCKeditor-> ToolbarSet = toolbarname in php to call

D. Custom fonts
Add the following to the fckconfig. FontNames font list in FCKConfig. js:
; _ GB2312;
(Save it as UTF8 format)

E. Disable file upload.
I. set fckconfig. LinkBrowser, FCKConfig. ImageBrowser, FCKConfig. FlashBrowser, FCKConfig. LinkUpload, FCKConfig. ImageUpload, and FCKConfig. FlashUpload in FCKConfig. js to false.
Ii. directly delete the php file in filemanager
Iii. Custom toolbars
Most importantly, you need to change the php file under filemanager. only authenticated users can access the file.

F. note: use an editor such as Editplus to edit the configuration file. Note that the format is utf8.

Others:
The installation method of asp is similar. just change all php to asp.
On the JSP platform, you need to delete all filemanager files and replace them with servlets. you need to modify several configurations in fckconfig. js (LinkBrowserURL, ImageBrowserURL, FlashBrowserURL, LinkUploadURL, FlashUploadURL, and ImageUploadURL ).

Limit 2. delete/FCKeditor/directory except fckconfig. js, fckeditor. js, fckstyles. xml, fcktemplates. xml, fckeditor. delete directories of all files other than five php files...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.