1. Template calling
For example, in a template, if you want to call the content in another template, you can use the following statement:
{template xxx}
Suppose that a new template named "abc.htm" is created. When the background template is edited, it will only be displayed as "acb". If you need to call it in the index, then add {template abc} to the appropriate position in the index and it will be automatically used.
Related examples: In the index template, there is {template header} at the top and {template footer} at the bottom.
Related questions:
Then in this abc template, there needs to be
$discuz_userss: {langlogo ut}
--- If there is $maxpmnum, the following information will be displayed, otherwise it will not be displayed (Judgment 2)
| {lang pm }
--- Ended this judgment (judgment 2)
| {lang memcp}
--- If $adminid is within the range of 1,2,3 , that is, the following information will be displayed, otherwise it will not be displayed (Judgment 3)
| {lang admincp}
--- Ended this judgment (Judgment 3)
--- If $discuz_uid cannot be obtained, the following information will be displayed
{lang guest}: {lang register}
| {lang login}
--- End this judgment (judgment 1)
This is a loop statement, which will automatically end until the data is output.
Through these syntaxes, the same series of data can be displayed in a loop.
Related examples:
Copy content to the clipboard in
--- Loop 2 starts, judge the plug-in module
| $module[url]
--- End loop 2
--- End loop 1
In the template , you often see statements like {lang xxx}. It is used to call words in the language package.
Most of the things that are called in templates are templates.lang.php.
Let’s take a look at the structure of the language pack:
-- Announce the start of the php language
$language = array
( --- The above announcement is the start of the language pack definition
'title' => 'title',
Call characters to display text
'never' => 'Never',
Call the character to display text
....
); --- Declare the end of the language package definition
?> -- Declare the end of the php language
Related examples:
Suppose we add a language call, Add
'abc' => 'This is a test language call' in the line above
'title' => 'Title',
The last one is indispensable, as well as the calling characters and display text, both Must be quoted using ''.
After adding it, you can call it in the template. Write {lang abc} in the template
Then it will be displayed directly: This is a test language call
Special note: After adding a language or modifying a language package, the cache must be updated oh!
5. Style Parameter Calling
The statements {XXXXX} are often seen in templates. {} must be in uppercase letters.
These are the parameters in the calling style color scheme. You can add it yourself, the method is as follows:
1. Enter the interface style-> Interface style-> the style point where you want to add parameters [Details]
2. At the bottom after entering, there are two columns to fill in, one is variables , one is to replace the content
Related examples:
Write FOOTERCOLOR for the variable (note that you must use uppercase letters)
Write #003399 for the replacement content
After submission, modify the template and write Test style in the template Custom variable
The result is that this test style custom variable will be displayed according to the color of the filled-in replacement content.
After what has been said above, you should know a lot about what you need to pay attention to or what can be applied when modifying the template!
Hope it is helpful to you. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!