News:

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

Main Menu

Set topic id on createpost()

Started by tdguchi, September 19, 2014, 02:47:34 PM

Previous topic - Next topic

tdguchi

Hi, in tryin to post directly on smf from a php script, using createpost()

On topic options, there is a place to set the topic id, (1, 123, 356 etc) but, what I want is to set that getting the last id on the forum, and add 1 (I need to know the topic id of the new post created to make somethings with it)

Im creating another mysql db, and i need to add a column with topic id to build the post url later

how can i do it?

thanks

Arantor

When you create $topicOptions to pass into createPost, set an id in $topicOptions['id'].

This will only work if you already *have* a topic. If not, the process will *create* the topic, and return the topic id in $topicOptions['id'].
Holder of controversial views, all of which my own.


Advertisement: