2009-05-30, 01:02 PM
Hi,
I'm here to teach you to create a button to join in a group.
Ex:
{button}Click here to join in NAME GROUP{button}
After you click button you'll redirect in usercp.php and you'll join in the group automatically.
First, insert this in a template where you'd view the button:
Then insert this before
Naturally you must modify IDGROUP in all code in this thread
Good Luck
I'm here to teach you to create a button to join in a group.
Ex:
{button}Click here to join in NAME GROUP{button}
After you click button you'll redirect in usercp.php and you'll join in the group automatically.
First, insert this in a template where you'd view the button:
<form action="" method="GET">
<input type="hidden" name="enter" value="IDGROUP">
<input type="submit" value="Click here to join in NAME GROUP!"></form>
Then insert this before
?>
in global.phpif ($mybb->user['uid']) {
$lang->load("usercp");
if ($mybb->input['enter'] == "IDGROUP") {
$group = intval($mybb->input['enter']);
$query = $db->query("UPDATE ".TABLE_PREFIX."users SET usergroup = ".$group." WHERE uid = ".$mybb->user[uid]."");
redirect("usercp.php?action=usergroups", $lang->display_group_changed);
exit;
}
}
Naturally you must modify IDGROUP in all code in this thread
Good Luck