Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Include the SSI file.
- require(dirname(__FILE__) . '/SSI.php');
- loadLanguage('RedirectPage/');
- @$link = urldecode(substr($_SERVER['QUERY_STRING'], 4));
- if($modSettings['RedirectPage_encode']) $link = html_entity_decode(base64_decode($link));
- @$site = parse_url($link, PHP_URL_HOST);
- // if it is in settings - use instant redirect to target page
- if ($modSettings['RedirectPage_type'] == 'instant'){
- header('Location: ' . $link);
- exit;
- }
- // if it is in settings - use automatic redirection after delay
- if ($modSettings['RedirectPage_type'] == 'delayed'){
- header('Refresh: ' . $modSettings['RedirectPage_delay'] . '; url=' . $link);
- }
- $context['page_title'] = $context['page_title_html_safe'] = $txt['RedirectPage_title'];
- $context['linktree'][1] = Array( 'url' => $context['user']['is_guest']? $scripturl . '?action=register' : $link, 'name' => $txt['RedirectPage_title']);
- $in = Array('{LINK}', '{link}', '{SITE}', '{DELAY}', '{LOGIN}');
- $out = Array('<a href="' . $link . '">' . $link . '</a>', $link, $site, $modSettings['RedirectPage_delay'], $txt['login_or_register']);
- if ($context['user']['is_guest'] && !empty($modSettings['RedirectPage_guest_text']))
- $text = $modSettings['RedirectPage_guest_text'];
- elseif (!empty($modSettings['RedirectPage_text']))
- $text = $modSettings['RedirectPage_text'];
- else
- $text = $txt['RedirectPage_default_text'];
- //$text = (empty($modSettings['RedirectPage_text']))? $txt['RedirectPage_default_text'] : $modSettings['RedirectPage_text'];
- $text = str_replace($in, $out, $text);
- if ($modSettings['RedirectPage_use_theme']){
- template_header();
- }
- else {
- echo '<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '">
- <title>', $context['page_title_html_safe'], '</title>
- <style type="text/css">
- a:link,a:hover,a:visited {
- color: #338;
- text-decoration: none;
- border-bottom: dotted 1px;
- }
- a:hover {
- background-color: #eef;
- border-bottom: 0px;
- }
- div.main{
- padding: 2ex;
- margin: 50px auto;
- max-width: 650px;
- min-width: 350px;
- }
- div.copy{
- height: 50px;
- text-align: center;
- }
- </style>
- </head>
- <body>';
- }
- // Show main block with redirection info (editable in admin panel)
- echo '
- <div class="main">
- ', $text, '
- </div>';
- $forum_copyright = '<div class="copy"><a href="http://custom.simplemachines.org/mods/index.php?mod=2562" target="_blank">RedirectPage</a> © BIOHAZARD | more mods on <a href="http://demoforum.ru/" target="_blank">demoforum.ru</a></div>';
- $forum_version = '';
- if ($modSettings['RedirectPage_use_theme']){
- template_footer();
- }
- else {
- echo $forum_copyright, '
- </body>
- </html>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement