Today I found a method to modify fckeditor, because its code is too messy, and it is really worse than ewebeditor's ease of use and modifyable type. I only ask for help from netizens' previous modification methods to facilitate modification.
FCKeditor 2.0 version has finally come out. The reason why the word "final" is used is because the popular FLASH insertion function is added to this version. It can be said that among all online editors, FCKeditor is currently the best editor on the Internet. It has powerful functions and supports multiple browsers. It has no platform restrictions. It can be integrated with multiple WEB languages, multi-language support, open source, etc.~~
For a brand new website, FCKeditor can be used directly, without any modifications. However, for most existing websites, some settings of FCKeditor are not suitable for your own use. This article aims to tell you to simply modify FCKeditor to facilitate the use of your website.
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 2.0 folder, and first delete all the folders starting with "_". These folders contain examples or some other tools. In fact, it is enough to only keep the editor folder, , , , , . After the outermost layer is simplified, enter the editor folder and delete the "_source" folder first. 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. Since next I will use my own emoticons and delete them first. Of course, if you want to use the emoticons here, don't delete them. Exit images and enter the lang folder. You can clean up the things here. Only these four files are retained. The first file is the language configuration file. With it, you can set it to the corresponding corresponding language file. It is a simplified Chinese language package. Needless to say, it is from traditional Chinese. How about it? I lost a few hundred K at once, so it's great~
Exit the lang folder and enter the skin folder. If you want to use the default yellow color of fckeditor, then delete the other two folders except the default folder. If you want to use something else, then consider it yourself. But I would like to give you a suggestion. If you don’t want to use the default one, then choose the silver, because silver, that is, gray, will not look ugly when matched with any color. I don’t like the skin of office2003 anyway, and the picture is relatively large, which increases the download time. Don’t!
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. Come one by one, first enter filemanager/browser/default/connectors/. Because I use asp, I delete all except the asp folder. 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 total configuration file of the fckeditor, is located in the root directory. Please follow the list below (the one with fckeditor 2.0 shall prevail):
Find line 20 = 'en'; Change to = 'zh-cn'; Set the default language to Simplified Chinese
Find line 40 = 0; change to = 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 the Default toolbar in the front desk. You either customize the functions or use Basic, which is the basic toolbar that has been defined by the system.
Found line 64:
["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, you will just upload a * to you and won't you finish playing it right away? But this is not enough. Fckeditor also supports the right mouse button function in the edit domain.
Found Line 77:
= 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
Add several fonts we commonly use = '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 change all the following related and related ?Type=XX to Type=YY, where YY is the name of the folder you want to save the file.
If you still want to use your own 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 three numbers below are the number of emoticons displayed in each line and the width and height of the pop-up window. The size of this depends on the size of the window arranged by your emoticon icon. 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 it in the root directory, and it is recommended to use an absolute path when using it, such as "/fckeditor/", while my habit is "/"). This is conducive to the update and upgrading of fckeditor, and all folders under the website can be called arbitrarily, and there is no problem that other folder names change and the editor cannot be used elsewhere.
Open the file and find sBasePath = "/fckeditor/" to sBasePath = "/"
Open the file and find = '/fckeditor/' ; Change to = '/' ;
The default display font in the editor domain is 12px, while the default font of 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 change line 4 to font-size: 14px;.
Next is the setup for uploading files. This is more troublesome, please operate carefully.
Open \editor\filemanager\browser\default\, find line 15, insert " ['uploadfile','uploadfile']," with the settings 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".
Not finished yet, continue to enter editor\filemanager\browser\default\connectors\asp, open it, first change ConfigIsEnabled = False to ConfigIsEnabled = True. If the file is not impossible to upload, then change ConfigUserFilesPath = "/UserFile" to the ConfigUserFilesPath = "/" I want.
Then add it after "Set ConfigDeniedExtensions = CreateObject( "" )
"uploadfile", ""
"uploadfile", ""
Similarly, the settings here must correspond to the above and inside.
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 it, and set ConfigIsEnabled = False to ConfigIsEnabled = True. I changed ConfigUserFilesPath = "/UserFiles/" to what I want ConfigUserFilesPath = "/uploadfile/"& Year(Date())&"-"& Month(Date())&"/" because my upload file is placed in the uploadfile folder and is open to it 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 one before the connection, and add it to the next
"uploadfile", ""
"uploadfile", ""
Next, let’s talk about how to create your own online editor. Here we take ASP and JS versions as examples, ASP version sample code, which is generally used for background operations:
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
= "/"
= "Default"
= "100%"
= "400"
= rs("logbody")
"logbody"
%>
Of course, the ASP version can only be used in pages with .asp as the extension. If you set BasePath to "/" in the previous section, you can save the third line here. The ASP version only has one Create function. It is recommended to use the ASP version when modifying a content.
Next, let’s look at the JS version:
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'logbody' ) ;
= '/' ;
= 'Basic' ;
= '100%' ;
= '400' ;
= '' ;
() ;
</script>
The settings of BasePath are as mentioned above. The JS version can be used in any web page, or even html pages, because it is generated by the client. The advantage is that it can reduce network traffic, because the editor file only needs to be downloaded once, and the second is that it can be defined by the client when it is displayed. Since fckeditor initialization takes a certain amount of time, JS is very useful at this point.
In addition, there is another function function in the JS version, which is the ReplaceTextarea() function, which can replace the specified TextArea and take the reply part of my website's log:
<script type="text/javascript">
<!--
function showFCK(){
var oFCKeditor = new FCKeditor( 'fbContent' ) ;
= '/' ;
= 'Basic' ;
= '100%' ;
= '200' ;
= '' ;
//() ;
() ;
//document.blog_feedback. = '';
document.blog_feedback. = '';
document.blog_feedback. = 'true';
document.blog_feedback. = 'none';
}
//-->
</script>
Write it into a simple function, and the fckeditor is generated when the user displays the editor opens. Without initializing an editor every time the page is refreshed, the page will be much faster.
FCKeditor 2.0 version has finally come out. The reason why the word "final" is used is because the popular FLASH insertion function is added to this version. It can be said that among all online editors, FCKeditor is currently the best editor on the Internet. It has powerful functions and supports multiple browsers. It has no platform restrictions. It can be integrated with multiple WEB languages, multi-language support, open source, etc.~~
For a brand new website, FCKeditor can be used directly, without any modifications. However, for most existing websites, some settings of FCKeditor are not suitable for your own use. This article aims to tell you to simply modify FCKeditor to facilitate the use of your website.
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 2.0 folder, and first delete all the folders starting with "_". These folders contain examples or some other tools. In fact, it is enough to only keep the editor folder, , , , , . After the outermost layer is simplified, enter the editor folder and delete the "_source" folder first. 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. Since next I will use my own emoticons and delete them first. Of course, if you want to use the emoticons here, don't delete them. Exit images and enter the lang folder. You can clean up the things here. Only these four files are retained. The first file is the language configuration file. With it, you can set it to the corresponding corresponding language file. It is a simplified Chinese language package. Needless to say, it is from traditional Chinese. How about it? I lost a few hundred K at once, so it's great~
Exit the lang folder and enter the skin folder. If you want to use the default yellow color of fckeditor, then delete the other two folders except the default folder. If you want to use something else, then consider it yourself. But I would like to give you a suggestion. If you don’t want to use the default one, then choose the silver, because silver, that is, gray, will not look ugly when matched with any color. I don’t like the skin of office2003 anyway, and the picture is relatively large, which increases the download time. Don’t!
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. Come one by one, first enter filemanager/browser/default/connectors/. Because I use asp, I delete all except the asp folder. 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 total configuration file of the fckeditor, is located in the root directory. Please follow the list below (the one with fckeditor 2.0 shall prevail):
Find line 20 = 'en'; Change to = 'zh-cn'; Set the default language to Simplified Chinese
Find line 40 = 0; change to = 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 the Default toolbar in the front desk. You either customize the functions or use Basic, which is the basic toolbar that has been defined by the system.
Found line 64:
Copy the codeThe code is as follows:
["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, you will just upload a * to you and won't you finish playing it right away? But this is not enough. Fckeditor also supports the right mouse button function in the edit domain.
Found Line 77:
= 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
Add several fonts we commonly use = '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 change all the following related and related ?Type=XX to Type=YY, where YY is the name of the folder you want to save the file.
If you still want to use your own 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 three numbers below are the number of emoticons displayed in each line and the width and height of the pop-up window. The size of this depends on the size of the window arranged by your emoticon icon. 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 it in the root directory, and it is recommended to use an absolute path when using it, such as "/fckeditor/", while my habit is "/"). This is conducive to the update and upgrading of fckeditor, and all folders under the website can be called arbitrarily, and there is no problem that other folder names change and the editor cannot be used elsewhere.
Open the file and find sBasePath = "/fckeditor/" to sBasePath = "/"
Open the file and find = '/fckeditor/' ; Change to = '/' ;
The default display font in the editor domain is 12px, while the default font of 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 change line 4 to font-size: 14px;.
Next is the setup for uploading files. This is more troublesome, please operate carefully.
Open \editor\filemanager\browser\default\, find line 15, insert " ['uploadfile','uploadfile']," with the settings 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".
Not finished yet, continue to enter editor\filemanager\browser\default\connectors\asp, open it, first change ConfigIsEnabled = False to ConfigIsEnabled = True. If the file is not impossible to upload, then change ConfigUserFilesPath = "/UserFile" to the ConfigUserFilesPath = "/" I want.
Then add it after "Set ConfigDeniedExtensions = CreateObject( "" )
"uploadfile", ""
"uploadfile", ""
Similarly, the settings here must correspond to the above and inside.
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 it, and set ConfigIsEnabled = False to ConfigIsEnabled = True. I changed ConfigUserFilesPath = "/UserFiles/" to what I want ConfigUserFilesPath = "/uploadfile/"& Year(Date())&"-"& Month(Date())&"/" because my upload file is placed in the uploadfile folder and is open to it 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 one before the connection, and add it to the next
"uploadfile", ""
"uploadfile", ""
Next, let’s talk about how to create your own online editor. Here we take ASP and JS versions as examples, ASP version sample code, which is generally used for background operations:
Copy the codeThe code is as follows:
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
= "/"
= "Default"
= "100%"
= "400"
= rs("logbody")
"logbody"
%>
Of course, the ASP version can only be used in pages with .asp as the extension. If you set BasePath to "/" in the previous section, you can save the third line here. The ASP version only has one Create function. It is recommended to use the ASP version when modifying a content.
Next, let’s look at the JS version:
Copy the codeThe code is as follows:
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'logbody' ) ;
= '/' ;
= 'Basic' ;
= '100%' ;
= '400' ;
= '' ;
() ;
</script>
The settings of BasePath are as mentioned above. The JS version can be used in any web page, or even html pages, because it is generated by the client. The advantage is that it can reduce network traffic, because the editor file only needs to be downloaded once, and the second is that it can be defined by the client when it is displayed. Since fckeditor initialization takes a certain amount of time, JS is very useful at this point.
In addition, there is another function function in the JS version, which is the ReplaceTextarea() function, which can replace the specified TextArea and take the reply part of my website's log:
Copy the codeThe code is as follows:
<script type="text/javascript">
<!--
function showFCK(){
var oFCKeditor = new FCKeditor( 'fbContent' ) ;
= '/' ;
= 'Basic' ;
= '100%' ;
= '200' ;
= '' ;
//() ;
() ;
//document.blog_feedback. = '';
document.blog_feedback. = '';
document.blog_feedback. = 'true';
document.blog_feedback. = 'none';
}
//-->
</script>