当前位置:首页 » 网站模板 » 手机版模板,手机访问时显示主页不变,slm主题

手机版模板,手机访问时显示主页不变,slm主题

一个简单的手机模板,当手机访问时才会触发。请上传时候一定要备份,因未备份导致的一切问题,自行解决。

使用方法:
1、在原模板的module.php文件中加入下面代码,不要问我放那个位置,你想放哪里位置都可以
<?php 
function sywap(){ 
$user_agent = $_SERVER['HTTP_USER_AGENT']; 
$mobile_agents = array("240x320","acer","acoon","acs-","abacho","ahong","airness","alcatel","amoi","android","anywhereyougo.com","applewebkit/525","applewebkit/532","asus","audio", "au-mic","avantogo","becker","benq","bilbo","bird","blackberry","blazer","bleu","cdm-","compal","coolpad","danger","dbtel","dopod","elaine","eric","etouch","fly ","fly_","fly-","go.web","goodaccess","gradiente","grundig","haier","hedy","hitachi","htc","huawei","hutchison","inno","ipad","ipaq","iphone","ipod","jbrowser","kddi","kgt","kwc","lenovo","lg ","lg2","lg3","lg4","lg5","lg7","lg8","lg9","lg-","lge-","lge9","longcos","maemo","mercator","meridian","micromax","midp","mini","mitsu","mmm","mmp","mobi","mot-","moto","nec-","netfront","newgen","nexian","nf-browser","nintendo","nitro","nokia","nook","novarra","obigo","palm","panasonic","pantech","philips","phone","pg-","playstation","pocket","pt-","qc-","qtek","rover","sagem","sama","samu","sanyo","samsung","sch-","scooter","sec-","sendo","sgh-","sharp","siemens","sie-","softbank","sony","spice","sprint","spv","symbian","tablet","talkabout","tcl-","teleca","telit","tianyu","tim-","toshiba","tsm","up.browser","utec","utstar","verykool","virgin","vk-","voda","voxtel","vx","wap","wellco","wig browser","wii","windows ce","wireless","xda","xde","zte"); 
$sywap = false;foreach($mobile_agents as $device){if(stristr($user_agent, $device)) {$sywap = true;break;}}return $sywap;}?>
2、在原模板header.php找到require_once View::getView('module');后面加入代码
<?php if(sywap()){include View::getView('slm/head');exit;}?>
3、下载本模板文件,然后直接上传到下载使用的模板目录中,例如:现在使用的是默认模板,则上传到default文件中

以上3步就完成了,请在未修改的情况下测试,上传后请使用手机访问查看,电脑是不会显示的。
slm.jpg

文件请在QQ群文件中下载,如有疑问可在本页留言或者QQ群中咨询。
觉得很赞 (3)打赏支持
X
打赏方式:
  • 微信
  • QQ红包
  • 支付宝

使用微信扫一扫
日期:2017年06月19日 星期一   分类:网站模板   本文已经被百度收录,点击查看详情
blogger
本页正文内容约1826个文字
版权所有:【舍力博客】 => 【手机版模板,手机访问时显示主页不变,slm主题】
本文地址:https://www.shuyong.net/957.html
除非注明,文章均为 【舍力博客】 原创,欢迎转载!转载请注明本文地址,谢谢!

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

填写好QQ号码,任点空白处自动获取

昵称

邮箱

网址

1楼、Chelders [回复该留言]
2017-06-25 02:19
时间那么贵,留给相处不累的人!

站内搜索

个人资料

舍力

博主:舍力

Emlog交流群

    舍力博客承接Emlog模板定制/仿站、网站功能高仿、新增或修改Emlog等服务,本站提供最新的Emlog企业/CMS/博客模板、Emlog教程及网页脚本编程知识分享!

广告

博客统计

  • 文章数量:987篇
  • 文章评论:2757条
  • 总访问量:2272332次
  • 微语数量:50条
  • 在线人数:1人
  • 本站运行:4年2月27天
  • 博主很懒,今天什么都没留下!
Copyright © 2017 舍力博客 版权所有   粤ICP备11021420号
时间那么贵,留给相处不累的人!Sitemap
数据存储阿里云服务器 QQ群:398634813
Powered by emlog / &Author 舍力博客.