Continued from the previous article
3 in-page (in-page) configuration, configure directly in the interface using Ckeditor
In-page configuration
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
Exactly the same steps as Ckeditor
Ckfinder file directory
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
Find the config.php file to open permissions
Modify permissions and open all permissions
Effect
There is a problem with the above path
Find the path in config.php and modify it
Modify path
Effect
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.
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 operations on server-side files
File permissions can be controlled in config.php.
Modify
Effect
Permissions that must be opened for file upload
2 Submit data after editing
3 PHP receives data and needs to escape the data, addslashes
4 Output data, needs to be reversed, stripslashes