I have a control panel in my website to publish news in the blog, but I would like to send automatically this new also to the forum.
So, I would like to save the post in my personal database (to use in my blog) and to save in SMF databases to show in the forum.
Is there any function where you send title, text, author and ID of the sub-forum and automatically publish it in the forum??
And if it is not, is there any documentation where I can see what tables in the database are modified when a user create a new topic?
Thank you very much
http://support.simplemachines.org/function_db/index.php?action=view_function;id=323 is the function responsible for creating posts.
Thank you very much, I have dedicate so much time to create my own function to do that and I didn't notice to watch for it in the Source :(
But now, I have my Control Panel, outside of the website and the forum, so how can I call that function in my Control Panel? I just include the Subs-Post.php file inside? I don't think so because there are some globals inside.. :o
You could do that if SSI.php was included. In fact then you could use any of the SMF functions.
You should be able to find examples of how to use createPost if you searched the SMF Coding Discussion (http://www.simplemachines.org/community/index.php?board=60.0) board for it.
Ok, thank you, now everything work properly. Just one question more, when I create the post using the function createPost I would need the topic ID and mesage ID to save then in my own database, but as I can see in the documentation the function just return true or false. Is there any way to get the ID of the post and topic created?
Yes, $topicOptions['id'] and $msgOptions['id'] will have those values.