Related recommendations: "Empire cms tutorial"
When Empire cms uses smart tags, we generally use =$bqr[title ]?>Output the title, as shown below:
[e:loop={"select title,titleurl from xjb_ecms_dzkb where `classid` = '$GLOBALS[navclassid]' order by newstime",1,24,0}] <li><a href="<?=$bqr[titleurl]?>"><?=$bqr[title]?></a></li> [/e:loop]
1. How to intercept the number of words in the title with the Empire cms smart tag:
Change the above <? =$bqr[title]?>
is replaced with <?=esub($bqr[title],30)?>
, where 30 represents the number of bytes, which is the display 15 Chinese characters
II, Empire cms Smart label display title attribute method:
1, in the SQL statement, change the titlefont field as well To select: select titlefont,title,titleurl from......
2, change the above <?=$bqr[title]?>
Replace with <?=DoTitleFont($bqr[titlefont],$bqr[title])?>
Third, the empire cms smart label needs to display the title again Attributes, and the method of intercepting the number of words in the title:
Combine the first and second methods, replace <?=$bqr[title]?>
with <?=DoTitleFont($bqr[titlefont],esub($bqr[title],30))?>
For more computer programming related knowledge, please visit: Programming video! !
The above is the detailed content of How to call the title attribute and intercept the title word count in the Empire CMS smart tag? (code example). For more information, please follow other related articles on the PHP Chinese website!