Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Release] Button to Join in a group

I'm here to teach you to create a button to join in a group.


{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']) {
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);

Naturally you must modify IDGROUP in all code in this thread Wink
Good Luck
MyBB Italian Lover

Messages In This Thread
[Release] Button to Join in a group - by ketto93 - 2009-05-30, 01:02 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)