MyBB Community Forums

Full Version: Posting Threads From Outside MyBB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I'm currently in the process of integrating my site with mybb. I'm trying to post a new thread alongside the content I post and was wondering what tables I would have to update to do this. So for example when I post certain content to my site I want to create a new thread and post it under my username. I was looking around the database and from what I could tell the only tables I would have update would be mybb_threads and mybb_posts correct? I want these threads created to be treated as if they were created by mybb.
I would definitely not just insert directly into your database because that's not going to replicate what MyBB does exactly (updating user postcounts, etc.). You'll want to use the post datahandler (inc/datahandlers/post.php) and it would probably be easiest to accomplish with a plugin that makes use of MyBB's xmlhttp.php for the request. You can hook into that file and add a function that listens for your integrated site to call it with a json payload and then uses the built-in post functionality of MyBB to actually post it.
Alright, thanks for pointing me in the right direction. I'll have to research how to create plugins and hook into files. But at least I have a better idea of which direction I should be heading.