I am using asp. FCKeditor is not helpful. There are a lot of information below Google online, but it is not very complete. It is not suitable for newbies who have just started. Through my half-day experience, I have done some sorting to facilitate everyone's learning. It is the latest FCKeditor version 2.3.1
Official website download: http://ckeditor.com/download [It is recommended to download the latest version directly on the official website]
Let's start using it below:
The first job is to streamline this large-scale editor, of course, it is to streamline files rather than functions. Here I take the asp version of FCKeditor as an example, enter the FCKeditor folder, and first delete all the folders starting with _. These folders contain examples or some other tools. In fact, it is just to keep editor folders, fckconfig.js, fckeditor.asp, fckeditor.js, fckstyles.xml, and fcktemplates.xml. After the outermost layer is simplified, enter the editor folder and first put it in the _ Source folder delete, here are some source files, which are of no use for use.
Enter the images folder and delete the smiley folder. Some files are placed with emoticons. If you want to use the emoticons here, don’t delete them. If you want to change your own, delete them. But I think it’s better to use your own emoticons. There are many pictures with personality now. Exit images and enter the lang folder. You can clean up the things here, fcklanguagemanager.js (the latest version does not have this file), zh-cn.js, en.js, and zh.js. The first one A file is a language configuration file. With it, it can be used to match the settings in fckconfig.js to the corresponding language file. zh-cn.js is a simplified Chinese language package, en.js is English, and zh.js is traditional Chinese of.
Then exit the lang folder and enter the skin folder. The default folder is the default yellow color. Silver is silver, which means that gray will not look ugly when matched with any color. The skin of Office2003 is not very good, so it is not recommended. If you want to use it, the easiest way is to copy the contents of your favorite folder to the default folder...
The last step to simplify it is to exit the skin folder and then enter filemanager. If you are not using the latest version of fckeditor, then there is a folder browser here, and the new version also has an upload folder. First enter filemanager/browser/default/connectors/, except for the asp folder (if your web page is other such as PHP, leave the corresponding php folder, and so on), and delete it all. Then go to filemanager/upload/, and then leave only the asp folder. At this point, the editor simplification has ended. Next, we will make settings and modifications to the editor.
The first modified file, which is the fckeditor total configuration file, is located in the fckconfig.js file in the root directory. Configuration options:
AutoDetectLanguage=true/false Automatic detection language
BaseHref= The base address of the relative link
ContentLangDirection=ltr/rtl Default text direction
ContextMenu=String array, right-click menu content
CustomConfigurationsPath= Custom configuration file path and name
Debug=true/false Whether to enable the debugging function, so that when FCKDebug.Output() is called, the content will be output in the debug window.
DefaultLanguage= Default Language
EditorAreaCss= Stylesheet file in the edit area
When EnableSourceXHTML=true/false is TRUE, when switching from the visual interface to the code page, the HTML is processed into XHTML
EnableXHTML=true/false Whether to allow 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 displaying the color picker
FontFormats= Sets the name displayed in the text format list
FontNames= Font name in the font list
FontSizes= List of font sizes in font size
ForcePasteAsPlainText=true/false Force paste as plain text
ForceSimpleAmpersand=true/false Whether to convert the & symbol to XML entity
FormatIndentator= Characters used when indenting the code in the source code format
FormatOutput=true/false Whether to automatically format the code when outputting content
FormatSource=true/false Whether to automatically format code when switching to code view
FullPage=true/false Whether to allow editing of the entire HTML file, or only editing content between BODYs
GeckoUseSPAN=true/false Whether to allow SPAN tags to replace B, I, U tags
IeSpellDownloadUrl=Website for downloading spellchecker
ImageBrowser=true/false Whether to allow browsing server functions
ImageBrowserURL= The URL that runs when browsing the server
ImageBrowserWindowHeight= Image Browser Window Height
ImageBrowserWindowWidth= Image Browser Window Width
LinkBrowser=true/false Does it allow browsing the server when the link is inserted
LinkBrowserURL= URL of the browsing server when inserting a link
LinkBrowserWindowHeight=link target browser window height
LinkBrowserWindowWidth=link target browser window width
Plugins=object Register plugin
PluginsPath= Plugin folder
ShowBorders=true/false Merge borders
SkinPath= Skin folder location
SmileyColumns=12 Number of columns in the figure window
SmileyImages=Array of image filenames in character array
SmileyPath=chart folder path
SmileyWindowHeight Window Height
SmileyWindowWidth symbol window width
SpellChecker=ieSpell/Spellerpages Set up the spellchecker
StartupFocus=true/false FOCUS to the editor when enabled
StylesXmlPath= Set 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 allow expansion/collapse toolbar
ToolbarSets=object Allows the use of TOOLBAR collections
ToolbarStartExpanded=true/false Is it true that TOOLBAR is expanded?
UseBROnCarriageReturn=true/false When entering, is it a BR mark or a P or DIV mark?
If you don't know where to start, check out the following process might 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 domain.
If your editor is still used in the front desk of the website, such as when using a message book or a diary reply, you have to consider security. Don’t use Default toolbar in the front desk, either customize the function or Use Basic, which 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 have changed. Remove the image function and the link function, because the image and link, the flash and image button addition functions can allow the front desk page to directly access and upload files. If you don't change here, just upload a Trojan horse to you. Not finishing the game right away? But this is not enough. Fckeditor also supports the right mouse button function in the edit domain.
FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
Add several fonts that we commonly use FCKConfig.FontNames = 'Song font; bold font; official script; Kai font_GB2312; Arial; Comic Sans MS; Courier New; Tahoma; Times New Roman; Verdana'; ;
Next, we will set up the upload function. Take ASP as an example. In fact, the default fck is asp. Just delete all commented codes below 100 lines, and then add all the browser.html and upload below. Change the ?Type=XX after .asp to Type=YY, where YY is the name of the folder you want to save the file.
If you still want to use your emoticon icon, then jump to line 131 and change the folder address of the emoticon icon and the file name of the emoticon icon below. The following three numbers are the number of emoticons displayed in each line and The width and height of the pop-up window are as wide and high as the size of this window depends on the size of the window arranged by your emoticon icons. OK, the total configuration file modification has ended.
Next is the setting of the editor location. My habit is to place the editor in the root directory, and the five files mentioned at the beginning are also placed in the root directory (Tips: It is recommended to place them in the root directory, and it is recommended to set them when using them. The path also uses an absolute path, such as /fckeditor/, and my habit is set to /), which is conducive to the update and upgrade of fckeditor, and all folders under the website can be called arbitrarily, and no other folder names have changed and other There is no problem with the editor being used.
Open the fckeditor.asp file and find sBasePath = /fckeditor/change to sBasePath = /
Open the fckeditor.js file and find this.BasePath = '/fckeditor/' ; Change to this.BasePath = '/' ;
The default display font in the editor domain is 12px, while the default font on my home page is 14px, so it feels very uncomfortable to look at it. If you want to modify it, you can achieve the requirements by modifying the style sheet. Open /editor/css/fck_editorarea.css and turn it into Change the 4th line to font-size: 14px;
Next is the setup for uploading files. This is more troublesome, please operate carefully.
Open /editor/filemanager/browser/default/frmresourcetype.html, find line 15, insert ['uploadfile','uploadfile'], and cooperate with the settings in fckconfig.js just now, then my upload file path is /uploadfile Of course you can also change it to the folder you want, but the name here must be consistent with the YY in Type=YY in fckconfig.js.
Not finished yet, continue to enter editor/filemanager/browser/default/connectors/asp, open config.asp, first change ConfigIsEnabled = False to ConfigIsEnabled = True. If the file is not impossible to upload, then change ConfigUserFilesPath = /UserFile to I want ConfigUserFilesPath = /.
Then add it after Set ConfigDeniedExtensions = CreateObject( Scripting.Dictionary )
ConfigAllowedExtensions.Add uploadfile,
ConfigDeniedExtensions.Add uploadfile,
Similarly, the settings here must correspond to the above and in fckconfig.js.
There is another upload, which is a quick upload. This function is only available in fckeditor 2.0. Previous versions did not have this function. Enter /editor/filemanager/upload/asp, open config.asp, and set ConfigIsEnabled = False to ConfigIsEnabled = True. I changed ConfigUserFilesPath = /UserFiles/ to the ConfigUserFilesPath = /uploadfile/& Year (Date()) &-& Month(Date()) &/, because my upload file is placed in the uploadfile folder and is open to the public by month. Quick upload will not allow you to select a folder, but will be uploaded directly through the settings here. If the settings here are not well matched with the previous settings, your files will be uploaded in a mess and inconvenient to manage. Repeat the operation in the previous config.asp before connecting, and add it to the following
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 named it FCKeditor directly
Establish a corresponding site in DW, the test server is native, and supports VBScript
In the root directory of the site, create a new index.asp page, and add the following code in the <body> segment (call the editor):
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = /FCKeditor/ //Set 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 //In the future, the content in the editor will be obtained by this logbody, and the naming will be determined by you.
%>
If you add this paragraph, don't forget to include <!–#include file=FCKeditor/fckeditor.asp -> in the first line before index.asp.
Now you just use this editor as a control and use: request(logbody) when extracting its data: