MyBB Community Forums

Full Version: Custom fields in registering MyBB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello MyBB Community,

I'm owning a game community and I host several gameservers. Right now, I want to make an addon to make people who join my servers sign up at my forum. This is all done in Lua, but that has nothing to do with my question.

I want to be able to let those users register, and then I want them to automaticly fill in their SteamID, which is an unique ID that is linked to the user's account where they bought and registered the games on.
Using Lua, you can grab the SteamID, and then fill it in somewhere.
What I want to achieve is that if the person clicks a button in game, they'll see a webpage showing the registration form (so ./member.php?action=register), but I want to have the SteamID field filled in already.
This field shows up because I used a plugin (xThreads profile Fields) to make them show up in the registration form.

I tried to fill in this field automaticly by using &xtpf_fid2=STEAM_0:1:20219592, or &xtpf_fid2=test behind ?action=register, but first I ran into the agreements. I disabled those because I thought it'd help, but it doesn't.

Now, I'd like to know if it's possible to fill in the user's SteamID by a variable in the URL, so we can generate a link for each player.



Then a second question.
I've seen that MyBB uses md5 encryption and a salt. If I would want to make accounts for MyBB using another method than the registration form (so, putting them into the database using MySQL), how could I make those users register? All I want is to have the users pick a name, pick a password, then automaticly fill in "fid2" with their SteamID (doesn't have to be shown in the form), and then if they click "register" they'll sign up on the website. It'll be made so one user can only make one account because if their SteamID is found in the database they can not get to the account creation again.

EDIT: Forgot to include the actual question:
In what order / what query do I have to run so the user gets created the right way, so it'll register properly and shows up on the forum?

EDIT2: Could any of you please give me the information about in what order the passwords and such get generated?

My dad and I updated the ./inc/plugins/xt_proffields.php with the following code:
we changed
$value = htmlspecialchars_uni($userfield);
to
if(!isset($value) && isset($_GET['steam_id']))
			{
			$value = $_GET['steam_id'];
			}else{
			$value = htmlspecialchars_uni($userfield);
			}

But I'd like to know an / the answer to my 2nd question.

It's urgent, I'd appriciate if someone could tell me what is required to make a manual account creation and in what order it should be executed. I suppose this is all MySQL and some PHP functions, I think those exist in Lua too.