Get tag implementation homepage call all site popular articles

Source: Internet
Author: User

Today, when using phpcms for a project, you need to call the full-site article on the homepage. However, phpcms does not have any labels available for use. After reading the default homepage template, there is such a piece of code:

{PC: Content action = "hits" catid = "6" num = "10" Order = "views DESC "}

{Loop $ data $ R}

<Li> <a href = "{$ R [url]}" target = "_ blank" >{$ R [title]} </a> </LI>

{/Loop}

{/PC}


I tried to write all the column IDs and found that there was no way to do it. I could only use the get tag.


The final code is as follows:

{PC: Get SQL = "select URL, title, inputtime, dayviews from v9_news, v9_hits where Concat ('C-1-', v9_news.id) = v9_hits.hitsid order by weekviews DESC "num =" 10 "siteid =" $ siteid "}

{Loop $ data $ R}

<Li> <SPAN class = "Num {$ n}" >{$ n} </span> <a href = "{$ R [url]}" Title = "{ $ R [title]} "{title_style ($ R [style])} target = "_ blank" >{$ R [title]} </a> </LI>

{/Loop}

{/PC}


Among them, 1 in C-1-is the model ID, which can also be used to customize the model. We recommend that you use it.

You can also read this article to call the get call method of "day, week, And month" on the homepage.

Get tag implementation homepage call all site popular articles

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.