本文主要由講解下PHPCMS V9 WAP手機站偽靜態的實現方法,閑話不多說了直接上修改方法。
本文是由361源碼轉自網絡,本文方法觀點不代表361源碼觀點
找到
return WAP_SITEURL."&a=lists&typeid=$typeid";
修改為
return "/list-$typeid".'.html';
繼續找到
return WAP_SITEURL."&a=show&catid=$catid&typeid=$typeid&id=$id";
修改為
return "/show-$catid-$typeid-$id".'.html';
找到
define('URLRULE', 'index.php?m=wap&c=index&a=lists&typeid={$typeid}~index.php?m=wap&c=index&a=lists&typeid={$typeid}&page={$page}');
修改為
define('URLRULE', 'list-{$typeid}.html~list-{$typeid}-{$page}.html');
找到
$urlrules = 'c=index&a=show&catid={$catid}&typeid={$typeid}&id={$id}|c=index&a=show&catid={$catid}&typeid={$typeid}&id={$id}&page={$page}';
修改為
$urlrules = 'show-{$catid}-{$typeid}-{$id}.html|show-{$catid}-{$typeid}-{$id}-{$page}.html';
繼續找到
if($laststr=='?'){$url_arr[0] = $url_arr[1] = WAP_SITEURL.$urls;}else{$url_arr[0] = $url_arr[1] = WAP_SITEURL.'&'.$urls;}
將 WAP_SITEURL 修改為你自己的網址, 如本站修改示例 http://m.xxx.com
if($laststr=='?'){$url_arr[0] = $url_arr[1] = "http://m.xxx.com/".$urls;}else{$url_arr[0] = $url_arr[1] = "http://m.xxx.com/".'&'.$urls;}
<a href='http://m.xxx.com/show-{$catid}-{$typeid}-{$previous_page[id]}.html' class='vevb.com'>上一篇</a><a href='http://m.xxx.com/show-{$catid}-{$typeid}-{$next_page[id]}.html' class='www.companysz.com'>下一篇</a>
“phpcms v9 wap手機門戶站點內容頁添加上一篇、下一篇的方法” 來實現的上一篇下一篇功能,故將此文章鏈接貼于此處,有需要的可以看下。
上一篇、下一篇方法介紹:
PHP源碼修改:
打開 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 = $this->db->get_one("`catid` = '$catid' AND `id`='$id' AND `status`=99",'*','id DESC');}//當前頁為最后一篇時:再點擊下一篇仍然顯示最后一篇if(empty($next_page)) {$next_page = $this->db->get_one("`catid`= '$catid' AND `id`='$id' AND `status`=99");}
模板調用:
<a href="{WAP_SITEURL}&a=show&catid={$catid}&typeid={$typeid}&id={$previous_page[id]}" title="www.companysz.com">上一篇:{$previous_page[title]}</a><a href="{WAP_SITEURL}&a=show&catid={$catid}&typeid={$typeid}&id={$next_page[id]}" title="www.companysz.com">下一篇:{$next_page[title]}</a>
RewriteRule ^list-([0-9]+)-([0-9]+).html index.php?&a=lists&typeid=$1&page=$2
RewriteRule ^list-([0-9]+).html index.php?&a=lists&typeid=$1;
RewriteRule ^show-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html index.php?a=show&catid=$1&typeid=$2&id=$3&page=$4;
RewriteRule ^show-([0-9]+)-([0-9]+)-([0-9]+).html index.php?a=show&catid=$1&typeid=$2&id=$3;
完成
以上就是PHPCMS V9 WAP手機站偽靜態的實現方法的全部內容,希望對大家的學習和解決疑問有所幫助,也希望大家多多支持武林網。新聞熱點
疑難解答