Phpcms V9 Call article by number of views

Source: Internet
Author: User

Channel Total Ranking Call method

<div class= "box" >    

Channel Monthly ranking Call method

<div class= "box" >    

Method of calling all articles of the station:

<div class= "Idxtopapps contents" ><ul class= "Indexicns" >{pc:get sql= "select A.id,a.url,a.thumb,a.status, B.hitsid,b.views from V9_download A, v9_hits b WHERE a.status=99 and a.id=substring (b.hitsid,5) ORDER by b.views DESC "num = "6"}{loop $data $r}<li><a href= "{$r [' url ']}" ></a></li>{/ Loop}{/pc}</ul></div>

You can see "substring (b.hitsid,5)" is the Intercept hitsid field, from left to right number 5th string, namely "c-2-5" from left to right number, 1 "C", 1 "2", 2 "-", 5th character is "5", after interception only left 2nd "-" After the ID, the purpose of the final extract ID is reached. Of course, I also added another condition "status=99", this means that has been approved by the article, this dispensable.

Phpcms V9 Call article by number of views

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.