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

Trim text to 500

Discussion in 'XenForo Development Discussions' started by LPH, Apr 1, 2013.

  1. LPH

    LPH Well-Known Member

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

    $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.


    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:

    $body XenForo_Helper_String::wholeWordTrim($body500);

Share This Page