MyBB Community Forums
[Release] Button to Join in a group - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Releases (https://community.mybb.com/forum-102.html)
+---- Thread: [Release] Button to Join in a group (/thread-50565.html)



[Release] Button to Join in a group - ketto93 - 2009-05-30

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


RE: [Release] Button to Join in a group - AndrewPH - 2009-06-30

any screenshot for this tutorial?


RE: [Release] Button to Join in a group - kaixer - 2009-06-30

screenshot please...