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