Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Release] Button to Join in a group
#1
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:
<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.php

if ($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 Wink
Good Luck
Hi,
Ketto93
_______________________
MyBB Italian Lover
Reply
#2
any screenshot for this tutorial?
<signature too big>
Reply
#3
screenshot please...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)