News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

What is the SQL address of boards?

Started by Plutuss, May 15, 2010, 09:00:30 AM

Previous topic - Next topic

Plutuss


I have a submission form that I want to post into SMF. The only thing I need is how to tell it which board to post in.


For example, the table of boards is, of course: smf_boards
The board ID I want it to post in is 107

Is there some shorthand to show this, like:

smf_boards:107

to get it to to post to a particular field? Thanks

Arantor

Nope. It's way more complex than that, since you have boards, topics and messages tables to fill out.

Take a look at the function database (under the Support tab) for a function called createPost() in Subs-Post.php.
Holder of controversial views, all of which my own.


Plutuss

Another option the form gives is to post via e-mail. I found this old mod for SMF 1.1:

http://custom.simplemachines.org/mods/index.php?mod=168

I am using SMF 2 RC 2. Might it work anyway?

Arantor

I suspect it would be needing a lot of changes, since 2.0 is quite a bit different under the hood.

To be able to create a post in SMF, you require the following:
* knowing who the poster is
* the subject of the post
* the content of the post

If it's an existing topic, you also need the topic's id (for replying to it)

You build three arrays, $msgOptions, $topicOptions and $posterOptions, which will include sanitising incoming data, then pass them all to Subs-Post.php's createPost() function which does the work of actually managing the DB.
Holder of controversial views, all of which my own.


Plutuss


Thank you. It's a bit over my head, but I appreciate your time.

Advertisement: