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

Trim text to 500

LPH

Well-known member
#1
I'd like to modify the code so that the content is wholeWordTrim($content, 500) as it is in the resource manager:

PHP:
$body = '[quote]' . XenForo_Helper_String::autoLinkBbCode(XenForo_Html_Renderer_BbCode::renderFromHtml(nl2br($content))) . "[/quote]";

Could the content be trimmed prior to the above line ? I tried something like that before this line and it failed to write the thread.

:unsure:

Update: In case someone trips over this post. The answer was too obvious. I was missing the XenForo_Helper_String ...

Here is the working code:

PHP:
$body = XenForo_Helper_String::wholeWordTrim($body, 500);