<?php
if (!defined('IN_OELOVE')) {
    exit('OElove[OEPHP] Access Denied');
}
function smarty_modifier_cutstring($string, $cutlen=50, $end='……'){
    $result = '';
    $cut_words = '';
    if (!empty($string)) {
        $words_count = XHandle::getWordLength($string);
        if ($words_count > 1) {
			if ($cutlen > 0) {
				$result = XHandle::cutStrLen($string, $cutlen);
			}
        }
        else {
            $result = $string;
        }
		if ($words_count > $cutlen && $cutlen>0 && !empty($end)) {
			$result = $result.$end;
		}
    }
    return $result;
}
?>