找回密码
 注册
首页 ≡≡网络技术≡≡ PHP语言 phpcms v9手机门户中的show.html页添加上一篇下一篇 ...

CMS phpcms v9手机门户中的show.html页添加上一篇下一篇

灰儿 2016-2-19 15:13:03
在phpcms\modules\wap\index.php里面,搜索如下这句代码


  1. if(!$r || $r['status'] != 99) showmessage(L('info_does_not_exists'),'blank');
复制代码


找到后,在它的下一行添加上

  1. //上一页
  2. $previous_page = $this->db->get_one("`catid` = '$catid' AND `id`<'$id' AND `status`=99",'*','id DESC');
  3. //下一页
  4. $next_page = $this->db->get_one("`catid`= '$catid' AND `id`>'$id' AND `status`=99");

  5. if(empty($previous_page)) {
  6.                             $previous_page = array('title'=>L('first_page'), 'thumb'=>IMG_PATH.'nopic_small.gif', 'url'=>'javascript:alert(\''.L('first_page').'\');');
  7.                     }

  8.                     if(empty($next_page)) {
  9.                             $next_page = array('title'=>L('last_page'), 'thumb'=>IMG_PATH.'nopic_small.gif', 'url'=>'javascript:alert(\''.L('last_page').'\');');
  10.                     }
复制代码

在模板show.html
中添加

  1. 上一页:
  2. <a href="{WAP_SITEURL}&a=show&catid={$catid}&typeid=1&id={$previous_page[id]}"> {$previous_page[title]} </a>  <br />
  3. 下一页:
  4. <a href="{WAP_SITEURL}&a=show&catid={$catid}&typeid=1&id={$next_page[id]}" >{$next_page[title]}</a><br />
复制代码



您需要登录后才可以回帖 登录 | 注册
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。