Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redirect Page for Every Link [NO PLUGIN]
#1
Tutorial for redirect page to another site

1, Create a PHP file named 'redirect.php'
<?php 
    define('IN_MYBB', 1);
    define('THIS_SCRIPT', 'redirect.php');

    require_once("global.php");

    add_breadcrumb("Redirect", $_SERVER['PHP_SELF']);

    eval("\$page = \"".$templates->get("redirect_page")."\";");

    output_page($page);
?>

2, Go to Admin CP >> Templates & Style >> Templates >> Your Templates >> Add Templates

3, Set new template name: redirect_page

4, Add this in the new template;
<html>
<head>
<title>Redirect - {$mybb->settings['bbname']}</title>
{$headerinclude}
</head>
<body>
{$header}
<script type="text/javascript">
var link=decodeURIComponent(location.search.substr(6));    
second = 5; //Wait time in seconds
function AutoRedirect(){
document.getElementById('time').innerHTML=second;
if(second==0){
location.href=link;
}
second--;
}
</script>
<br />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" id="fullwidth" style="width:50%;margin:auto">
<tr>
<td class="thead"><strong>Auto Redirect</strong></td>
</tr>
<tr>
<td class="trow1">You are now leaving <span style='color:#ff2f2f;font-weight:900'>Sinful Site</span> and being redirected to
<script type="text/javascript">
document.write("<span style='font-weight:900'>"+link+"</span>")
</script><br>Follow at your own risk! Auto redirect in <span id="time" style="font-weight:900;color:crimson"></span>.
<script type="text/javascript">
AutoRedirect(second);
setInterval("AutoRedirect(second)",1000);
</script>
</td>
</tr>
<tr>
<td class="tcat" align="center"><a class="button" href="{$mybb->settings['bburl']}">Cancel</a>&nbsp;
<script type="text/javascript">
document.write("<a class='button' href='"+link+"'>Get Link</a>")
</script>
</td>
</tr>
</table>
{$footer}
</body>
</html>

5, Upload anon.js file to root/jscripts.

6, Go to showthread and add this;
<script src="jscripts/anon.js" type="text/javascript"></script>
<script type="text/javascript"><!--
protected_links = "sinfulsite.com";
auto_anonymize();
//--></script>
NOTE: Change sinfulsite.com with your forum URL.

6.a, If you can't or won't to upload anon.js file, you can use this
change this;
<script src="jscripts/anon.js" type="text/javascript"></script>

to this;
<script src="https://sinfulsite.com/jscripts/anon.js" type="text/javascript"></script>


7, Done.

Result:
[Image: c3j9eem.png]
Reply


Messages In This Thread
Redirect Page for Every Link [NO PLUGIN] - by YASAKA - 08-07-2019, 09:17 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)