Generally, we use the latest articles, clicks, and comments when calling zblog php articles (the method is here ), at the same time, we may also call popular articles this week, this month, and this year in some specific locations. As a coincidence, when I made a theme for an enterprise website customer, there was an empty position on the side and I didn't know what to put, so I called him the popular product content of the year. For more information, see @ Tianxing.
The code is as follows: |
Copy code |
{Php} $ stime = time ();
$ Ytime =
90* 24*60*60;
$ Ztime = $ stime-$ ytime;
$ Order = array ('log _ viewnums' => 'desc ');
$ Where = array ('=', 'log _ status', '0'), array ('>', 'log _ posttime', $ ztime ));
$ Array = $ zbp-> GetArticleList (array ('*'), $ where, $ order, array (
10),'');
{/Php}
{Foreach $ array as $ cmslist}
<Li> <a href = "{$ cmslist. Url}" title = "{$ cmslist. Title}" >{$ cmslist. Title} </a> </li>
{/Foreach}
|
For specific parameters, we can see 90 and 10 in the above script. The former represents the call of 10 popular articles in 90 days. If it takes 7 or 365 days, modify the number accordingly.