Online editor Ckeditor (2), online editor ckeditor_PHP tutorial

WBOY
Release: 2016-07-13 09:52:57
Original
909 people have browsed it

Online editor Ckeditor (2), online editor ckeditor

Continued from the previous article

3 in-page (in-page) configuration, configure directly in the interface using Ckeditor

In-page configuration

Online editor Ckeditor (2), online editor ckeditor_PHP tutorial

Customization method

Features

Description

Priority

Interface function

Flexible and cannot be reused

Every page using the editor needs to be written once

Highest

Override parameters in custom and system configuration files

Custom configuration file

Flexible and reusable

Multiple custom configuration files can be defined according to usage scenarios, and different configuration files can be referenced in different pages

Medium

Override parameters in system configuration file

System configuration file

Inflexible

Global nature, affecting all programs

Minimum

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

Reason: ck separates online editing and file management. If you want to implement file management, you must use ckfinder

Ckfinder installation

Exactly the same steps as Ckeditor

Ckfinder file directory

Use Ckfinder

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

Load in customized configuration file

Effect

However, because Ckfinder does not allow users to upload files by default, they do not have permission to upload files

Modify configuration file

Permissions open

Find the config.php file to open permissions

Modify permissions and open all permissions

Effect

There is a problem with the above path

Modify file upload path

Find the path in config.php and modify it

Modify path

Effect

Modify the file upload directory structure

The directory structure cannot be a single folder under a certain file type. The folder structure should be determined appropriately 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 in Chinese or special characters, the system cannot process it. After uploading, garbled characters will appear. The file needs to be renamed after it is uploaded.

Ckfinder does not provide a mechanism for duplicate names.

How to achieve it? Modify the source code.

Implement file renaming

Source code file path

Add a new function to get random names

Where to call this function? How to use?

Effect

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

Control user permissions

Control user operations on server-side files

File permissions can be controlled in config.php.

Modify

Effect

Permissions that must be opened for file upload

Ckeditor edit content submission

2 Submit data after editing

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

4 Output data, needs to be reversed, stripslashes

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1005208.htmlTechArticleOnline editor Ckeditor (2), online editor ckeditor continues from the previous article 3 in-page (in-page) Configuration, perform direct configuration in the interface using Ckeditor. Features of on-page configuration customization...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template