Today, when you are working on a page in the news list, you have to read a large list of news items. It would be painful if each piece of data should be taken from the data according to the article ID and term_id.
Witty as I, however, found the use of popular articles in the CMF framework:
At the code level, the general wording of the article is:
1<divclass= "Tc-box" >2<divclass= "Headtitle" >34</div>5<divclass= "ranking" >6<php>7 $hot _articles=sp_sql_posts ("CID:$portal _hot_articles; field:post_title,post_excerpt,object_id,smeta,term_id;order:post_hits Desc;limit:5; "); 8</php>9<ulclass= "Unstyled" >Ten<foreachName= "Hot_articles" item= "VO" > One<php>$top=$key<3? " TOP3 ":" ";</php> A<liclass="{$top} "><i>{$key+1}</i><a title= "{$vo. Post_title} "href=" {: Leuu (' Article/index ', array (' id ' =$vo[' object_id '], ' cid ' =$vo[' term_id '])} " >{$vo.post_title}</a></li> -</foreach> -</ul> the</div> -</div>
See the default hot_articles, should be a default definition of popular articles. There's a
CID: $portal _hot_articles
Should be a well-encapsulated function. The results are as follows:
Finally, after the CID is modified, the article ID and return value are successfully obtained.
About the use of popular articles in THINKCMF