emlog After upgrading to the new version of pro, WeChat changed to notes, which are only displayed in the background, The emlog note function, as its name implies, is to record some simple text fragments of notes. It has no classification function. For some webmasters with special requirements, they want to add a classification function to the emlog notes to facilitate classification and viewing. If they want to implement this function in the background, they need to modify the database and background programs. It is troublesome and the code will be overwritten once they upgrade and modify, How to add classification function to emlogpro notes? What is the method of adding categories to emlog notes?
How to add classification function to emlogpro notes? Blueleaf shares a simple method of adding classification to emlog notes, which is used when publishing notes in the background #Name# Write notes in this way, and then use the code shared by Blueleaf in the foreground to implement the method of adding classification to emlog notes in the foreground.
<? php function lanyeTwitterTag(){ $db = Database::getInstance(); $sql = "SELECT * FROM ". DB_PREFIX."twitter"; $list = $db->query($sql); $tagContent=array(); while($row = $db->fetch_array($list)){ if(preg_match('/(#(.*?)#)/i',$row['content'],$tagArr)){ $tagContent[$tagArr[2]][]=array( 'date'=>date('Y-m-d H:i:s',$row['date']), 'content'=>preg_replace('/('.$tagArr[0].')\\r|\\n/i','',$row['content']) ); }else{ $tagContent ['Unclassified '] []=array( 'date'=>date('Y-m-d H:i:s',$row['date']), 'content'=>preg_replace('/\\r|\\n/i','',$row['content']) ); } } return $tagContent; }
Disclaimer:
Website: Click Copy to share with friends!
All content resources shared by this website, if not noted, are original by Blueleaf. If you need to reprint, please indicate the source; Please contact us in case of infringement Contact handling 。 Please understand!