When using the Empire tag template, you must intercept the string, but if you setIntroductionThe html Tag is displayed on the front-end. My solutions are now released. The first user of my empire. If the problem occurs, you are welcome to leave a comment. Forget to communicate with each other
The Empire tag template uses program code to remove html tags and truncate strings
1. Add a user-defined function to the e/class/connect. php file.How to remove html tagsNoHTML ()
1 // remove HTML tags
2 function NoHTML ($ string ){
3 $ string = preg_replace ("'<script [^>] *?>. *? </Script> 'si "," ", $ string); // remove javascript
4 $ string = preg_replace ("'<[\/\!] *? [^ <>] *?> 'Si "," ", $ string); // remove the HTML Tag
5 $ string = preg_replace ("'([\ r \ n]) [\ s] +'", "", $ string); // remove the white space
6 $ string = preg_replace ("'& (quot | #34);' I", "", $ string); // replace an HTML Object
7 $ string = preg_replace ("'& (amp | #38);' I", "", $ string );
8 $ string = preg_replace ("'& (lt | #60);' I", "", $ string );
9 $ string = preg_replace ("'& (gt | #62);' I", "", $ string );
10 $ string = preg_replace ("'& (nbsp | #160);' I", "", $ string );
11 return $ string;
12}
2. List content template code:
1 $ r [smalltext] = esub (NoHTML ($ r [smalltext]), 200 ,'......');
2 $ listtemp = '<li> <strong> <a href = "[! -- Titleurl --] "> [! -- Title --] </a> </strong> <p> [! -- Smalltext --] </p> </li> ';
Success.