FCKeditor usage Summary

Source: Internet
Author: User
Tags blank page
Usage: 1.My website directory is www. which contains the following folders and files
/WWW
Add. php
/Include
/FCKeditor

2.Call FCKeditor'sMethod:
(1) include ("FCKeditor/FCKeditor. php ")
(2) Add
$ Ofckeditor = new FCKeditor ('fckeditor1'); // create an object
$ Ofckeditor-> basepath = 'fckeditor/'; // location of FCKeditor
$ Ofckeditor-> toolbarset = 'default'; // tool button
$ Ofckeditor-> Create ('editordefault', '20140901', 60% );
?>
(The basepath path must be the same as the include path above. Otherwise, the file cannot be found)
In addition, if you want to store the input variableDatabaseIts variable name is
Object Name. For example, the above is fckeditor1

3.There is an example of PHP calling in FCKeditor/_ samples/, for example, simples01.php.
And sampleposteddata. php. The file that follows is the PHP that outputs the variable name.
Program to get the variable name in the text input box.

4.You can easily customize the toolbar function button of FCKeditor.
In the FCKeditor configuration file FCKeditor/fck_config.js.
, A function button corresponds to a unique name.
In fck_config.js, three toolbar styles have been set by default: default (Package
Including all functions), accessibility and basic.
Let's take a look at the custom format of the toolbar style:
Config. toolbarsets ["toolbarsetname"] = [// toolbar name
['Item 1', 'item 2', '-', 'item 3', 'item n'], // first line of Toolbar
['Item 4', '-', 'item 5', 'item 6', 'item n'] // the second line of the toolbar
];
Here '-' is used to create a split bar.
Fckeditor1.6 provides 60 editing functions. The specific functions are as follows: 

Function Name Description Function Name Description
Editsource DisplayHtmlSource code Strikethrough Strikethrough
Save Save Subscr limit PT Subscript
Newpage Create blank page Superscr platinum PT Superscript
Preview Preview Justifyleft Left aligned
Cut Cut Justifycenter Center alignment
Copy Copy Justifyright Right alignment
Paste Paste Justifyfull Alignment at both ends
Pastetext Plain text Paste Insertorderedlist Automatic ID
Pasteword Paste from word Insertunorderedlist Project symbol
Print Print Outdent Reduce indentation
Spellcheck Spelling check Indent Increase indentation
Find Search Showtableborders Show table lines
Replace Replace Showdetails Show Details
Undo Undo Form Add form action
Redo Restore Checkbox Check box
Selectall Select All Radio Radio button
Removeformat Remove format Input Single Row text box
Link Insert/edit Link Textarea Scroll text box
Removelink Remove Connection Select Drop-down menu
Anchor Anchor Button Button
Image Insert/edit Image Imagebutton Image button
Table Insert/edit table Hidden Hide
Rule Insert a horizontal line Zoom Display Ratio
Specialchar Insert special characters Fontstyleadv System font
Universalkey Soft Keyboard Fontstyle Font Style
Smiley Insert emoticon Fontformat Font format
About About Font Font
Bold Bold Fontsize Font Size
Italic Italics Textcolor Text color
Underline Underline Bgcolor Background Color



The default includes all the functions of FCKeditor. I personally feel that some functions are not used, and the full loading will affect the display speed. So I simplified it and only loaded some common functions:
1. Open the FCKeditor/fck_config.js file and add the following code:
Config. toolbarsets ["www"] = [
['Editsource', 'save', 'newpage', 'preview', '-', 'Cut ', 'copy', 'paste', 'pastetext ', '-', 'Find ', 'replace', '-', 'undo ', 'redo', '-', 'selectall', '-', 'link ', 'removelink ','-', 'image', 'table', 'rule', 'specialchar', 'smiley '],
['Bold ', 'italic', 'underline', '-', 'justifyleft', 'justifycenter', 'justifyright', '-', 'insertorderedlist ', 'insertunorderedlist', '-', 'form', 'checkbox', 'Radio ', 'input', 'texta', 'select', 'button ','-', 'fontstyleadv ', 'textcolor'];
In this way, the loading speed is much faster.
You only need to set $ ofckeditor-> toolbarset = 'default'
Change to $ ofckeditor-> toolbarset = 'www '.

Last.We can delete all the directories starting with "_" in the FCKeditor directory to save space, such as _ test. _ samples.

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.