Simple Machines Community Forum

SMF Support => Converting to SMF => Topic started by: Adviesgroep Koi en vijver on February 18, 2018, 12:35:18 PM

Title: Inserting topics with MySQL
Post by: Adviesgroep Koi en vijver on February 18, 2018, 12:35:18 PM
Hi,

There may be an older topic with my question, but I could not find it after half an hour of searching. So I decided to ask for help for my problem ...

Is it possible to create new topics on a selected board using a MySQL query?

When I insert a new record in msf_messages, which is a response to a topic, I see it directly on the forum. When I start a new topic, it is not displayed on the board.

Can someone help us with this? Will save us a lot of time by constantly making topics.

Thanks.
Title: Re: Inserting topics with MySQL
Post by: vbgamer45 on February 18, 2018, 03:02:44 PM
I would use SMF's SSI with a combination of the createTopic function found in Sources/Subs-Post.php
You can also look at my rss feed poster mod for some examples of that function.
Title: Re: Inserting topics with MySQL
Post by: Kindred on February 18, 2018, 04:48:44 PM
basically, there are at least two, possibly more, tables involved with creating a topic.

Also, unless your script carefully and fully cleans the content, you are likely exposing yourself to mySQL injections...   therefore, using the SSI function(s) will be much safer as it leverages SMF's existing security measures and correctly adds content to all of the appropriate tables