public static function ellipsizeRight($string, $max, $ellipses = '...') {
		$string = trim($string);
		
		// don't ellipsize if the string is short enough
		if (strlen($string) <= $max) {
			return $string;
		}
		
		// chop at max length
		$string = substr($string, 0, $max);
		
		$chop = strrpos($string, ' ');
		if ($chop !== false)
			$string = substr($string, 0, $chop);
		
		$string = self::removeTrailingPunctuation($string);
		$string .= $ellipses;
		
		return $string;
	}