!
您也想出现在这里吗? 点击联系我们
内容广告区块
当前位置:首页>源码分享>子比源码> 子比主题美化go外链跳转美化代码

子比主题美化go外链跳转美化代码

本文是《免费(共168篇)》专题的第 162 篇。阅读本文前,建议您先阅读前面的文章:

子比主题美化go外链跳转美化代码

效果图:

不会自动跳转,需勾选后点击跳转

子比主题美化go外链跳转美化代码

无需操作自动跳转,默认3秒可自行修改

子比主题美化go外链跳转美化代码

代码教程

一、不会自动跳转的

1、复制代码,替换/wp-content/themes/zibll/go.php文件全部内容

2、搜索logo链接替换成自己的

<?php

if (
    strlen($_SERVER['REQUEST_URI']) > 384 ||
    strpos($_SERVER['REQUEST_URI'], "eval(") ||
    strpos($_SERVER['REQUEST_URI'], "base64")
) {
    @header("HTTP/1.1 414 Request-URI Too Long");
    @header("Status: 414 Request-URI Too Long");
    @header("Connection: Close");
    @exit;
}
//通过QUERY_STRING取得完整的传入数据,然后取得url=之后的所有值,兼容性更好

@session_start();
$t_url = !empty($_SESSION['GOLINK']) ? $_SESSION['GOLINK'] : preg_replace('/^url=(.*)$/i', '$1', $_SERVER["QUERY_STRING"]);
//数据处理
if (!empty($t_url)) {
    //判断取值是否加密
    if ($t_url == base64_encode(base64_decode($t_url))) {
        $t_url = base64_decode($t_url);
    }
    //防止xss
    $t_url = htmlspecialchars($t_url);

    //对取值进行网址校验和判断
    preg_match('/^(http|https|thunder|qqdl|ed2k|Flashget|qbrowser):\/\//i', $t_url, $matches);
    $yelan_title = get_bloginfo('name');
    $title = $yelan_title . ' - 外链安全跳转提醒';
    if ($matches) {
        $url   = $t_url;
        // $title = '页面加载中,请稍候...';
    } else {
        preg_match('/\./i', $t_url, $matche);
        if ($matche) {
            $url   = 'http://' . $t_url;
            // $title = '页面加载中,请稍候...';
        } else {
            $url   = 'http://' . $_SERVER['HTTP_HOST'];
            $title = '参数错误,正在返回首页...';
        }
    }
} else {
    $title = '参数缺失,正在返回首页...';
    $url   = 'http://' . $_SERVER['HTTP_HOST'];
}

$url = str_replace('&', '&', $url);
?>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="robots" content="noindex, nofollow" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <?php echo "<link rel='apple-touch-icon-precomposed icon' href='" . _pz('iconpng') . "' type='image/x-icon'/>"; ?>
    <noscript>
        <meta http-equiv="refresh" content="1;url='<?php echo $url; ?>';">
    </noscript>
    <script>
        function link_jump() {
            //禁止其他网站使用我们的跳转页面
            var MyHOST = new RegExp("<?php echo $_SERVER['HTTP_HOST']; ?>");
            if (!MyHOST.test(document.referrer)) {
                location.href = "//" + MyHOST;
            }
            location.href = "<?php echo $url; ?>";
        }

        //延时50S关闭跳转页面,用于文件下载后不会关闭跳转页的问题
        setTimeout(function() {
            window.opener = null;
            window.close();
        }, 50000);
    </script>
    <title>
        <?php echo $title; ?>
    </title>

<style>
html,body{background:#F3F4F5;font-family: PingFang SC,Hiragino Sans GB,Arial,Microsoft YaHei,Verdana,Roboto,Noto,Helvetica Neue,sans-serif;padding:0;margin:0;}
a{text-decoration:none;}
.urlArea{ padding-top:50px;width:450px;margin:auto;word-break: break-all; }
.urlArea .logo img{ display: block;margin:auto;margin-bottom: 16px; max-width:350px; }
.urlArea .main{ background:#fff;padding:24px;border-radius: 12px;border: 1px solid #E1E1E1; }
.urlArea .flex{ display:flex;align-items:center; }
.urlArea .btn{ display:flex;justify-content:flex-end;align-items: center; }
.urlArea .tip{ background:#e8eefa;padding:12px;margin-bottom:16px;border-radius:4px; }
.urlArea .urlColor{ color:red; }
.urlArea .urlBox{ font-size: 14px;color: #222226;line-height: 24px;margin-bottom:24px; }
.urlArea .ico{ width:24px;height:24px; }
.urlArea .goBtn{ white-space: nowrap;font-size: 14px;background-color: #408ffa;color:#ffffff;border: 1px solid #408ffa;display:inline-block;box-sizing: border-box;padding:6px 18px;border-radius: 18px;margin-left:8px; }
.urlArea .icoTxt{ font-size: 16px;font-weight: 600;color: #222226;line-height: 22px;margin-left:12px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap; }
@media (max-width: 600px){
.urlArea{ padding-top:90px;width:94%; }
}
</style>
</head>
<body>
<div class="urlArea">
<div class="logo"><img src="logo链接"></div><!--logo链接替换位置-->
<div class="main">
<div class="flex tip">
<img class="ico" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAADWUlEQVRoQ+2YvWsUQRiH33fmOMQiRQor7RQSweB9KAQEg1iYKFaZnJJ/wcTOMhLs7Ez8FwLebikasTGCoJDcHSoYQbHRyiKFhajczCu3SS73sbfzsXNJDnLV3s4y83vm3X12dhAG/IcDnh+OAHpVkITISvg2DYyQjwyVcXGt3o9q960CdZELAWC6ERoRn/CgentgAGimOCVJPmsNzJFfx2DjuW8I7xWg+xMZ9enXRwIaaQ2LgJ/Z2aFzvm8l7wBypjBPpB7FzTQiu8uDypLPKngFIDE+rODPFwIYjgUA2GJw7AyGb7d8QXgFkCK/TEB3ksIh4GMeVucOHQCV8qNKwQcCymgA6ozBGJarmz4gvFWgLvKrAHTNLBS+yITVSbNrk6/yAhCnTV04X1pNDdBLmzoAX1pNDZCkTS2EB62mAtBpUwvgQaupAEy0qYdIp1VnAFNtGgCk0qozgJ02tRjOWnUCoFJxUiqZuLJEgB+AbCWKTmqWAE4mYXDGp7C8sapD7Wy3BjDVJke8iUH1aZS/lL8hFUXHvX6uWrUGMNUmByxiWK1sAxTyUqnoOBHCQatWADbadAJw0KoVgJwpLBEpo5WkC0CjOohsmQeVeV21dtuNAWy16QwAaKVVYwBbbboCbM+s+WrVCMBEm50lTwcAYKpVLYCpNrsALDXa7XezTQAtgKk2Y14wVi+yuIfWZBMgEcBGm6bWsLkODbSaCGCjTZtgNtfqtNoTwFabMffwb0DYWQvBLAEdtwm+5/lkrfYEsNVmazgElIzxcSyvr0dLiVu5opL4joC4C0SSVmMBXLTZBoDwnge1863npMjVCKDtnA1ML612Abhqs70C8JPB6VMYhv+iCgiRVfD1OwGcsAndPim4yUaHxjr3VrsAZCk3RwpS718i4gpjdK8RQil8SESzruGbzwODeV6uLXdM1t7fg9amDjBOq20VOAza1EJ0rFabAGm1qRvYVzt2rFabAHWRa3zjetmv9BU2oZ/VTFibarRHACQuXJZQX9uHgb0NwZFdwaDyKgKQorBAoBa99b4PHSHCAx7UFnYqULikUL0mArYPY6ceInrTA05gWHmz9xCL4kWF6ioAZFOP0NcO8C8jerm746H9HuhrFg+dHwF4mMRUXQx8Bf4DeBHHQHvQneAAAAAASUVORK5CYII=" alt="温馨提醒">
<div class="icoTxt">请注意您的账号和财产安全</div>
</div>
<div class="urlBox">
<span>
<div style="font-weight:bold;padding-bottom:8px;">即将跳转到外部网站<span style="color:#c8c8c8;font-weight:bold;">,安全性未知,是否继续?</span></div>
您将要访问的链接不属于本网站,请注意您的账号和财产安全。<br />
前往:<a class="urlColor"><?php echo $url; ?></a>
</span>
</div>
<div class="btn">
<label style="color:red;font-size:12px;"><input type="checkbox" id="isOk" value="1" />本人已知晓风险,本人自愿访问,与本网站无关。</label>
<a id="goBtn" class="goBtn" href="#" target="_self" onclick="return CheckGoUrl()">继续访问</a>
<script language="javascript" type="text/javascript">
var goUrl = decodeURIComponent("<?php echo $url; ?>");
document.getElementById("goBtn").href = goUrl;

function CheckGoUrl(){
if (document.getElementById("isOk").checked){
document.location.href = goUrl;
return true;
}else{
alert("请先打钩左侧【本人已知晓风险】项!");// ,再点击【继续访问】
return false;
}
}
</script>
<script type="text/javascript">

function GetQueryString(name){
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}
var myurl=GetQueryString("f");
if(myurl !=null && myurl.toString().length>1){
  var tg='?f='+GetQueryString("f");
} else {
var tg='';
}
$(function(){
 $("#CopyURL").val('<?php echo $url; ?>'+tg);
var clipboard = new Clipboard('#btnCopy');
clipboard.on('success', function(e) {   
setTimeout(function() {
alert('复制成功,快去浏览器中粘贴访问吧!')
}, 200)
});
 clipboard.on('error', function(e) {
setTimeout(function() {
prompt("复制失败了,请长按全选输入框复制吧~", '<?php echo $url; ?>'+tg)
}, 200)
});
});
function loading() {
var num = 0;
var kg = true;
setInterval(function() {
if (kg) {
if (num == 100) {
window.location.href = "<?php echo $url; ?>" + tg;
kg = false;
return false;
}
$('.load_number').html(num);
num++;
}
}, 30)
$('.loading').css('width', '100%')
};
$(function(){
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
if (isAndroid) {
$("#ico").addClass("and")
} else {
$("#ico").addClass("ios")
}
var ua = navigator.userAgent.toLowerCase();
    if(ua.indexOf(' qq')>-1 && ua.indexOf('mqqbrowser') <0){
   $('.none').css({'opacity':'1'});
   $('.img_bg,.load').hide();
    return;
} else if (ua.match(/MicroMessenger/i) == 'micromessenger') {
    $('.none').css({'opacity':'1'});
$('.img_bg,.load').hide();
        return;
    } else {
loading();
return false
}
});
</script>
<div style="display:none"></div>
</body>

二、自动跳转的

1、复制代码,替换/wp-content/themes/zibll/go.php文件全部内容

2、搜索logo链接替换成自己的,搜索3000可修改延迟跳转时间

<?php

if (
    strlen($_SERVER['REQUEST_URI']) > 384 ||
    strpos($_SERVER['REQUEST_URI'], "eval(") ||
    strpos($_SERVER['REQUEST_URI'], "base64")
) {
    @header("HTTP/1.1 414 Request-URI Too Long");
    @header("Status: 414 Request-URI Too Long");
    @header("Connection: Close");
    @exit;
}
//通过QUERY_STRING取得完整的传入数据,然后取得url=之后的所有值,兼容性更好

@session_start();
$t_url = !empty($_SESSION['GOLINK']) ? $_SESSION['GOLINK'] : preg_replace('/^url=(.*)$/i', '$1', $_SERVER["QUERY_STRING"]);
//数据处理
if (!empty($t_url)) {
    //判断取值是否加密
    if ($t_url == base64_encode(base64_decode($t_url))) {
        $t_url = base64_decode($t_url);
    }
    //防止xss
    $t_url = htmlspecialchars($t_url);

    //对取值进行网址校验和判断
    preg_match('/^(http|https|thunder|qqdl|ed2k|Flashget|qbrowser):\/\//i', $t_url, $matches);
    $yelan_title = get_bloginfo('name');
    $title = $yelan_title . ' - 外链安全跳转提醒';
    if ($matches) {
        $url   = $t_url;
        // $title = '页面加载中,请稍候...';
    } else {
        preg_match('/\./i', $t_url, $matche);
        if ($matche) {
            $url   = 'http://' . $t_url;
            // $title = '页面加载中,请稍候...';
        } else {
            $url   = 'http://' . $_SERVER['HTTP_HOST'];
            $title = '参数错误,正在返回首页...';
        }
    }
} else {
    $title = '参数缺失,正在返回首页...';
    $url   = 'http://' . $_SERVER['HTTP_HOST'];
}

$url = str_replace('&', '&', $url);
?>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="robots" content="noindex, nofollow" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <?php echo "<link rel='apple-touch-icon-precomposed icon' href='" . _pz('iconpng') . "' type='image/x-icon'/>"; ?>
    <noscript>
        <meta http-equiv="refresh" content="1;url='<?php echo $url; ?>';">
    </noscript>
    <script>
        function link_jump() {
            //禁止其他网站使用我们的跳转页面
            var MyHOST = new RegExp("<?php echo $_SERVER['HTTP_HOST']; ?>");
            if (!MyHOST.test(document.referrer)) {
                location.href = "//" + MyHOST;
            }
            location.href = "<?php echo $url; ?>";
        }
        //延时3S跳转,可自行修改延时时间
        setTimeout(link_jump, 3000);
        //延时50S关闭跳转页面,用于文件下载后不会关闭跳转页的问题
        setTimeout(function() {
            window.opener = null;
            window.close();
        }, 50000);
    </script>
    <title>
        <?php echo $title; ?>
    </title>

<style>
html,body{background:#F3F4F5;font-family: PingFang SC,Hiragino Sans GB,Arial,Microsoft YaHei,Verdana,Roboto,Noto,Helvetica Neue,sans-serif;padding:0;margin:0;}
a{text-decoration:none;}
.urlArea{ padding-top:50px;width:450px;margin:auto;word-break: break-all; }
.urlArea .logo img{ display: block;margin:auto;margin-bottom: 16px; max-width:350px; }
.urlArea .main{ background:#fff;padding:24px;border-radius: 12px;border: 1px solid #E1E1E1; }
.urlArea .flex{ display:flex;align-items:center; }
.urlArea .btn{ display:flex;justify-content:flex-end;align-items: center; }
.urlArea .tip{ background:#e8eefa;padding:12px;margin-bottom:16px;border-radius:4px; }
.urlArea .urlColor{ color:red; }
.urlArea .urlBox{ font-size: 14px;color: #222226;line-height: 24px;margin-bottom:24px; }
.urlArea .ico{ width:24px;height:24px; }
.urlArea .goBtn{ white-space: nowrap;font-size: 14px;background-color: #408ffa;color:#ffffff;border: 1px solid #408ffa;display:inline-block;box-sizing: border-box;padding:6px 18px;border-radius: 18px;margin-left:8px; }
.urlArea .icoTxt{ font-size: 16px;font-weight: 600;color: #222226;line-height: 22px;margin-left:12px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap; }
@media (max-width: 600px){
.urlArea{ padding-top:90px;width:94%; }
}
</style>
</head>
<body>
<div class="urlArea">
<div class="logo"><img src="logo链接"></div>  <!--logo链接替换位置-->
<div class="main">
<div class="flex tip">
<img class="ico" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAADWUlEQVRoQ+2YvWsUQRiH33fmOMQiRQor7RQSweB9KAQEg1iYKFaZnJJ/wcTOMhLs7Ez8FwLebikasTGCoJDcHSoYQbHRyiKFhajczCu3SS73sbfzsXNJDnLV3s4y83vm3X12dhAG/IcDnh+OAHpVkITISvg2DYyQjwyVcXGt3o9q960CdZELAWC6ERoRn/CgentgAGimOCVJPmsNzJFfx2DjuW8I7xWg+xMZ9enXRwIaaQ2LgJ/Z2aFzvm8l7wBypjBPpB7FzTQiu8uDypLPKngFIDE+rODPFwIYjgUA2GJw7AyGb7d8QXgFkCK/TEB3ksIh4GMeVucOHQCV8qNKwQcCymgA6ozBGJarmz4gvFWgLvKrAHTNLBS+yITVSbNrk6/yAhCnTV04X1pNDdBLmzoAX1pNDZCkTS2EB62mAtBpUwvgQaupAEy0qYdIp1VnAFNtGgCk0qozgJ02tRjOWnUCoFJxUiqZuLJEgB+AbCWKTmqWAE4mYXDGp7C8sapD7Wy3BjDVJke8iUH1aZS/lL8hFUXHvX6uWrUGMNUmByxiWK1sAxTyUqnoOBHCQatWADbadAJw0KoVgJwpLBEpo5WkC0CjOohsmQeVeV21dtuNAWy16QwAaKVVYwBbbboCbM+s+WrVCMBEm50lTwcAYKpVLYCpNrsALDXa7XezTQAtgKk2Y14wVi+yuIfWZBMgEcBGm6bWsLkODbSaCGCjTZtgNtfqtNoTwFabMffwb0DYWQvBLAEdtwm+5/lkrfYEsNVmazgElIzxcSyvr0dLiVu5opL4joC4C0SSVmMBXLTZBoDwnge1863npMjVCKDtnA1ML612Abhqs70C8JPB6VMYhv+iCgiRVfD1OwGcsAndPim4yUaHxjr3VrsAZCk3RwpS718i4gpjdK8RQil8SESzruGbzwODeV6uLXdM1t7fg9amDjBOq20VOAza1EJ0rFabAGm1qRvYVzt2rFabAHWRa3zjetmv9BU2oZ/VTFibarRHACQuXJZQX9uHgb0NwZFdwaDyKgKQorBAoBa99b4PHSHCAx7UFnYqULikUL0mArYPY6ceInrTA05gWHmz9xCL4kWF6ioAZFOP0NcO8C8jerm746H9HuhrFg+dHwF4mMRUXQx8Bf4DeBHHQHvQneAAAAAASUVORK5CYII=" alt="温馨提醒">
<div class="icoTxt">请注意您的账号和财产安全</div>
</div>
<div class="urlBox">
<span>
<div style="font-weight:bold;padding-bottom:8px;">即将跳转到外部网站<span style="color:#c8c8c8;font-weight:bold;">,安全性未知,是否继续?</span></div>
您将要访问的链接不属于本网站,请注意您的账号和财产安全。<br />
前往:<a class="urlColor"><?php echo $url; ?></a>
</span>
</div>
<div class="btn">
<label style="color:red;font-size:12px;">本人已知晓风险,本人自愿访问,与本网站无关。</label>
<a id="goBtn" class="goBtn" href="#" target="_self" onclick="return CheckGoUrl()">即将自动跳转</a>
<script language="javascript" type="text/javascript">
var goUrl = decodeURIComponent("<?php echo $url; ?>");
document.getElementById("goBtn").href = goUrl;


}
</script>
<script type="text/javascript">

function GetQueryString(name){
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}
var myurl=GetQueryString("f");
if(myurl !=null && myurl.toString().length>1){
  var tg='?f='+GetQueryString("f");
} else {
var tg='';
}
$(function(){
 $("#CopyURL").val('<?php echo $url; ?>'+tg);
var clipboard = new Clipboard('#btnCopy');
clipboard.on('success', function(e) {   
setTimeout(function() {
alert('复制成功,快去浏览器中粘贴访问吧!')
}, 200)
});
 clipboard.on('error', function(e) {
setTimeout(function() {
prompt("复制失败了,请长按全选输入框复制吧~", '<?php echo $url; ?>'+tg)
}, 200)
});
});
function loading() {
var num = 0;
var kg = true;
setInterval(function() {
if (kg) {
if (num == 100) {
window.location.href = "<?php echo $url; ?>" + tg;
kg = false;
return false;
}
$('.load_number').html(num);
num++;
}
}, 30)
$('.loading').css('width', '100%')
};
$(function(){
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
if (isAndroid) {
$("#ico").addClass("and")
} else {
$("#ico").addClass("ios")
}
var ua = navigator.userAgent.toLowerCase();
    if(ua.indexOf(' qq')>-1 && ua.indexOf('mqqbrowser') <0){
   $('.none').css({'opacity':'1'});
   $('.img_bg,.load').hide();
    return;
} else if (ua.match(/MicroMessenger/i) == 'micromessenger') {
    $('.none').css({'opacity':'1'});
$('.img_bg,.load').hide();
        return;
    } else {
loading();
return false
}
});
</script>
<div style="display:none"></div>
</body>
文章链接:https://sjcnh.cn/2365.html
文章标题:子比主题美化go外链跳转美化代码
文章版权:@花醉 所发布的内容,部分为原创文章,转载请注明来源,网络转载文章如有侵权请联系我们!我们将在24小时内极速处理!
本文最后更新发布于2023年12月26日 9时24分00秒,某些文章具有时效性,若有错误或已失效,请在下方留言或联系:841134898@qq.com
本文声明 本站上的部份代码,教程,软件,插件来自会员发布以及互联网收集,不代表本站立场,仅供网友个人学习交流或测试研究使用,未经原版权作者许可,禁止用于任何商业途径!请用户仔细辨认内容的真实性,避免上当受骗!本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。请在下载24小时内删除!若您喜欢本文可附上原文链接随意转载。如无意侵害了您的权益,请发送邮件841134898@qq.com 或点击右侧 私信:花醉 反馈,我们将尽快处理。如果遇到付费才可观看的文章,建议升级终身VIP。全站所有资源“任意下免费看”。本站资源少部分采用7z压缩,为防止有人压缩软件不支持7z格式,建议下载7-zip。zip、rar解压,建议下载WinRAR。

给TA赞助
共{{data.count}}人
人已赞助
!
您也想出现在这里吗? 点击联系我们
内容广告区块
0 条回复Z文章作者V管理员
    暂无讨论,说说你的看法吧
个人中心
今日签到
有新私信 私信列表
有新消息 消息中心
快速搜索
在线客服
关注我们
  • 扫码打开当前页

  • 微信公众号

返回顶部