Phpcms by Price, by sales, by time, etc.

Source: Internet
Author: User

The general idea is to include the parameters of the specified sort in the link, for example, we use the order in get as the sort parameter:

Order=views popularity; order=sells efficiency; order=pirce by Price;

So the links to the three sort buttons are as follows:

123 <ahref="/index.php?m=content&c=index&a=lists&order=views">按人气</a><a href="/index.php?m=content&c=index&a=lists&order=sells">按销量</a><ahref="/index.php?m=content&c=index&a=lists&order=price">按价格</a>

Then get the specified sort parameters in the corresponding PHP program file or Template:

1 $order= isset($_GET[‘order‘]) ? trim($_GET[‘order‘]).‘ desc‘‘sells desc‘;

Then specify the sort in the Template Article List tab:

123 {pc:content action="lists" catid="$catid" num="15" order="$order"}...{/pc}

Phpcms by Price, by sales, by time, etc.

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.