帝国CMS访问电脑端自动跳转到手机端动态页和静态页的代码

帝国CMS访问电脑端自动跳转到手机端动态页和静态页的代码

来源:帝国CMS模板网 作者:帝国CMS教程 时间:2019-07-12
浏览:1.3千+ 收藏 点赞(17)
简介: Empire CMS 7.2版本引入了全面的多接入终端功能,使网站更方便地制作多个移动接入终端。版本7.5中的多访问者升级:支持主端的后台刷新以生成每个访问端的静态页面,并且多访问端

Empire CMS 7.2版本引入了全面的多接入终端功能,使网站更方便地制作多个移动接入终端。版本7.5中的多访问者升级:支持主端的后台刷新以生成每个访问端的静态页面,并且多访问端在静态模式下使用更方便。

在首页模板页面头部,JS代码在body前面加上以下HTML源代码

<script type="text/javascript">
try {var urlhash = window.location.hash;if (!urlhash.match("fromapp"))
{if ((navigator.userAgent.match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i)))
{window.location="https://m.daixiao360.cn/";}}}
catch(err)
{
}</script>
<meta name="mobile-agent" content="format=xhtml;url=https://m.daixiao360.cn/">

列表页

动态页:https://m.daixiao360.cn/e/action/ListInfo/?classid=[!--self.classid--]
静态页:https://m.daixiao360.cn<?$r['classid']=$GLOBALS[navclassid];$classurl=sys_ReturnBqClassname($r,9);echo $classurl;?>

内容页

动态页:https://m.daixiao360.cn/e/action/ListInfo/?classid=[!--self.classid--]
静态页:https://m.daixiao360.cn<?$r['classid']=$GLOBALS[navclassid];$classurl=sys_ReturnBqClassname($r,9);echo $classurl;?>

分成动态与静态页面,可自行选择更换ppqq.net为自己的子域名。

帝国CMS模板网 帝国CMS模板网(www.daixiao360.cn)长期承接帝国CMS模板定制,帝国CMS仿站,帝国CMS采集规则,帝国CMS插件,帝国CMS二次开发。