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

Smiley parsing

Aayush

Well-known member
#1
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!

Thanks
 

Chris D

XenForo developer
Staff member
#2
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.

Code:
{xen:helper bbCode, $bbCodeParser, $yourStringToParse}
 

Aayush

Well-known member
#3
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.

Code:
{xen:helper bbCode, $bbCodeParser, $yourStringToParse}
You I nest {xen:helper} ? Cause I am already using a helper on the text already

Thanks for help @Chris Deeming
 

Aayush

Well-known member
#4
Code:
 $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
 

Chris D

XenForo developer
Staff member
#5
I think they are nestable. Would probably be better to parse the bbcode in the PHP callback though.