Ckeditor (2) online editor ckeditor_PHP tutorial

Source: Internet
Author: User
Online editor Ckeditor (2): Online editor ckeditor. Online editor Ckeditor (2): the online editor ckeditor is connected to the previous 3in-page configuration, on the page using Ckeditor for direct configuration, configure the customization mode. Features: Online editor Ckeditor (2), online editor ckeditor

Next

3 in-page configuration, which is directly configured on the Ckeditor interface

Page configuration

Customization method

Features

Description

Priority

Interface functions

Flexible and reusable

Every page using the editor must write code once.

Highest

Overwrite the parameters in the custom and system configuration files

Custom configuration file

Flexible and reusable

You can define multiple custom configuration files based on the scenario and reference different configuration files on different pages.

Moderate

Override parameters in the system configuration file

System configuration file

Not flexible

Global, affecting all programs

Lowest

The above has implemented the online text editing function, but does not implement the file management function.

Cause: ck separates online editing from file management. To implement file management, you must use ckfinder

Ckfinder installation

The steps are exactly the same as those of Ckeditor.

Ckfinder file directory

Use Ckfinder

To load the use of ckfinder in the Ckeditor configuration item, load several static pages and manage user files

Load in a custom configuration file

Effect

However, Ckfinder does not allow users to upload files by default.

Open permission for modifying configuration files

Find the config. php file to open the permission

Modify permissions and open all permissions

Effect

The preceding path has a problem.

Modify the file upload path

Find and modify the path in config. php

Modify Path

Effect

Modify the file upload directory structure

The directory structure cannot be a single folder of a certain file type. The structure of the folder should be determined based on the amount of file uploads. Year/Month/Day

Modify the file shelf structure in config. php

Modify structure

Effect

During the file upload process, if the file name is Chinese or special characters, the system cannot handle the problem. after the file is uploaded, garbled characters will appear. You need to rename the file after the file is uploaded.

Ckfinder does not provide a mechanism for duplicate names.

How to implement it? Modify the source code.

Rename a file

Source code file path

Adds a function to obtain random names.

Where can I call this function? How to use it?

Effect

The current file manager can add, delete, modify, and query files on the server on the browser side. this is dangerous and absolutely not allowed.

Control user permissions

Control user operations on server files

Config. php can control file permissions.

Modify

Effect

Permission required for file Upload

Ckeditor content submission

2. submit data after editing

3. PHP receives data and needs to escape the data, addslashes

4. output data, which needs to be reversed. stripslashes

Example (2): the online editor ckeditor is connected to the previous 3 in-page configuration. on the Ckeditor page, you can directly configure the features of the customization mode on the configuration page...

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.