当前位置:首页 » 资料文库 » 正文

帝国CMS手机版访问自动跳转源代码

1993 人参与  2017年04月16日 17:43  分类 : 资料文库  评论

 然猫网今日用到的代码,分享如下:

 

首页

<link rel="alternate" media="only screen and (max-width: 640px)" href="/e/wap/" >
<meta name="mobile-agent" content="format=html5;url=/e/wap/" />
<meta name="mobile-agent" content="format=xhtml;url=/e/wap/" />
<meta http-equiv="Cache-Control" content="no-transform"/>
<script type="text/javascript">var url=location.search;if(url.indexOf("?pc")!=-1){}else{var is_iPd=navigator.userAgent.match(/(iPad|iPod|iPhone)/i)!=null;var is_mobi=navigator.userAgent.toLowerCase().match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|win ce)/i)!=null;if(is_mobi&&window.location.search.indexOf("mv=fp")<0){window.location.href="/e/wap/"}}</script>

 

封面模板

<link rel="alternate" media="only screen and (max-width: 640px)" href="/e/wap/fm.php?bclassid=[!--self.classid--]" >
<meta name="mobile-agent" content="format=html5;url=/e/wap/fm.php?bclassid=[!--self.classid--]" />
<meta name="mobile-agent" content="format=xhtml;url=/e/wap/fm.php?bclassid=[!--self.classid--]" />
<meta http-equiv="Cache-Control" content="no-transform"/>
<script type="text/javascript">var url=location.search;if(url.indexOf("?pc")!=-1){}else{var is_iPd=navigator.userAgent.match(/(iPad|iPod|iPhone)/i)!=null;var is_mobi=navigator.userAgent.toLowerCase().match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|win ce)/i)!=null;if(is_mobi&&window.location.search.indexOf("mv=fp")<0){window.location.href="/e/wap/fm.php?bclassid=[!--self.classid--]"}}</script>


列表模板


<link rel="alternate" media="only screen and (max-width: 640px)" href="/e/wap/list.php?classid=[!--self.classid--]" >
<meta name="mobile-agent" content="format=html5;url=/e/wap/list.php?classid=[!--self.classid--]" />
<meta name="mobile-agent" content="format=xhtml;url=/e/wap/list.php?classid=[!--self.classid--]" />
<meta http-equiv="Cache-Control" content="no-transform"/>
<script type="text/javascript">var url=location.search;if(url.indexOf("?pc")!=-1){}else{var is_iPd=navigator.userAgent.match(/(iPad|iPod|iPhone)/i)!=null;var is_mobi=navigator.userAgent.toLowerCase().match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|win ce)/i)!=null;if(is_mobi&&window.location.search.indexOf("mv=fp")<0){window.location.href="/e/wap/list.php?classid=[!--self.classid--]"}}</script>


内容模板

<link rel="alternate" media="only screen and (max-width: 640px)" href="/e/wap/show.php?classid=[!--classid--]&id=[!--id--]" >
<meta name="mobile-agent" content="format=html5;url=/e/wap/show.php?classid=[!--classid--]&id=[!--id--]" />
<meta name="mobile-agent" content="format=xhtml;url=/e/wap/show.php?classid=[!--classid--]&id=[!--id--]" />
<meta http-equiv="Cache-Control" content="no-transform"/>
<script type="text/javascript">var url=location.search;if(url.indexOf("?pc")!=-1){}else{var is_iPd=navigator.userAgent.match(/(iPad|iPod|iPhone)/i)!=null;var is_mobi=navigator.userAgent.toLowerCase().match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|win ce)/i)!=null;if(is_mobi&&window.location.search.indexOf("mv=fp")<0){window.location.href="/e/wap/show.php?classid=[!--classid--]&id=[!--id--]"}}</script>
 

来源:曹凯博客(微信/QQ号:8463625),转载请保留出处和链接!

本文链接:https://mycaokai.com/article-272.html

南充交友QQ群:8116802;然猫交流QQ群:215058502

QQ:8463625;微信/手机/合作:15881777512

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

收款方式:QQ:8463625,支付宝:8463625@qq.com,微信/手机:15881777512

       

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

博客首页 | 然猫创业网 | 然猫云商

Copyright © 2011-2099 mycaokai.com All Rights Reserved. 蜀ICP备11010836号

扫一扫,加我为微信好友 加我为微信好友