This document uses the latest FCKeditor 2.3.1 version.
Download the official website: http://ckeditor.com/download?suggestion: download the latest official website]
Use the following code:
The first task is to streamline the powerful editor. Of course, it is to streamline the file, not the function. Here, I use the FCKeditor of ASP as an example to go to The FCKeditor folder and delete all the folders starting, these folders contain examples or other tools. In fact, only the Editor folder and fckconfig are retained. JS, FCKeditor. ASP, FCKeditor. JS, fckstyles. XML, fcktemplates. XML is enough. The outermost layer is simplified. after entering the Editor folder, delete the "_ source" folder first. Here are some source files, which are useless for use.
Go to the images folder and delete the smiley folder. Some files contain emoticon icons. If you want to use the emoticon icons here, do not delete them. If you want to change your own, delete them, however, I think I still use my own good expression. Now there are many personalized pictures. Exit images and enter the Lang folder. Here, we can clean things, fck1_agemanager. JS (the latest version does not have this file), zh-cn.js, en. JS, Zh. JS. The first file is the language configuration file, which can be used with fckconfig. JS settings correspond to the corresponding language files, zh-cn.js is a simplified Chinese Language Pack, en. JS is in English, Zh. JS is in Traditional Chinese.
Exit the Lang folder and enter the skin folder. The default folder is the default milk yellow. silver is silver, that is, gray and any color are not ugly. The office2003 skin is not very nice and is not recommended, the simplest way to change is to copy the contents of your favorite folder to the default folder...
In the last step of streamlining, exit the skin folder and go to filemanager. If you are not using the latest FCKeditor version, a folder browser is used. The new version also has an upload folder. First, go to filemanager/Browser/default/connectors/and delete all files except the ASP folder (If your webpage is other PHP, leave the corresponding PHP folder, and so on. Next, go to filemanager/upload/, and leave only the ASP folder. Now, the simplified editor is complete. Next, let's modify the settings of the editor.
The first modified file is the FCKeditor configuration file, which is located in the fckconfig. js file under the root directory. Configuration Options:
Autodetectlanguage = true/false automatic language Detection
Basehref = "relative link base address
Contentlangdirection = "LTR/RTL" default text direction
Contextmenu = string array, right-click the menu content
Customconfigurationspath = "custom configuration file path and name
DEBUG = true/false whether to enable debugging. In this way, when fckdebug. Output () is called, the content is output in the debugging window.
Defaultlanguage = "" default language
Editorareacss = "style table file in the editing area
When enablesourcexhtml = true/false is true Code HTML into XHTML
Enablexhtml = true/false: Can I use XHTML to replace HTML?
Fillemptyblocks = true/false use this function to replace empty block-level elements with spaces.
Fontcolors = "sets the text color list when the color picker is displayed
Fontformats = "sets the name displayed in the text format list
Fontnames = "fontnames
Fontsizes = "" font size list
Forcepasteasplaintext = true/false force paste to plain text
Forcesimpleampersand = true/false do not convert & symbol to XML Entity
Formatindentator = "" specifies the characters used to indent the code in the source code format.
Formatoutput = true/false: whether to automatically format the code when output content
Formatsource = true/false whether to automatically format the code when switching to the Code view
Fullpage = true/false: whether to allow editing of the entire HTML file or only the content between the bodies
Geckousespan = true/false: whether to allow the span flag to replace the B, I, u flag
Iespelldownloadurl = "" download the spelling checker URL
Imagebrowser = true/false: whether to allow browsing of server functions
Imagebrowserurl = "indicates the URL that runs when browsing the server
Imagebrowserwindowheight = "image browser window height
Imagebrowserdomainwwidth = "image browser window width
Linkbrowser = true/false: whether to allow browsing the server when a link is inserted
Linkbrowserurl = "browse the server URL when inserting a link
Linkbrowserwindowheight = "link to the target browser window height
Linkbrowserdomainwwidth = "link target browser window width
Plugins = Object Registration plug-in
Pluginspath = "plug-in folder
Showborders = true/false merge border
Skinpath = "skin folder location
Smileycolumns = 12 Number of columns in the graphic operator window
Smileyimages = String Array array of image file names in the graphic character window
Smileypath = "folder path
Smileywindowheight tumbler window height
Smiley1_wwidth tumbler window width
Spellchecker = "iespell/spellerpages"
When startupfocus = true/false is enabled, focus to the editor.
Stylesxmlpath = "sets the location of the XML file that defines the CSS style list
Tabspaces = 4 Number of space characters generated by the tab key
Toolbarcancollapse = true/false: whether to enable or disable the toolbar.
Toolbarsets = the toolbar set can be used for objects.
Toolbarstartexpanded = true/false enable indicates whether to expand a toolbar.
Usebroncarriagereturn = true/false when you press enter, whether to generate a br mark or a P or Div mark
If you do not know where to start, the following process may be useful to you:
Find fckconfig. defaultlanguage = 'en'; change to fckconfig. defaultlanguage = 'zh-cn'; set the default language to simplified Chinese.
Find fckconfig. tabspaces = 0; change to fckconfig. tabspaces = 1; that is, you can use the tab key in the editor.
If your editor is still used at the front-end of the website, for example, for message book or diary reply, you have to consider security. Do not use the default toolbar on the front-end or customize the function, either use the basic defined by the system, that is, the basic toolbar,
Fckconfig. toolbarsets ["basic"] = [
['Bold ', 'italic', '-', 'orderedlist', 'unorderedlist', '-',/* 'link', */'unlink ', '-', 'style', 'fontsize', 'textcolor', 'bgcolor', '-', 'smiley ', 'specialchar', 'replace ', 'preview']
];
This is the basic I changed. I removed the image function and removed the Add link function, because the image and link and flash and image button adding functions allow the front-end page to directly access and upload files, if I don't change it here, I will upload a Trojan to you. Isn't it ready? However, FCKeditor also supports the right-click function in the editing area.
Fckconfig. fontnames = 'arial; Comic Sans MS; Courier New; tahoma; Times New Roman; verdana ';
Add several common fonts fckconfig. fontnames = '; _ gb2312; Arial; Comic Sans MS; Courier New; tahoma; Times New Roman; verdana ';
After upload and upload. asp? Type = XX is changed to type = YY, where YY is the name of the folder where you want to save the file.
If you still want to use your own emoticon icon, jump to row 3 and change the folder address of the emoticon icon and the file name of the emoticon icon below, the three numbers below are the number of emotices displayed on each line and the width and height of the pop-up window. The size depends on the size of the window arranged by the emoticon icon. OK. The change to the total configuration file is complete.
Next, set the editor location. My habit is to put the editor under the root directory, and the five files mentioned at the beginning are also under the root directory (TIPS: it is recommended to put it under the root directory, in addition, we recommend that you use absolute paths, such as "/FCKeditor/", while my usual setting is "/". This is conducive to FCKeditor update and upgrade, in addition, all folders on the website can be called at will. There is no problem where the name of other folders has changed and the editor cannot be used elsewhere.
Open the FCKeditor. asp file and find sbasepath = "/FCKeditor/" to change it to sbasepath = "/"
Open the FCKeditor. js file and find this. basepath = '/FCKeditor/'; change this. basepath = '/';
The default display font in the editor is 12px, while the default font on my home page is 14px, which makes it quite uncomfortable. You can modify the style sheet to meet the requirements, open/Editor/CSS/fck_editorarea.css and change row 4th to font-size: 14px.
The next step is to set the file to be uploaded. This is troublesome. Please perform this operation carefully.
Open \ editor \ filemanager \ browser \ Default \ frmresourcetype.html, find row 15th, and insert "['uploadfile', 'uploadfile']," in combination with fckconfig. in JS, the path of the uploaded file is/uploadfile. Of course, you can change it to the folder you want, but the name here must be the same as fckconfig. in JS, The YY in "type = YY" is consistent.
Before you finish, go to editor \ filemanager \ browser \ Default \ connectors \ ASP and open config. ASP: Change configisenabled = false to configisenabled = true. If you cannot upload files, change configuserfilespath = "/userfile" to configuserfilespath = "/".
Add "set configdeniedextensions = Createobject (" scripting. Dictionary ")"
Configallowedextensions. Add "uploadfile ",""
Configdeniedextensions. Add "uploadfile ",""
Similarly, the settings here also correspond to the above and fckconfig. js.
Another upload function is quick upload. This function is available only in FCKeditor 2.0 and is not available in previous versions. Go to \ editor \ filemanager \ upload \ ASP and open config. ASP, also set configisenabled = false to configisenabled = true, change configuserfilespath = "/userfiles/" to configuserfilespath = "/uploadfile/" & year (date () & "-" & month (date ()) & "/", because my uploaded files are placed in the uploadfile folder and separated by month. Quick upload does not allow you to select folders. Instead, you can directly upload files using the settings here. If the settings are not compatible with the previous settings, your files will be uploaded in a mess, it is inconvenient to manage. Repeat the operations in the previous config. asp file before adding
Configallowedextensions. Add "uploadfile ",""
Configdeniedextensions. Add "uploadfile ",""
Next, let's talk about how to create your own online editor. Here we take ASP as an example:
Test environment: xpsp2, iis5.1, fckeditor2.0
Create a new site on IIS. I directly named it FCKeditor.
Create a site in DW. The test Server is a local machine and supports VBScript.
Create an index. asp page under the root directory of the site, and add the following code in the <body> section (call the editor ):
<%
Dim ofckeditor
Set ofckeditor = new FCKeditor
Ofckeditor. basepath = "/FCKeditor/" // sets the editor path, a directory under the root directory of my site
Ofckeditor. toolbarset = "default"
Ofckeditor. width = "100%"
Ofckeditor. Height = "600 ″
Ofckeditor. value = "" // This is the initial value for the editor.
Ofckeditor. Create "logbody" // the content in the later editor is obtained by this logbody, which is determined by your name.
%>
Do not forget to add <! -# Include file = "FCKeditor/FCKeditor. asp"-> include FCKeditor. asp.
Now you only need to use this editor as a control to extract its data using: Request ("logbody ")
here we recommend an instance, you can refer to modify to the latest version
http://www.jb51.net/codes/23160.html