1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Create new topic from another program.

Discussion in 'XenForo Pre-Sales Questions' started by Durwin De La Rue, Aug 24, 2015.

  1. Durwin De La Rue

    Durwin De La Rue New Member

    We need to be able to create a new thread from our program. During an event in our program, can a new thread be created in XenForo?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    It's possible but it would require custom development.
  3. Durwin De La Rue

    Durwin De La Rue New Member

    Can you elaborate? Custom on your side? Or coding on our side? I expect we would need to make some API call or communicate with XenForo in some fashion.
  4. Amaury

    Amaury Well-Known Member

    The latter.
  5. Durwin De La Rue

    Durwin De La Rue New Member

    So do you have API calls for this or is it done via sockets?
  6. Amaury

    Amaury Well-Known Member

    That I'm not sure of, but once you're licensed you'll be able to ask for support on that. :)
  7. James

    James Well-Known Member

    There is an API addon but you are able to instantiate XenForo from an external application and use its datawriter functions to create yourself a new thread.
  8. Durwin De La Rue

    Durwin De La Rue New Member

    The only problem with that is, I need to know for a *fact* that I can create a new thread from my program before I commit to purchasing.
  9. Chris D

    Chris D XenForo Developer Staff Member

    You can write your own API for this relatively easily.

    In vague terms, a thread can be created by instantiating XenForo and its dependencies (you can see how this is done by looking at XenForo's index.php file when you have access to it) then creating the relevant DataWriter object, setting the relevant fields, and running save on that object.

    This requires some knowledge of XF, but equally it's not an especially difficult concept to grasp.

    There are also at least two API add-ons that may provide the functionality in a more straight forward way, but, honestly, it really is relatively simple to do with some simple code.

    So, yes, it is a fact that you can programatically create a new thread from your application.
  10. Matthew S

    Matthew S Member

    I apologise if this isn't helpful, but you can create threads from RSS feeds, too. Have a play in the demo.

Share This Page