MyBB Community Forums

Full Version: Code to Add User to Additional User Groups?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,

I've created a sign up page for users to join a tournament which contains a list of people signed up as well as a sign up form at the bottom of the page. I want the sign up form to disappear once the user has filled it in and submitted it.

Currently when they press the submit button they are taken to a redirect page which tells them that sign up has been successful. In the background of this redirect page data is sent to a file and stored so that it can be displayed in the sign up list. I also want to make it so that the users are automatically added to a secondary/additional user group.

I have added the condition:

<if ($mybb->user['additionalgroups'] != "13") then>
...
</if>

.. around the sign up form, so that if they have already signed up they are added to that additional user group (which has id = 13) and therefore can no longer see the form and submit multiple times.

My question is: Is there some sort of command/script/code which I can put on the redirect template I created to automatically add the user to the additional user group?

This way I don't have to check the sign up list and add them manually from Admin CP.

Thanks.

Bump.

Does anyone know the MyBB template code for changing someones user group or adding them to an additional user group?