10
Let us try this:
Open smartsection/class/item.php an replace by this(around line 171):
function title($maxLength=0, $format="S")
{
$ret = $this->getVar("title", $format);
if (($format=='s') || ($format=='S') || ($format=='show')) {
$myts = &MyTextSanitizer::getInstance();
$ret = $myts->displayTarea($ret);
}
if ($maxLength != 0) {
if (mb_strlen($ret, _CHARSET) >= $maxLength) {
$ret = smartsection_substr($ret , 0, $maxLength);
}
}
return $ret;
}
Now edit smartsection/include/functions.php and replace by this(around line 145)
// Thanks to Mithrandir :-)
function smartsection_substr($str, $start, $length, $trimmarker = '...')
{
// if the string is empty, let's get out ;-)
if ($str == '') {
return $str;
}
// reverse a string that is shortened with '' as trimmarker
$reversed_string = strrev(xoops_substr($str, $start, $length, ''));
// find first space in reversed string
$position_of_space = mb_strpos($reversed_string, " ", 0, _CHARSET);
// truncate the original string to a length of $length
// minus the position of the last space
// plus the length of the $trimmarker
$truncated_string = xoops_substr($str, $start, $length-$position_of_space+mb_strlen($trimmarker,_CHARSET), $trimmarker);
return $truncated_string;
}
Did not tested it, please report back.