


About the field processing function of imperial CMS6.0 function decryption
Jun 12, 2020 pm 03:07 PMThe following tutorial column of Empire cms will introduce to you the field processing function of CMS6.0 function decryption. I hope it will be helpful to friends in need!
Foreword:
When adding/modifying fields, you can set the "Backend Add Information Processing Function", "Backend Modify Information Processing Function", "Foreground Add Information Processing function" and "Foreground modification information processing function" can respectively set functions for processing field content. They are often used for models that have special requirements for the storage format of field content. Today we will briefly explain the processing function production format.
Basic setup steps:
1. Write the processing function;
2. Copy the function to e/class/userfun.php In the file content;
3. Modify the field setting processing function name.
Field processing function format:
1 2 3 |
|
Parameter description:
user_FieldFun: function name
$mid: system model ID
$ f: Field name
$isadd: When the value is 1, it is to add information; when the value is 0, it is to modify information
$isq: When the value is 0, it is background processing; when the value is 1, it is Foreground processing
$value: Original content of the field
$cs: Additional parameters of the field, parameter content set at the field processing function
Example of field processing function:
Example 1: Automatically add the words "[EmpireCMS]" in front of the title
Backend field function settings: user_AddTitle
1 2 3 4 |
|
Example 2: The title content is a combination of writer and befrom fields
Background field function settings: user_TogTitle
Title field displays HTML code:
(Description: Because the title is required, an initial value must be given so that the content will not be empty)
1 2 3 4 |
|
Example 3: Upload images and automatically generate thumbnails
Background field function settings: user_TranImgAuto## 170,120
(Note: The background parameter 170 represents the thumbnail width, and 120 is the thumbnail height)
The upload image field displays the HTML code:
(Note: The variable name uses "field name" imgrs, which corresponds to the "$filetf" variable in the function)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
The processing function can achieve a lot The above are just a few simple examples of very complex field content storage format requirements, and more need to be practiced by users.
For more Empire cms technical articles, please visit the Empire cms secondary development column!
The above is the detailed content of About the field processing function of imperial CMS6.0 function decryption. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
