2019-08-07, 09:17 AM
(This post was last modified: 2019-08-07, 09:18 AM by YASAKA. Edited 1 time in total.)
Tutorial for redirect page to another site
1, Create a PHP file named 'redirect.php'
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;
5, Upload anon.js file to root/jscripts.
6, Go to showthread and add this;
6.a, If you can't or won't to upload anon.js file, you can use this
change this;
to this;
7, Done.
Result:
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>
<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:
Discord
YASAKA#1898