此套插件由秀站網(wǎng)同行,也是很好的老朋友織夢貓開發(fā),不知哪位網(wǎng)友分享發(fā)布了導(dǎo)致網(wǎng)絡(luò)盜版頻頻,這里我們也分享下僅供大家參考學(xué)習(xí) ,建議大家使用付費(fèi)版插件到織夢貓官方購買。
插件介紹:
織夢手機(jī)站URL默認(rèn)是動(dòng)態(tài),雖然百度明確表示對(duì)于動(dòng)靜態(tài)URL一視同仁,但是手機(jī)站是動(dòng)態(tài)獲取數(shù)據(jù)庫信息影響了手機(jī)站打開速度。織夢貓開發(fā)的這一插件完成了手機(jī)站靜態(tài)化,提高了手機(jī)站打開速度,一件事轉(zhuǎn)化手機(jī)站標(biāo)簽,非常方便,而且支持手機(jī)站綁定子域名。
插件下載:
百度網(wǎng)盤鏈接:https://pan.baidu.com/s/1o8zS3Y6TMbYyi0LRucMIwg 提取碼:hqzl
插件安裝
1:登錄后臺(tái)--模塊--上傳新模塊--根據(jù)本站編碼上傳對(duì)應(yīng)的模塊。
2:根據(jù)需求設(shè)置靜態(tài)化及啟用子域名。
插件安裝后:
插件安裝后需要做幾項(xiàng)修改,包括PC模板跳轉(zhuǎn)識(shí)別代碼、內(nèi)容頁圖片去掉固定尺寸。
1:PC模板跳轉(zhuǎn)識(shí)別代碼
首頁修改識(shí)別代碼:
<meta name="applicable-device"content="pc">
<meta http-equiv="Cache-Control" content="no-transform"/>
<link rel="alternate" media="only screen and(max-width: 640px)" href="http://手機(jī)站域名" >
<meta http-equiv="mobile-agent" content="format=xhtml;url=http://手機(jī)站域名">
<script type="text/javascript">if(window.location.toString().indexOf('pref=padindex') != -1){}else{if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){if(window.location.href.indexOf("?mobile")<0){try{if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){window.location.href="http://手機(jī)站域名";}else if(/iPad/i.test(navigator.userAgent)){}else{}}catch(e){}}}}</script>
列表頁修改識(shí)別代碼:
<meta name="applicable-device"content="pc">
<meta http-equiv="Cache-Control" content="no-transform"/>
<link rel="alternate" media="only screen and(max-width: 640px)"href="http://手機(jī)站域名{dede:type}[field:typelink /]{/dede:type}" >
<meta http-equiv="mobile-agent" content="format=xhtml;url=http://手機(jī)站域名{dede:type}[field:typelink /]{/dede:type}">
<script type="text/javascript">if(window.location.toString().indexOf('pref=padindex') != -1){}else{if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){if(window.location.href.indexOf("?mobile")<0){try{if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){window.location.href="http://手機(jī)站域名{dede:type}[field:typelink /]{/dede:type}";}else if(/iPad/i.test(navigator.userAgent)){}else{}}catch(e){}}}}</script>
文章頁識(shí)別代碼:
<meta name="applicable-device"content="pc">
<meta http-equiv="Cache-Control" content="no-transform"/>
<link rel="alternate" media="only screen and(max-width: 640px)" href="http://手機(jī)站域名{dede:field name='arcurl'/}">
<meta http-equiv="mobile-agent" content="format=xhtml;url=http://手機(jī)站域名{dede:field name='arcurl'/}">
<script type="text/javascript">if(window.location.toString().indexOf('pref=padindex') != -1){}else{if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){if(window.location.href.indexOf("?mobile")<0){try{if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){window.location.href="http://手機(jī)站域名{dede:field name='arcurl'/}";}else if(/iPad/i.test(navigator.userAgent)){}else{}}catch(e){}}}}</script>
2:去掉內(nèi)容頁上傳圖片固定尺寸
找到PHP系統(tǒng)文件:include/ arc.archives.class.php,先備份下這個(gè)文件。
然后查找代碼:
//設(shè)置全局環(huán)境變量
$this->Fields['typename'] = $this->TypeLink->TypeInfos['typename'];
@SetSysEnv($this->Fields['typeid'],$this->Fields['typename'],$this->Fields['id'],$this->Fields['title'],'archives');
在其下面增加:
//去掉img的width和height
$this->Fields['body'] = preg_replace("/style="width:(.*)"/","",$this->Fields['body']);
基本的修改就完成了。還有部分手機(jī)站的調(diào)試根據(jù)具體情況來調(diào)試。