Skip to content

Instantly share code, notes, and snippets.

@Smally1997
Created May 16, 2015 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Smally1997/1b33ac6e3d27e76ac66b to your computer and use it in GitHub Desktop.
Save Smally1997/1b33ac6e3d27e76ac66b to your computer and use it in GitHub Desktop.
<?php
/**
* Copyright © 2006-2008 CraKteR, crakter [at] gmail [dot] com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @version $Id: redirectonreg.php 30 2008-08-14 19:03:17Z CraKteR $
* @copyright $LastChangedDate: 2008-08-14 21:03:17 +0200 (to, 14 aug 2008) $
* @author CraKteR <crakter@gmail.com>
*/
if(!defined("IN_MYBB"))
{
die("This file cannot be accessed directly.");
}
$plugins->add_hook('member_do_register_end', 'redirectonreg_run', 1000000);
function redirectonreg_info()
{
return array(
"name" => "Redirect on register",
"description" => "Redirects an user on register to an help page.",
"website" => "",
"author" => "CraKteR",
"authorsite" => "mailto:crakter@gmail.com",
"version" => "2.0",
"guid" => "99586141fa6b44e0cae84ebbe3d62185",
"compatibility" => "18*",
);
}
function redirectonreg_activate()
{
global $db;
$template = array(
"tid" => NULL,
"title" => "redirect_on_register",
"template" => "<html>
<head>
<title>{\$mybb->settings[\'bbname\']} - {\$lang->breadcrumb_registered}</title>
{\$headerinclude}
</head>
<body>
{\$header}
<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<thead>
<tr>
<td class=\"thead\"><strong>{\$title}</strong></td>
</tr>
</thead>
<tbody>
{\$content}
</tbody>
</table>
<br />
{\$footer}
</body>
</html>
",
"sid" => "-1"
);
$db->insert_query("templates", $template);
}
function redirectonreg_deactivate()
{
global $db;
$db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='redirect_on_register'");
}
function redirectonreg_run()
{
global $lang;
$lang->load("registeredonreg");
redirect("registered.php", $lang->redirecting_onreg);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment