phpcms v9实现wap的上一篇、下一篇功能

if(!$r || $r['status'] != 99) showmessage(L('info_does_not_exists'),'blank');
复制代码
在phpcmsmoduleswapindex.php里面,搜索上面这句

找到后,在它的下一行添加上
//上一页
                $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 href="{WAP_SITEURL}&a=show&catid={$catid}&typeid=1&id={$previous_page[id]}" >{$previous_page[title]}</a>
下一页:
< a href="{WAP_SITEURL}&a=show&catid={$catid}&typeid=1&id={$next_page[id]}" >{$next_page[title]}</a>
最后给你泼点冷水:以上没有进行测试,只是根据程序流程修改的,

以上信息转载自:http://bbs.phpcms.cn/thread-878647-1-1.html
本文关键词:

联系我们

在线咨询:点击这里给我发消息

邮件:w420220301@qq.com