MyBB Community Forums

Full Version: Register in-game.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Before mentioning: I know I posted this already, but realised it's better to post it here.

Hello MyBB Community,


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, is generated automaticly), 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.

In what order / what queries do I have to run so the user gets created the right way, so it'll register properly and shows up on the forum, and also counts towards the "newest user" and the "number of users registered"? All I want to know is how to put the things in the database and how I have to generate the salts. If you could give me small PHP snippets I might understand how everything works, but I don't know where to read if I see $query = <a lot of variables>.

What I want to achieve: A friend of mine is writing a Lua module for a game called Garry's Mod. It's meant to attract more users to our forum. People will click a button, get a registration form that asks for their password, name and email, and from this I want to put it into the database and put in "fid2" into mybb_userfields.

I'd like if someone could explain me / could write me some documentation. I've been searching for some hours but haven't found a thing. "MyBB external registration" and such didn't give me the information I needed. I'm not going to use PHP to register the people so that's why I can't use the includes for functions_user.php and such.
I'm still waiting for a reply.
You are really looking for a custom plugin - why not contact Pirata - he does custom work.

Pirata
This isn't hard if you've some basic PHP knowledge.

You could create a new column in users table for instance, steamid (or any other custom field) and check it during registration by first fetching a list of all the steamids, like:

$query = $db->query("SELECT steamid from ".TABLE_PREFIX."users");

while($list = $db->fetch_array($query))
{
$steamids = $list['steamid'];
}

if($mybb->input['steamid'] == $steamids)
{
error("The steam id you have specified already exists in our records.");
}