News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Sending a post to the forum by my own control panel

Started by subzero_mb, June 09, 2010, 10:20:15 AM

Previous topic - Next topic

subzero_mb

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

Arantor


subzero_mb

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

Kays

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 board for it.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

subzero_mb

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?

Kays

Yes, $topicOptions['id'] and $msgOptions['id'] will have those values.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Advertisement: