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

Smiley parsing

Discussion in 'XenForo Development Discussions' started by Aayush, Feb 3, 2014.

  1. Aayush

    Aayush Well-Known Member

    I am outputting some text in a custom page. I am not sure how to parse the text to show smilies, maybe a helper or something else to parse the text would do it, but I am not able to find it out. Somebody knowing about it can help!

  2. Chris D

    Chris D XenForo Developer Staff Member

    You would need to use a PHP callback. That's the only way to access the BB code parser. You can actually then pass it to the page as a param and then use the BB code helper on the string you want to parse, e.g.

    {xen:helper bbCode, $bbCodeParser, $yourStringToParse}
  3. Aayush

    Aayush Well-Known Member

    You I nest {xen:helper} ? Cause I am already using a helper on the text already

    Thanks for help @Chris Deeming
  4. Aayush

    Aayush Well-Known Member

     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('XenForo_BbCode_Formatter_BbCode_AutoLink', false));
    I am passing this as a viewParam, but it still doesn't parse
  5. Chris D

    Chris D XenForo Developer Staff Member

    I think they are nestable. Would probably be better to parse the bbcode in the PHP callback though.
  6. Aayush

    Aayush Well-Known Member

    How would I do that?

Share This Page