Announcement

Collapse
No announcement yet.

vB-5.4.3: extension: how to add a post

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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 customization and demonstration site.
    vBulletin 5 Documentation - Updated every Friday. Report issues here.
    vBulletin 5 API - Full / Mobile
    I am not currently available for vB Messenger Chats.

    Comment


    • #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


      • #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 customization and demonstration site.
        vBulletin 5 Documentation - Updated every Friday. Report issues here.
        vBulletin 5 API - Full / Mobile
        I am not currently available for vB Messenger Chats.

        Comment

        Related Topics

        Collapse

        Working...
        X