MyBB Community Forums

Full Version: Make a button which changes usergroup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I want to make a button on my MyBB forum for anybody to click, which changes their usergroup.
Here is an example:
First Usergroup: Registered

When button is clicked

Change Usergroup To: New Usergroup

How would I go about doing this?
Custom plugin.
Here's an example on how it can be done.

$uid = $mybb->user['uid'];
$db->update_query('users', array('usergroup' => '2'), "uid=$uid");

Please note you need way more code then this to make it work. I won't spoon feed you.
Make the group open to join, this can be done by going to
AdminCP > Users & Groups > Groups > Choose the group

Scroll down to Publicly Joinable Group and check the following boxes
- Yes, users can freely join and leave this group
- Yes, users can set this group as their display group

Members will be able to freely join the group at
http://yourforum.com/usercp.php?action=usergroups
(2016-08-23, 07:10 PM)Sharree Wrote: [ -> ]Make the group open to join, this can be done by going to
AdminCP > Users & Groups > Groups > Choose the group

Scroll down to Publicly Joinable Group and check the following boxes
- Yes, users can freely join and leave this group
- Yes, users can set this group as their display group

Members will be able to freely join the group at
http://yourforum.com/usercp.php?action=usergroups

He wants a button which upgrades the user to a certain group (in this case, instantly).
I don't know much PHP... I was hoping somebody has asked about this before. Thanks for the answers anyway