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

Finding $user of a post

Discussion in 'XenForo Development Discussions' started by Gossamer, Jun 14, 2014.

  1. Gossamer

    Gossamer Active Member

    Hello! So, I've been working on a small addition to my forum and I'm a bit stumped on one part of it. I've written a function that looks at a user, and returns the parent user if one exists (this ties into Waindigo's sub-accounts add-on). I'm trying to display the parent user (if it exists) with the member information in a couple of areas.

    I've already done this once by inserting a template into member_view and extending ControllerPublic_Member to pass my new variables to it. Works perfectly.

    I'm trying to do the same thing by inserting a template into message_user_info. However, I'm having trouble figuring out how to grab the $user variable from the appropriate post to feed into my function.

    I'm currently looking at extending ControllerPublic_Threads, but I'm not sure how or what to extend to get the $user of a post author and then pass two custom variables back for individual posts within a thread.

    I hope that makes sense. XD Any help would be greatly appreciated.
  2. Jeremy

    Jeremy Well-Known Member

    The user information on posts is mapped from the $message variable into the $user variable.

Share This Page