Example #1
0
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;
}
Example #2
0
 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;
 }