Provide zblog template_zblog them_wordpress template download and customization

Zblogphp calls the method with the most comments for the latest and hottest articles

Tianxing Studio 2015-02-03 21:40 course nine thousand four hundred and forty-five 7 Comments


before zblogphp 1.3 The era is implemented by hanging interfaces, which is unexpected zblogphp1.4 Here we come, all hang up. Σ( ° △ °|||)︴

In the middle of the night, fix all the hung topics, and then share the code, hoping to help people in need.


Call the latest 10 articles:

 {foreach GetList(10) as $newlist} <li><span>{$newlist.Time('m-d')}</span><a href="{$newlist.Url}" title="{$newlist.Title}">{$newlist.Title}</a></li> {/foreach}


Call the 10 most clicked articles:

 {php} $order = array('log_ViewNums'=>'DESC'); $where = array(array('=','log_Status','0')); $array = $zbp->GetArticleList(array('*'),$where,$order,array(10),''); {/php} {foreach $array as $hotlist} <li><span>{$hotlist.ViewNums}℃</span><a href="{$hotlist.Url}" title="{$hotlist.Title}">{$hotlist.Title}</a></li> {/foreach}


10 articles with the most comments:

 {php} $order = array('log_CommNums'=>'DESC'); $where = array(array('=','log_Status','0')); $array = $zbp->GetArticleList(array('*'),$where,$order,array(10),''); {/php} {foreach $array as $hotlist} <li><span>{$hotlist. CommNums} Comments</span><a href="{$hotlist. Url}" title="{$hotlist. Title}">{$hotlist. Title}</a></li> {/foreach}

Ps: The code is not very good, but it can be used


Can't find a tutorial that can solve your problem?

You can try to search or ask questions directly online. We also provide charging technical support. If you need it, you can contact us online.

Online questions Online Service

yes seven Comments from netizens:

  •  Huizi

    Huizi Five years ago (April 23, 2019) reply

    Blogger, I want to ask how to call the article with the highest number of hits in the specified column??

    •  Tianxing Studio

      Tianxing Studio Five years ago (April 23, 2019) reply

      https://www.txcstx.com/post/957.html

      •  Huizi

        Huizi Five years ago (April 23, 2019) reply

        Thank you, I love you

  •  Muzi

    Muzi Seven years ago (2017-09-22) reply

    Brother, how can I get the value in a certain period of time by calling the code of the 10 articles with the most hits? That is to say, the articles published between July and August are clicked most, instead of being read in the content of the whole site?

  •  yibin

    yibin 8 years ago (2016-12-23) reply

    Looking for this

  •  Orange sunlight

    Orange sunlight 10 years ago (March 28, 2015) reply

    Brother, can we change it to related next time? I'm afraid of misleading people by copying like this.

    •  Tianxing Studio

      Tianxing Studio 10 years ago (March 28, 2015) reply

      (⊙﹏ ⊙) b OK

welcome you Comment: Cancel Reply

 Please fill in the verification code
  • Latest articles
  • Hot article ranking
  • Most Comments
Label aggregation