Discuz template syntax, discuz Template
Discuz! The parsing of the X template is mainly for./source/class/class_template.php File Parsing. For more information, see this file!
Run the PHP code label directly: <! -- {Eval echo $ my_var;} --> // equivalent to <? Php echo $ my_var;?>
<! -- {Eval $ my_arr = array (1, 2, 3) ;}--> // equivalent to <? Php $ my_arr = array (1, 2, 3);?>
<! -- {Eval print_r ($ my_arr) ;}--> // equivalent to <? Php print_r ($ my_arr);?>
<! -- {Eval output () ;}--> // equivalent to <? Php output ();?>
<! -- {Eval exit () ;}--> // equivalent to <? Php exit ();?>
Directly output variables, equivalent to PHP <? Php echo $ my_var;?>, Curly braces can be omitted but are not recommended to be removed. (The Module Program can be called here after processing ): <div id = "anc"> <ul id = "ancl"> $ announcements </ul> </div> // generally, the output content is not a simple variable.
<! -- {Echo cutstr ($ group [lastpost] [subject], 30)} --> // usage condition: 1-the variable must be processed by the function. 2-the output is a variable, cannot be an array
Embedded ad point code: <! -- {Ad/headerbanner/wp a_h} --> // This is an embedded discuz advertisement. We recommend that you customize the ad space. The custom ad space will automatically generate the call code in the background, we only need to paste and copy the file.
Hook tag of the plug-in: <! -- {Hook/global_usernav_extra2} -->
Hook is a keyword that defines index_top as a hook.
Loop syntax (multiple loops) statement with array keys
<! -- {Loop $ my_arr $ key $ val} -->
HTML statement output by Loop
<! -- {/Loop} -->
Circular writing without array keys
<! -- {Loop $ _ G ['setting'] ['navs'] $ nav} -->
HTML statement output by Loop
<! -- {/Loop} -->
DIY region and background data call labels: <! -- [Diy = diy1] --> <div id = "diy1" class = "area"> </div> <! -- [/Diy] --> // do not use the diy function of discuz as much as possible, because the maintenance is very large, you can directly use the background custom module or module code
{Block XXX} (data call module)
Discuz! After the Language Pack is loaded, use in the template file: {lang forum_category_modedby}
The language Pack is stored in the./source/language/directory as a PHP array.