当前位置:首页 » 网站模板 » 详情

手机版模板,手机访问时显示主页不变,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群中咨询。
打赏

打赏方式:

X
  • 支付宝
  • 微信
  • QQ红包

打开支付宝扫一扫
日期:2017年06月19日 星期一   分类:网站模板   浏览(2777)   评论(2)
本文地址:https://www.shuyong.net/957.html   [百度已收录]
声明:本页信息由网友自行发布或来源于网络,真实性、合法性由发布人负责,请仔细甄别!本站只为传递信息,我们不做任何双方证明,也不承担任何法律责任。文章内容若侵犯你的权益,请联系本站删除!

留言咨询

自动获取QQ

昵称

邮箱

网址

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

个人资料

舍力

博主:舍力

    网站制作
    1、博客网站以Emlog为程序;
    2、企业网站建议以米拓MetInfo为程序,当然也可以用Emlog来做。

广告赞助

站点统计

  • 发布文章:1046 条
  • 总访问量:3080555次
  • 本站运行:5年零29天