Phpcms Mobile Content page Add previous and next _php tutorials

Source: Internet
Author: User

Phpcms Mobile Content page Add previous and next post


This article is to share in the phpcms in the mobile phone Content Details page to add a previous and next article method, very simple and practical, the need for small partners can refer to.

Inside the phpcms\modules\wap\index.php, search for the following sentence

The code is as follows:

if (! $r | | $r [' status ']! = ShowMessage (L (' info_does_not_exists '), ' blank ');

Once found, add the next line in its

The code is as follows:

Previous page

$previous _page = $this->db->get_one ("' catid ' = ' $catid ' and ' id ' < ' $id ' and ' status ' =99", ' * ', ' id DESC ');

Next page

$next _page = $this->db->get_one ("' catid ' = ' $catid ' and ' id ' > ' $id ' and ' status ' = 99");

if (Empty ($previous _page)) {

$previous _page = Array (' title ' =>l (' first_page '), ' thumb ' =>img_path. ' nopic_small.gif ', ' url ' = = ' Javascript:alert (\ ". L (' First_page '). ' \');');

}

if (Empty ($next _page)) {

$next _page = Array (' title ' =>l (' last_page '), ' thumb ' =>img_path. ' nopic_small.gif ', ' url ' = = ' Javascript:alert (\''. L (' Last_page '). ' \');');

}

Add in Template

Previous page:

The code is as follows:

< a href= "{wap_siteurl}&a=show&catid={$catid}&typeid=1&id={$previous _page[id]}" >{$previous _page[title]}

Next page:

The code is as follows:

{$next _page[title]}

The above mentioned is the whole content of this article, I hope you can like.

http://www.bkjia.com/PHPjc/1012361.html www.bkjia.com true http://www.bkjia.com/PHPjc/1012361.html techarticle phpcms Mobile Content page Add previous and next article to share is in the Phpcms in the Mobile Content Details page to add a previous and next article method, very simple and practical, there is ...

  • 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.