一、在phpcms\modules\wap\index.php里面,搜索下面这句代码
if(!$r || $r[‘status‘] != 99) showmessage(L(‘info_does_not_exists‘),‘blank‘);
二、搜索到后,在它的下一行增加如下代码
//上一页 $previous_page = $this->db->get_one("`catid` = ‘$catid‘ AND `id`<‘$id‘ AND `status`=99",‘*‘,‘id DESC‘); //下一页 $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‘).‘\‘);‘); }
三、模板中的调用代码如下
<!-- <a class="active" href="{WAP_SITEURL}&a=show&catid={$catid}&typeid=1&id={$previous_page[id]}" style="width: 26%;"> 上一篇 </a> <a class="active" href="{WAP_SITEURL}&a=show&catid={$catid}&typeid=1&id={$next_page[id]}" style="width: 26%;"> 下一篇 </a> --> <a class="active" href="/show-{$catid}-{$typeid}-{$previous_page[id]}-1.html" style="width: 26%;"> {if $previous_page[id] == 0}没有了{else}上一篇{/if} </a> <a class="active" href="/show-{$catid}-{$typeid}-{$next_page[id]}-1.html" style="width: 26%;"> {if $next_page[id] == 0}没有了{else}下一篇{/if} </a>
时间: 2024-10-12 05:58:25