Advertisement:

Author Topic: Inserting topics with MySQL  (Read 736 times)

Offline Adviesgroep Koi en vijver

  • Newbie
  • *
  • Posts: 1
Inserting topics with MySQL
« 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.

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,121
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Inserting topics with MySQL
« Reply #1 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.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Online Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 56,257
  • Gender: Male
    • Kindred-999 on GitHub
Re: Inserting topics with MySQL
« Reply #2 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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.