function smartpartner_createMetaDescription($description, $maxWords = 100) { $myts =& MyTextSanitizer::getInstance(); $words = array(); $words = explode(" ", smartpartner_metagen_html2text($description)); $ret = ''; $i = 1; $wordCount = count($words); foreach ($words as $word) { $ret .= $word; if ($i < $wordCount) { $ret .= ' '; } $i++; } return $ret; }
function summary($maxLength = 0, $format = "S") { $ret = $this->getVar("summary", $format); if ($maxLength != 0) { if (!XOOPS_USE_MULTIBYTES) { if (strlen($ret) >= $maxLength) { $ret = xoops_substr(smartpartner_metagen_html2text($ret), 0, $maxLength); } } } return $ret; }