Last update at :2024-03-18,Edit by888u
When Empire CMS publishes information, it will by default intercept the previous paragraph from the detailed content as an introduction, but sometimes it will intercept the HTML code, which is very unpleasant. This tutorial can solve it.
First add a custom function to the e/class/connect.php file, such as NoHTML(). This can be set however you like
//Remove HTML tags function NoHTML($string){ $string = preg_replace("''si", "", $string);//Remove javascript $string = preg_replace("'<[\/\!]*?[^<>]*?>'si", "", $string); //Remove HTML tags $string = preg_replace("'([\r\n])[\s]+'", "", $string); //Remove whitespace characters $string = preg_replace("'&(quot|#34);'i", "", $string); //Replace HTML entities $string = preg_replace("'&(amp|#38);'i", "", $string); $string = preg_replace("'&(lt|#60);'i", "", $string); $string = preg_replace("'&(gt|#62);'i", "", $string); $string = preg_replace("'&(nbsp|#160);'i", "", $string); //The following are regular rules for blocking phone numbers $string= preg_replace('/(0[0-9]{2,3}[-]?[2-9])[0-9]{3,4}([0-9]{3}[- ]?[0-9]?)/i','$1****$2',$string);//Hide the middle four digits of the phone number $string = preg_replace('/(1[358]{1}[0-9])[0-9]{4}([0-9]{4})/i','$1****$2 ',$string);//Hide the middle four digits of the mobile phone number //Block phone number regular end return $string; }Then go to the list content template and modify the code
$r[smalltext]=esub(NoHTML($r[smalltext]),200,'...'); $listtemp='[!--smalltext- -]
This problem is solved, it's very simple.
Recommended site searches: yellow pages, org domain name, website registration query, registration password retrieval, Ministry of Industry and Information Technology website registration vps server rental, IP address detailed query, Henan registration, US server, IP query,
发表评论