vB-5.4.3: extension: how to add a post

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • m97forum
    Member
    • Jun 2017
    • 54
    • 5.3.x

    vB-5.4.3: extension: how to add a post

    Hi,

    I'm about to extend my vB-5.4.3 installation. I'm going to set up a message listener (waiting e.g. for incoming messages on Threema) and have post to vB. This posting needs to be created in the user's session (I maintain a user mapping, such that I know the user's vB-userID).

    1. how can I create such a user session, knowing the user's id, but no credentials?
    2. once I have that user session, how do I create a post, assuming I know the threadId?

    Thanks a lot.
    Stefan
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 73976

    #2
    1) The API doesn't allow for this.

    2) http://vb5support.com/resources/api/vB_Api_Node.html

    You should be able to set the userid and name on the Node when it is created.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    • m97forum
      Member
      • Jun 2017
      • 54
      • 5.3.x

      #3
      Hello Wayne,

      thanks for your reply.

      1. ok, I'll see, if that actually becomes a hurdle. I wanted to run closely to the UI's way of adding content, since it takes care of security checks etc.... I'll see
      2. so I run create a new Node(), set my values and call vB_Api_Content_Text->add(...) right (for textual content)? I haven't found anything else suitable. Does that also trigger the hookFrontendContentAfterAdd?

      Thanks and have a nice weekend.
      Stefan

      Comment

      • Wayne Luke
        vBulletin Technical Support Lead
        • Aug 2000
        • 73976

        #4
        The hook is in the front-end controller. It would not be triggered by a direct API call. You would most likely want to use PHP and extend the Node API class to call your code that would have been triggered by the hook. Please look at the example packages in the do_not_upload folder as well as the twitterlogin and googlelogin packages in /core/packages for examples of extending the code.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment

        Related Topics

        Collapse

        Working...