We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12379
    • 460 Posts
    With setting PieX’s character limit display in the placeholder [+description(type,number)+], is there any way of limiting by complete words instead of by the number of characters or is the snippet limited by SimplePie?
      Mostly harmless.
      • 12379
      • 460 Posts
      In PieX snippet I’ve changed two instances of:

       {
            $len = intval($option[1]);
            $value = mb_strimwidth($value, 0, $len,"...","UTF-8");
       }


      ...to:

      {
            $len = intval($option[1]);
            $output_trimmed = substr($value, 0, $len);
            $end_space = strrpos($output_trim, " ");
            $value = mb_strimwidth($output_trimmed, 0,  $end_space,"...","UTF-8");
      } 
      

      Words still being truncated sad
        Mostly harmless.
        • 12379
        • 460 Posts
        Works now, guess utf8 encoding’s just gonna have to hang off the back.

        $value = substr($output_trimmed, 0, $end_space) . " [...]";
        $value = utf8_encode($value);
          Mostly harmless.