Add the previous and next articles on the phpcms mobile phone content page, and phpcms previous _ PHP Tutorial

Source: Internet
Author: User
On the phpcms mobile phone content page, add the previous and next articles, and phpcms the previous one. Add the previous and next articles on the phpcms mobile phone content page, and search for the following copy code in phpcms moduleswapindex. php: if (! $ R | $ r [status]! Add the previous and next articles on the phpcms mobile phone content page, and the last article on phpcms

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

The code is as follows:
If (! $ R | $ r ['status']! = 99) showmessage (L ('info _ does_not_exists '), 'Blank ');

After finding it, add it to the next line

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 ($ previus_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 = {$ previus_page [id]}"> {$ previousus_page [title ]}

Next page:

The code is as follows:
{$ Next_page [title]}

The above is all the content of this article. I hope you will like it.

In phpcms \ modules \ wap \ index. php, search for the following code: if (! $ R | $ r ['status']!...

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.