News:

Wondering if this will always be free?  See why free is better.

Main Menu

Create new Thread programatically

Started by MrManager, October 05, 2011, 06:49:56 PM

Previous topic - Next topic

MrManager

I would like to add a commenting system to my website that integrates with my SMF. My idea was to create a new thread for every item on my website and then list the latest posts in that thread as "comments" on that item. The commenting itself would take place in the forums themselves, so there is no user account integration or posting form on my site required.

To do this, I need some sort of API function to create the thread and one to get the latest posts from a given thread. I already checked SSI.php, but it doesn't seem to have anything like this.

Is there a way to do this, ideally without installing additional mods?

MrManager

I guess one option would be to create a custom action (http://wiki.simplemachines.org/smf/Add_a_custom_action_using_integration_hooks) and then calling createPost (http://support.simplemachines.org/function_db/index.php?action=view_function;id=323) from there. Would this be a good way? Are there modifications that already add this functionality, so I wouldn't have to write it myself?

vbgamer45

You would use SSI.php included on top of your website then call the createpost function to create entries in your forum with the data that you pass to that function.
Community Suite for SMF - Grow your forum with 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

MrManager

The thing is I don't have access to the filesystem of my forums from the other site. So all communication would have to happen over HTTP (REST).

Illori

to be able to do that would be a major security risk if it was even possible.

MrManager

Well of course the requests would have to be authenticated somehow.

Kindred

but they are not....   there is no authentication like that built into the system because it was never intended to be used cross-sites like that.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kays

But is a back end really needed? ???

If the page is just HTML, It can be posted on the boards using the html tag. Then a display page can be created using SSI.php. The first post can be displayed using ssi_BoardNews()  and the replies or comments can be pulled using a modified ssi function or by a separate query.

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

Advertisement: