MyBB Community Forums

Full Version: Python Flask & myBB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm creating a website using Python Flask and will be using SQLite3 for the database. I want to integrate a forum into the site preferably using myBB but I want it so that users registering on my site will already have an account/logged in on the forum. How would I be able to do this?

The forum will be a brand new installation.
The best way is to use the user datahandler which is in inc/datahandlers directory. You'll need to include the file and use the validate_user method first and then the insert_user method.
(2017-06-04, 08:04 PM)dragonexpert Wrote: [ -> ]The best way is to use the user datahandler which is in inc/datahandlers directory. You'll need to include the file and use the validate_user method first and then the insert_user method.

Is there some sort of tutorial somewhere? Not too good with php unfortunately
Can anyone point me in the right direction?
Here's how MyBB does user registration: https://github.com/mybb/mybb/blob/featur...r.php#L153
Lines 153 - 203 are the actual insert into db with the UserDataHandler.

What you need to do is make some sort of API plugin that lets you send commands from your flask app to MyBB. Basically when a user registers on your flask site, the info needs to be copied over to MyBB and inserted properly with the UserDataHandler to register with MyBB. Your API will let you pass this data between the two apps [securely hopefully] and keep your MyBB registrations identical to your website registrations.