MyBB Community Forums

Full Version: Making a post with a plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am making a custom page and plugin that is going to enable users to create threads with a form. In fact, they will not be able to create a thread in a forum, but will have to use the custom form to create a thread. I cannot work out the best way to create a thread with a plugin or a page, is anyone able to offer advice? Thanks.
You could insert the data into the threads table.
(2016-04-22, 10:25 PM)Sazze Wrote: [ -> ]You could insert the data into the threads table.

That's not a correct way though.

You should use post datahandler, it will ensure that every counter etc. will be updated. Examples are in newreply.php as you could expect: https://github.com/mybb/mybb/blob/featur...#L375-L515
(2016-04-23, 01:56 PM)Destroy666 Wrote: [ -> ]
(2016-04-22, 10:25 PM)Sazze Wrote: [ -> ]You could insert the data into the threads table.

That's not a correct way though.

You should use post datahandler, it will ensure that every counter etc. will be updated. Examples are in newreply.php as you could expect: https://github.com/mybb/mybb/blob/featur...#L375-L515

Ok thank you I will give it a check. I was aware I could add data straight into the database, but I had a feeling there would be something I missed along the way. I will give this a good look Smile