时间:2020-02-18加入收藏
第一款代码:本域名内提示用浏览器打开1<?php
$conf['qqjump']=1;
if(strpos($_SERVER['HTTP_USER_AGENT'], 'QQ/')||strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')!==false && $conf['qqjump']==1){
$siteurl='https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
echo '代码区域';
exit;
}
?>
把以上代码放到检测代码中代码区域位置,一起放到index.php文件中,例如你用的苹果CMSV10,就添加到网站根目录下index.php 文件中的最上方,不要覆盖。<html>
<head>
<meta charset="UTF-8">
<title>请使用浏览器打开</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta name="format-detection" content="telephone=no">
<meta content="false" name="twcClient" id="twcClient">
<meta name="aplus-touch" content="1">
<style>
body,html {width:100%;height:100%}
* {margin:0;padding:0}
body {background-color:#fff}
#contens {font-weight:bold;margin:-285px 0px 10px;text-align:center;font-size:18px;margin-bottom:125px;}
.top-bar-guidance {font-size:15px;color:#fff;height:70%;line-height:1.8;padding-left:20px;padding-top:20px;background:url(//gw.alicdn.com/tfs/TB1eSZaNFXXXXb.XXXXXXXXXXXX-750-234.png) center top/contain no-repeat}
.top-bar-guidance .icon-safari {width:25px;height:25px;vertical-align:middle;margin:0 .2em}
</style>
</head>
<body>
<div class="top-bar-guidance">
<p>点击右上角<img src="//gw.alicdn.com/tfs/TB1xwiUNpXXXXaIXXXXXXXXXXXX-55-55.png" class="icon-safari"> <span id="openm">Safari打开</span></p>
<p>可以继续浏览本站哦~</p>
</div>
<div id="contens">
检测到您正在使用应用内置浏览器<br />
请切换到手机浏览器观看,谢谢!!!<br />
</div>
</html>
这款代码放到模板全局文件中即可<!DOCTYPE html>
<html lang="zh_CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>在浏览器打开</title>
<style type="text/css">
* {margin:0;padding:0;}
a {text-decoration:none;}
img {max-width:100%;height:auto;}
.weixin-tip {display:none;position:fixed;left:0;top:0;bottom:0;background:rgba(0,0,0,0.8);filter:alpha(opacity=80);height:100%;width:100%;z-index:100;}
.weixin-tip p {text-align:center;margin-top:10%;padding:0 5%;}
</style>
</head>
<body>
<div class="weixin-tip">
<p><img src="//ae01.alicdn.com/kf/Hb05e015ac5c64958bb6bb387972b6d38z.png" alt="在浏览器打开" /></p>
</div>
<script type="text/javascript">
$(window).on("load",function(){
var winHeight = $(window).height();
function is_weixin() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
return true;
} else {
return false;
}
}
var isWeixin = is_weixin();
if(isWeixin){
$(".weixin-tip").css("height",winHeight);
$(".weixin-tip").show();
}
})
</script>
</body>
</html>
把以上代码放到检测代码中代码区域位置,一起放到index.php文件中,例如你用的苹果CMSV10,就添加到网站根目录下index.php 文件中的最上方,不要覆盖。<html>
<head>
<meta charset="UTF-8">
<title>请使用浏览器打开</title>
<meta http-equiv="refresh" content="0; url="https://c.pc.qq.com/middlem.html?pfurl=你得网址">
</head>
<body>
</body>
</html>
TGA: 技巧