首页 > 运营 > 帮助中心 > 正文

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

2019-10-11 22:49:13
字体:
来源:转载
供稿:网友

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.vevb.com/";}}}catch(err){}</script><meta name="mobile-agent" content="format=xhtml;url=https://m.vevb.com/">

列表页

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

内容页

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

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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表