将帝国CMS的JS代码修改为手机跳转到PC
帝国CMS JS手机跳转PC代码可以通过以下方式实现: 1. 在模板中添加以下代码: ```html ``` 2. 在需要跳转的页面中添加一个链接,点击时调用`redirectToPC()`函数: ```html 点击跳转到PC版 ```
首页链接
1 | <scripttype= "text/javascript" >varsystem={win: false ,mac: false ,xll: false };varp=navigator.platform;system.win=p.indexOf( "Win" )==0;system.mac=p.indexOf( "Mac" )==0;system.x11=(p== "X11" )||(p.indexOf( "Linux" )==0); if (system.win||system.mac||system.xll){window.location.href= "http://www.XXXX.com" ;} else {}</script> |
封面/列表链接
1 | <scripttype= "text/javascript" >varsystem={win: false ,mac: false ,xll: false };varp=navigator.platform;system.win=p.indexOf( "Win" )==0;system.mac=p.indexOf( "Mac" )==0;system.x11=(p== "X11" )||(p.indexOf( "Linux" )==0); if (system.win||system.mac||system.xll){window.location.href= "http://www.XXX.com/<?=$class_r[$GLOBALS[navclassid]][classpath]?>/" ;} else {}</script> |
内容页
1 | <scripttype= "text/javascript" >varsystem={win: false ,mac: false ,xll: false };varp=navigator.platform;system.win=p.indexOf( "Win" )==0;system.mac=p.indexOf( "Mac" )==0;system.x11=(p== "X11" )||(p.indexOf( "Linux" )==0); if (system.win||system.mac||system.xll){window.location.href= "http://www.XXX.com<?=$navinfor[titleurl]?>" ;} else {}</script> |
播放页
1 | <scripttype= "text/javascript" >varsystem={win: false ,mac: false ,xll: false };varp=navigator.platform;system.win=p.indexOf( "Win" )==0;system.mac=p.indexOf( "Mac" )==0;system.x11=(p== "X11" )||(p.indexOf( "Linux" )==0); if (system.win||system.mac||system.xll){window.location.href= "http://www.XXX.com/e/DownSys/play?classid=<?=$r[classid]?>&id=<?=$r[id]?>&pathid=0" ;} else {}</script> |