How to transfer users or usergroups to a new location (Used with banned users). Forwards all banned users to an IRC-page (CGI:IRC)
This is a draft that only exists as plugin code.
Plugin code [global_start]:
This is a draft that only exists as plugin code.
Plugin code [global_start]:
PHP Code:
// Default redirect
$redirurl = "/javachat.php";
// Compatibility
$doredir = 0;
// Where's the user placed?
$ugroup = $vbulletin->userinfo['usergroupid'];
// What's the id for this user?
$uid = $vbulletin->userinfo['usergroupid'];
// Disabled - Fix the db and a possible usergroupcache-handler
/*
// Grab some data from the usergroup (I failed to use the usergroupcache)
$groupdata = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = '$ugroup' LIMIT 1");
// Is the irc-flag in the userdb set to 1 for this user?
if ($vbulletin->userinfo['irc'] > 0) {$forceip = $vbulletin->userinfo['irc'];}
// Is the irc-flag in the usergroupdb set to 1?
if ($groupdata['irc'] > 0) {$forceip = $groupdata['irc'];}
*/
// Usergroup 8, banned users, force irc
if ($ugroup == 8) {$forceirc = 1;}
// If something is true, start redirecting to IRC
if ($forceirc == 1 || $forceip == 1 || $yeschat == 1) {
$doredir = 1;
// Convert the nickname (for CGI:IRC) to urlencoded text
$setnickname = urlencode($vbulletin->userinfo['username']);
// If it's a redirected guest, create the nickname here
if ($vbulletin->userinfo['userid'] < 1) {$setnickname = "BGroup" . random(65535, 131070);}
// This is the url to where the IRC-site is (CGI:IRC
$redirurl = "http://bb.tornevall.net/irc.cgi?interface=ie&Channel=%23bigbrother&Server=dynamic-1.tornevall.net&Nickname=" . $setnickname . "&submit=start";
// If we have a normal redirection, put it here...
// Actually, you can do whatever you want with those parts...
if ($yeschat == 1) {$redirurl = "http://forum.tornevall.net/javachat.php";}
}
// Prevent internal loops in the redirection (well.. since this script
// is called from global, you should change this to whatever you like,
// so you're redirected correctly without loops
if (THIS_SCRIPT != 'javachatlite' && THIS_SCRIPT != 'javachat') {
// doredir == 1 ? (This is an old newbie-setting from an earlier version, still used here)
if ($doredir == 1) {exec_header_redirect("$redirurl");}
}
