# DedeV6.2.7移动扩展 压缩包解压后覆盖前备份:栏目列表分页样式、标签列表分页样式、搜索列表分页样式等文件后自行处理列表样式。 ``` /admin/inc/inc_archives_functions.php /admin/inc/inc_menu.php /system/archive/archives.class.php /system/archive/listview.class.php ``` 手机端模板启用静态链接,如列表`[field:typeurl/]`标签,文档`[field:arcurl/]`标签。那么手机端模模板中css和js等,建议用绝对路径引用,以免手机端更新后页面错误。缩略图标签前加电脑端链接为`http://xxx.com[field:picname/]`,文档正文标签为`{dede:field.body function='str_replace("/static/allimg/","http:xxx.com/static/allimg/",@me)'/}`,后台-系统设置-系统配置变量-是否支持多站点选择否,最后更新目录中有静态文件,则更新成功。 手机端模板启用动态链接,如列表`list.php?tid=[field:id/]`形式,文档`view.php?aid=[field:id/]`形式,手机端伪静态规则参考电脑端。 ## 手机端静态识别设备跳转代码 以下代码放到电脑端前端模板的js里,或者创建一个js文件引用即可,域名换成您要跳转域名。 ``` //电脑跳转移动 var nowurl = window.location.href; nowurl = nowurl.replace("www.dedebiz", "m.baidu"); 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("?agent=m") < 0) { try { if (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)) { window.location.href = nowurl } else if (/iPad/i.test(navigator.userAgent)) {} else { window.location.href = nowurl } } catch(e) {} } } //移动跳转电脑 var sUserAgent = navigator.userAgent.toLowerCase(); var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os"; var bIsMidp = sUserAgent.match(/midp/i) == "midp"; var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb"; var bIsAndroid = sUserAgent.match(/android/i) == "android"; var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce"; var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile"; if (! (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) { url = window.location.href; url = url.replace("m.baidu", "www.dedebiz"); window.location.href = url } ``` ## 手机端动态识别设备跳转代码 首页 ``` ``` 列表页 ``` ``` 文档页 ``` ```