Methods and FCKeditor skills for zblog topic line breaks

Source: Internet
Author: User

Zblog uses the FCKeditor editor. Although I have been using the FCKeditor for three years, I have only used common functions, such as inserting images and flash files, in bold, italics, underscores, color variations, and table insertion. I also know that pressing the Enter key is a segmentation.

In fact, the FCKeditor basically provides all the functions required for Article editing, but some functions are hidden and we did not find them.

The line break was originally typed in this way.

Two days ago, when I wrote an article on zblog, I had to segment, but accidentally pressed the "Shift + Enter" combination key. I found that it was not a segment but a line break! The Delimiter is

 

The line break is
.

 

For a moment, I felt that I had no time to work, because I never knew how to break a line break before. I also blame FCKeditor for this, because when I want to change the line, I have to manually edit the html code.

Dedecms also uses FCKeditor

It is observed that dedecms uses the FCKeditor by default. The method is the same as that in zblog. For line breaks, press the "Shift + Enter" combination key and press the "Enter" Key separately to segment.

Guide: zblog Document Automatic Generation of digest length modification method

Common FCKeditor skills

I checked out the FCKeditor usage introduction and found that FCKeditor has many usage skills that we don't know.

 

1. default language
Open the fckconfig. js file (the same as the FCKeditor folder), change the automatic detection language to not detect, and change the default language to simplified Chinese:
Program code
FCKConfig. AutoDetectLanguage = false; FCKConfig. DefaultLanguage = 'zh-cn ';

2. Font list
Open the fckconfig. js file and add the frequently used "; _ GB2312" to the font list ":
Program code
FCKConfig. FontNames = '; _ GB2312; Arial; Comic Sans MS; Courier New; Tahoma; Times New Roman; Verdana ';

3. File Upload
The file management program of FCKeditor is in the filemanager folder and can be divided into browser and upload. Browsing refers to browsing server files, selecting them, or uploading local files to the server. Uploading refers to quick upload. In the window, click the "Upload" tab to open it, similar to the UBB editor we use, select a local file and upload it.
That is to say, FCKeditor has a file browsing and two files are uploaded. Some of these settings are in one file, while others are in multiple files. It's complicated and there are many changes. Let's talk about it in a few moments.

① Open and close the file browsing and uploading Functions
There are three files related to this switch. One is a js file and the other is an asp file. when the former is disabled, no related windows or buttons are displayed on the interface, and the latter is disabled and related functions are unavailable. The first is the fckconfig. js file. The following content is set to true and false to off.
Upload in file browsing and browsing:
Program code
FCKConfig. LinkBrowser = false;
FCKConfig. ImageBrowser = false;
FCKConfig. FlashBrowser = false;

Quick file upload:
Program code
FCKConfig. LinkUpload = true;
FCKConfig. ImageUpload = true;
FCKConfig. FlashUpload = true;

Set two asp files:
Editor \ filemanager \ browser \ default \ connectors \ asp \ config. asp
Program code
ConfigIsEnabled = False
Indicates that file browsing is disabled.

Editor \ filemanager \ upload \ asp \ config. asp
Program code
ConfigIsEnabled = True
Indicates that files are uploaded and opened quickly.

② File Upload or browsing path settings
Note that FCKeditor does not support virtual directories. All your paths are absolute paths for the root directory of the website, it is not convenient for developers to publish to remote website directories. In this case, the WinXP system can only have one site, and only use virtual directories to represent different websites. After testing locally, you must temporarily change this setting before uploading.
Open the file editor \ filemanager \ browser \ default \ connectors \ asp \ config. asp:
Program code
ConfigUserFilesPath = "/attachments /"

In the quick upload path, open the file editor \ filemanager \ upload \ asp \ config. asp:
Program code
ConfigUserFilesPath = "/attachments /"

My file directory is under http: // 127.0.0.1/temp. If you test the website locally in the virtual directory xxx, set it:
Program code
ConfigUserFilesPath = "/127.0.0.1/temp /"

③ A source file BUG for Fast File Upload
After the preceding settings are complete, you can smoothly upload files during file browsing and browsing, but you will find that "quick upload" is unavailable. After selecting a local file, click "upload to server" without any response. This is because of a bug in the fckconfig. js file.
Open the fckconfig. js file, replace the FCKConfig. QuickUploadLanguage with _ QuickUploadLanguage, and replace it with three places in total. The former is used without definition, so there is a mistake. The Code intent should be the same as the latter value.

④ Automatic renaming of uploaded file names
FCKeditor does not support Chinese file names, so we need to change the name when saving the file to the server. Because there are two parts to be uploaded, and the files used are different, the two files should be modified at the same time. Let's take a look at the files to be uploaded quickly and open editor \ filemanager \ upload \ asp \ upload. asp: Add the following functions at the end of the file:
Program code
Public Function GetNewFileName ()
Dim ranNum
Dim dtNow
DtNow = Now ()
Randomize
RanNum = int (90 * rnd) + 10
GetNewFileName = year
(DtNow) & right ("0" & month (dtNow), 2) & right ("0" & day (dtNow), 2) & right ("0" & hour (dtNow), 2) & right ("0" & minute (dtNow), 2) & right ("0" & second (dtNow ), 2) & ranNum
End Function

We use the year, month, day, hour, minute, and two random numbers as the file name, so that we can identify the File Upload time, and it is not easy to duplicate the name.
Then the file is still located. Find:
Program code
'Get the uploaded file name.
SFileName = oUploader. File ("NewFile"). Name

Change it:
Program code
'Get the uploaded file name.
SFileName = GetNewFileName () & "." & split (oUploader. File ("NewFile"). Name ,".")

The above is a fast upload file, while the upload in the file browsing is to change another file (editor \ filemanager \ browser \ default \ connectors \ asp \ commands. asp), the modification method is the same as the above file: Add a function and modify a line of code.

Please note that seo811 Forum www.seo811.com is reprinted

 

Related Article

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.