This article will share with you how to add the previous and next article to the mobile content details page in phpcms The method is very simple and practical, friends in need can refer to it.
In phpcmsmoduleswapindex.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
on the next lineThe 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
to the templatePrevious 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 is the entire content of this article, I hope you all like it.