Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Chuyển hướng
- */
- // get the redirection url from GET variable
- $redirect_to = !empty($_GET['url'])
- ? trim(strip_tags(stripslashes($_GET['url'])))
- : '';
- $wait_time = 15000; // thời gian tự động chuyển hướng (tính bằng millisecond - ở đây là 30000 ml = 30s).
- $wait_seconds = $wait_time / 1000;
- add_action('wp_head', 'redirect_to_no_index', 99);
- function redirect_to_no_index()
- {
- ?>
- <!-- tắt index trang này -->
- <meta name="robots" content="noindex, follow">
- <?php
- }
- add_action('wp_head', 'redirect_to_external_link');
- function redirect_to_external_link()
- {
- global $redirect_to, $wait_seconds, $wait_time;
- if (empty($redirect_to) || empty($wait_time)) {
- return;
- }
- ?>
- <script>var redirect = window.setTimeout(function(){window.location.href='<?php esc_html_e($redirect_to); ?>'},<?php echo $wait_time; ?>);</script>
- <noscript><meta http-equiv="refresh" content="<?php echo $wait_seconds; ?>;url=<?php esc_attr_e($redirect_to); ?>">></noscript>
- <!--
- <script>var redirect = window.setTimeout(function(){window.open("/index.php/2022/08/23/chao-moi-nguoi/"), "_blank"; myWindow.focus();},<?php echo $wait_time; ?>);</script>
- <noscript><meta http-equiv="refresh" content="<?php echo $wait_seconds; ?>;url=<?php esc_attr_e($redirect_to); ?>">></noscript>
- -->
- <?php
- }
- get_header(); //hiện thị header
- ?>
- <style>
- .sora-ads-here {
- display: block;
- background-color: #eee;
- text-align: center;
- font-size: 13px;
- color: #aaaaaa;
- font-weight: 400;
- font-style: italic;
- line-height: 90px;
- border: 1px solid #ccc;
- }
- </style>
- <div><p style="padding-bottom: 1em;">
-
- </p></div>
- <div id="redirect-page-content" style="width: 100%; background:#fff; height: 50%; margin: 0px 0px 0px 0px; text-align: center; font-size: 18px;">
- <div class="redirect-message">
- <?php if (!empty($redirect_to)) {
- //echo '<p style="font-size: 95%;margin: 8px !important; color: #191919;">BẠN ĐANG ĐƯỢC CHUYỂN ĐẾN TRANG TẢI FILE</p>';
- //printf(__('<strong style="margin: 8px !important;">%s</strong>'),esc_html($redirect_to));
- ?>
- <p> </p>
- <p style="font-size: 100%;margin: 8px 0px 15px 0px !important;color: #f50c0c;"><strong>TỰ ĐỘNG CHUYỂN ĐẾN TRANG TẢI FILE SAU <span style="color: #2fad16" id="timer"></span> GIÂY </strong></p>
- <p style="font-size: 90%;margin: 8px 0px 15px 0px !important;color: #FFFFFF"> . </p> </p>
- <p></p>
- </div>
- <?php
- } else {
- _e('Link chuyển hướng bị lỗi');
- }
- ?>
- </div>
- </div>
- <script>
- document.getElementById('timer').innerHTML = <?php echo $wait_seconds;?>;
- var timer = <?php echo $wait_seconds;?>;
- var interval = setInterval(function() {
- var seconds = timer;
- if (seconds > 0) {
- --seconds;
- document.getElementById('timer').innerHTML = seconds + "";
- timer = seconds;
- }
- else {
- }
- }, 1000);
- </script>
- <?php
- get_footer(); //hiện thị footer
- ?>
- <style>
- .sora-ads-here {
- display: block;
- background-color: #eee;
- text-align: center;
- font-size: 13px;
- color: #aaaaaa;
- font-weight: 400;
- font-style: italic;
- line-height: 90px;
- border: 1px solid #ccc;
- #chuyenngay{width: 60%; margin: 7px;background: #FF9966; border: 1px solid #00cc00; color: #fff; cursor: pointer; font-size: 13px ; font-weight: bold ; padding: 7px 15px;text-decoration: none;text-transform: uppercase;text-shadow: none;}
- #chuyenngay:hover, #dongchuyen:hover{background: #555; border: 1px solid #555}
- #chuyenngay2{width: 60%; margin: 7px;background: ##00DD00; border: 1px solid #00cc00; color: #fff; cursor: pointer; font-size: 13px ; font-weight: bold ; padding: 7px 15px;text-decoration: none;text-transform: uppercase;text-shadow: none;}
- #chuyenngay2:hover, #dongchuyen:hover{background: #555; border: 1px solid #555}
- }
- </style>
- </div></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement