Fckeditor USING Guide

xiaoxiao2021-03-17  220

FCKEDITOR 2.0 settings. Modify. Using form: http://www.blueidea.com/tech/program/2005/2691.asp

The FCKEDITOR version 2.0 is finally coming out, and the word "finally" is because of the Flash insert function returned by the expedition on this version. It can be said that in all online editors, FCKEditor is the best editor on the Internet, powerful, supporting a variety of browsers, no platform restrictions, can be integrated with a variety of web languages, multi-language support, open source, etc. ~~

For a brand new website, Fckeditor can take it directly, do not need to modify it. But for the vast majority of existing websites, some settings of FCKEDITOR are not suitable for their use. This article is designed to tell you simple modifying Fckeditor to make it easy for your website.

The first job is to streamline this functional editor. Of course, the file is streamlined and non-functional. Here I take the ASP version of FcKeditor as an example, enter the Fckeditor 2.0 folder, first delete the folder starting with "_", and put an example or some other tools in these folders. In fact, it is only to retain Editor folder, fckconfig.js, fckeditor.asp, fckeditor.js, fiqustyles.xml, fcktemplates.xml is OK, the outermost layer is complete, enter the Editor folder, first " _Source "folder delete, here is some source files, nothing to use for use.

Enter the image folder, delete the Smiley folder, some files are in the emoticon icon, because I will use my own expression icon, first put their delete, of course, if you want to use the expression icon here, don't delete Lost. Exit Images and then enter the lang folder. The things here can be cleaned, only the four files of fcklanguagemanager.js, zh-cn.js, en.js, en.js, the first file is language configuration File, there is it to set the corresponding language files in the FCKConfig.js, en-cn.js is a Simplified Chinese language package, en.js don't have to say it, zh.js is traditional Chinese. how about it? I have a few hundred k, cool ~

Exit the Lang folder, enter the Skin folder, if you want to use the Fckeditor's default, you will delete the other two folders except the Default folder. If you want to use, you will consider yourself. , But I will give you a suggestion. If you don't want to use the default, then choose the Silver, because the silver is gray and any color, it will not be ugly, and the Office2003's skin, I am very disceral, I am very disceral. And the picture is relatively large, but also adds download time, don't!

Streamlined final step, exiting the Skin folder, then enter the fileManager, if you are not the latest version of FCKEDITOR, here a folder Browser, the new version has a UPLOAD folder. One comes, first enters FileManager / Browser / Default / Connectors / under, because I use the ASP, so all delete except the ASP folder. Then enter FileManager / UPLOAD / under, similarly, leaving only the ASP folder, to this, the editor is over, then, we set the editor to modify. The first modified file, that is, the FCKEDITOR total configuration file, located in the root directory of the fckconfig.js file. Please do according to the list below (take the fckeditor version 2.0):

Find the 20th row fckconfig.defaultlanguage = 'en'; change to fckconfig.defaultLanguage = 'zh-cn'; set the default language to find the 40th line fckconfig.tabspaces = 0; change to fckconfig.tabspaces = 1; Tab keys can be used in the editor domain.

If your editor is still in front desk at the website, for example, when you use it for a message or a diary reply, then you have to consider safe, don't use the default Toolbar in the front desk, or customize the function, or Basic that has been defined with the system, which is the basic Toolbar, found 264th line:

FCKCONFIG.TOOLBARSETS ["Basic"] = [['bold', 'italic', '-', 'ordeldlist', 'unorderedList', '-', / * 'link', * / 'unlink', '-' , 'Style', 'Fontsize', 'TextColor', 'BGColor', '-', 'Smiley', 'Specialchar', 'Replace', 'Preview']];

This is the BASIC I have changed, remove the image function, remove the added link function, because the image and links and the flash and image buttons add functions to allow the front page directly to access and upload files, if you don't change it directly to you upload a Trojan Still not to have? But light does not work, Fckeditor also supports the right mouse button in the editing domain.

Find line 77:

FCKCONFIG.FONTNAMES = 'Arial; COMIC SANS MS; Courier New; Tahoma; Times New Roman; Verdana';

Couple with several common fonts fits fiquconfig.fontnames = 'Song; black body; Lishu; 体 _GB2312; Arial; COMIC SANS MS; Courier New; Tahoma; Times New Roman; Verdana';

Next, set up the upload function, or as an example, in fact, the FCK default is ASP, put all the annotated code below 100 lines, then all about Browser.html and Upload .ASP's back? Type = XX is changed to type = yy, where yy gives you a folder name for saving the file. And if you want to use your emoticon icon, then you jump to 131 line, change the folder address of that expression icon, and the file name of the following expression icon, then the three numbers below are the number of expressions per line. The width and high of the pop-up window, this size is based on the size of the window arranged in your expression icon. OK, the total configuration file has ended.

Next is the setting of the editor location, my habit is to put Editor in the root directory, and the five files that are the most begins are also placed in the root directory (TIPS: Recommended in the root directory, and recommended when using The path also uses an absolute path, such as "/ fckeditor /", and my habits are "/"), which is conducive to the update upgrade of Fckeditor, and all folders under the site can be invoified, there is no other folder name The problem of the editor can not be used without other places.

Open the fckeditor.asp file, find SBasePath = "/ fckeditor /" to change to SBasePath = "/" Open the fckeditor.js file, find this.basepath = '/ fckeditor /'; change to this.basepath = '/';

The default display font in the editor domain is 12px, and my homepage default font is 14px, so it is very uncomfortable, I want to modify, you can reach the requirements by modifying the style sheet, open /Editor/css/fck_editorarea.css, put The fourth line is changed to Font-size: 14px;

Next is the setting of the upload file, this is more troublesome, please worry carefully.

Open /Editor/filemanager/Browser/default/frmresourceType.html, find line 15, insert "['UPLOADFILE', 'UPLOADFILE']," The settings you just in fckconfig.js were set, then my upload file path is / uploadfile, of course, you can also change to the folder you want, but the name here must be unanimously line with YY in the "Type = YY" in fckconfig.js.

Haven't finished it, continue to enter Editor / FileManager / Browser / Default / Connector / ASP, open config.asp, first change configisenabled = false to configisenabled = true, or not upload file, then put configuserfilespath = "/ userfile" Change into configuserfilespath = "/" I want. Then add configallowedextensions.add "UploadFile", "" UPLOADEXTENSIS. "" "," "", "UPLOADEXTENSIS IN", "UPLOADEXTENSISIS." "

Similarly, the settings here are also to be corresponding to the above and FCKCONFIG.JS.

There is also an upload, it is to upload, this function is in FcKeditor 2.0, the previous version does not have this feature. Enter / editor / filemanager / upload / asp, also open config.asp, and also set configisenabled = false to configisenabled = true, I will change configUserfilespath = "/ userfiles /" to the configuserfilespath = "/ UploadFile / "& Year (Date ()) &" - ​​"" Because my upload file is placed under the UPLoadFile folder and is put on a monthly basis. Quick upload, will not let you choose a folder, but through the settings here, if you don't work with the previous settings, your file will be uploaded, you will be messy, it is very inconvenient to manage. Take the operation in the previous config.asp in front, add

Configallowedextensions.add "UploadFile", "" configdeniedextensions.add "UploadFile", ""

Next, let's talk about how to create your own online editor, here as an example of ASP and JS, ASP version code, generally used for background operations:

<% DIM OFCKEDITORSET OFCKEDITOR = new fckeditorofckeditor.basepath = "/"

OFCKEDITOR.TOOLBARSET = "default" OFCKEDITOR.WIDTH = "100%" OFCKEDITOR.HEIGHT = "400"

OFCKEDITOR.VALUE = RS ("logbody") OFCKEDITOR.CREATE "logbody"%>

The ASP version, of course, can only be used in the page with .asp is the extension page, if you set the basepath as "/" in FcKedito.as, you can save the third line, the ASP version is only A CREATE function. It is recommended to use ASP version when modifying an article.

Next, look at the JS version: