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

Getting Poster ID

Discussion in 'XenForo Development Discussions' started by Jeremy, Nov 20, 2010.

  1. Jeremy

    Jeremy Well-Known Member

    This may be a little 'advanced.' Is there anyway I can somehow fetch the poster ID for the post that a BB Code is being parsed in? So that BB Codes can conditionally have permission checks?
  2. Jaxel

    Jaxel Well-Known Member

    $visitor = XenForo_Visitor::getInstance();

    In templates, "$visitor" is a global variable that is accessible without declaration.
  3. Jeremy

    Jeremy Well-Known Member

    Yeah, but that's the current visitor. I am looking for the ID of the person who posted the post that I'm working with (in BB Code).
  4. Indigo

    Indigo Active Member

    That would just get the person viewing the page, not the person who made the post.

    For threads, it looks like you can override XenForo_ViewPublic_Thread_View and swap out the XenForo_ViewPublic_Helper_Message stuff for your own code. $this->_params['posts'] should contain all the message data that you'd need. Other areas like private conversations, signature/post preview, etc. may have to be looked into the same way.
  5. Jeremy

    Jeremy Well-Known Member

    Hm... That seems a lot more confusing that I wish it was. Especially cause the basis was oh so much more easy.

Share This Page