Changeset 988
- Timestamp:
- 06/15/08 15:31:07 (6 months ago)
- Files:
-
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/lib/jelix/plugins/tpl/common/modifier.truncate.php (modified) (2 diffs)
- branches/1.0.x/lib/jelix/plugins/tpl/common/modifier.truncate.php (modified) (2 diffs)
- branches/1.0.x/lib/jelix/plugins/tpl/common/modifier.truncate.php (modified) (2 diffs)
- branches/1.0.x/lib/jelix/plugins/tpl/common/modifier.truncate.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0.x/lib/jelix/CREDITS
r956 r988 97 97 - Contribution on jResponseRss and jResponseAtom 98 98 - jdb driver for Intuition 99 - resolved memory exhausted errors in truncate modifier (#511) 99 100 100 101 Kévin Lepeltier (aka Lipki) branches/1.0.x/lib/jelix/CREDITS
r956 r988 97 97 - Contribution on jResponseRss and jResponseAtom 98 98 - jdb driver for Intuition 99 - resolved memory exhausted errors in truncate modifier (#511) 99 100 100 101 Kévin Lepeltier (aka Lipki) branches/1.0.x/lib/jelix/CREDITS
r956 r988 97 97 - Contribution on jResponseRss and jResponseAtom 98 98 - jdb driver for Intuition 99 - resolved memory exhausted errors in truncate modifier (#511) 99 100 100 101 Kévin Lepeltier (aka Lipki) branches/1.0.x/lib/jelix/CREDITS
r956 r988 97 97 - Contribution on jResponseRss and jResponseAtom 98 98 - jdb driver for Intuition 99 - resolved memory exhausted errors in truncate modifier (#511) 99 100 100 101 Kévin Lepeltier (aka Lipki) branches/1.0.x/lib/jelix/plugins/tpl/common/modifier.truncate.php
r506 r988 6 6 * @author 7 7 * @contributor Laurent Jouanneau (utf8 compliance) 8 * @contributor Yannick Le Guédart 8 9 * @copyright 2001-2003 ispi of Lincoln, Inc., 2007 Laurent Jouanneau 10 * @copyright 2008 Yannick Le Guédart 9 11 * @link http://smarty.php.net/ 10 12 * @link http://jelix.org/ … … 29 31 */ 30 32 function jtpl_modifier_common_truncate($string, $length = 80, $etc = '...', 31 $break_words = false)33 $break_words = false) 32 34 { 33 if ($length == 0) 35 if (function_exists ('mb_strlen')) { 36 $f_strlen = 'mb_strlen'; 37 } 38 else { 39 $f_strlen = 'iconv_strlen'; 40 } 41 42 if (function_exists ('mb_substr')) { 43 $f_substr = 'mb_substr'; 44 } 45 else { 46 $f_substr = 'iconv_substr'; 47 } 48 49 if($length == 0) 34 50 return ''; 35 51 $charset = jTpl::getEncoding(); 36 if (iconv_strlen($string,$charset) > $length) {37 $length -= iconv_strlen($etc,$charset);38 if (!$break_words)39 $string = preg_replace('/\s+?(\S+)?$/', '', iconv_substr($string, 0, $length+1,$charset));40 52 41 return iconv_substr($string, 0, $length,$charset).$etc; 53 if($f_strlen ($string,$charset) > $length) { 54 $length -= $f_strlen($etc,$charset); 55 if(!$break_words) 56 $string = preg_replace('/\s+?(\S+)?$/', '', $f_substr($string, 0, $length+1,$charset)); 57 return $f_substr($string, 0, $length,$charset).$etc; 42 58 } else 43 59 return $string; 44 60 } 61 45 62 ?> branches/1.0.x/lib/jelix/plugins/tpl/common/modifier.truncate.php
r506 r988 6 6 * @author 7 7 * @contributor Laurent Jouanneau (utf8 compliance) 8 * @contributor Yannick Le Guédart 8 9 * @copyright 2001-2003 ispi of Lincoln, Inc., 2007 Laurent Jouanneau 10 * @copyright 2008 Yannick Le Guédart 9 11 * @link http://smarty.php.net/ 10 12 * @link http://jelix.org/ … … 29 31 */ 30 32 function jtpl_modifier_common_truncate($string, $length = 80, $etc = '...', 31 $break_words = false)33 $break_words = false) 32 34 { 33 if ($length == 0) 35 if (function_exists ('mb_strlen')) { 36 $f_strlen = 'mb_strlen'; 37 } 38 else { 39 $f_strlen = 'iconv_strlen'; 40 } 41 42 if (function_exists ('mb_substr')) { 43 $f_substr = 'mb_substr'; 44 } 45 else { 46 $f_substr = 'iconv_substr'; 47 } 48 49 if($length == 0) 34 50 return ''; 35 51 $charset = jTpl::getEncoding(); 36 if (iconv_strlen($string,$charset) > $length) {37 $length -= iconv_strlen($etc,$charset);38 if (!$break_words)39 $string = preg_replace('/\s+?(\S+)?$/', '', iconv_substr($string, 0, $length+1,$charset));40 52 41 return iconv_substr($string, 0, $length,$charset).$etc; 53 if($f_strlen ($string,$charset) > $length) { 54 $length -= $f_strlen($etc,$charset); 55 if(!$break_words) 56 $string = preg_replace('/\s+?(\S+)?$/', '', $f_substr($string, 0, $length+1,$charset)); 57 return $f_substr($string, 0, $length,$charset).$etc; 42 58 } else 43 59 return $string; 44 60 } 61 45 62 ?> branches/1.0.x/lib/jelix/plugins/tpl/common/modifier.truncate.php
r506 r988 6 6 * @author 7 7 * @contributor Laurent Jouanneau (utf8 compliance) 8 * @contributor Yannick Le Guédart 8 9 * @copyright 2001-2003 ispi of Lincoln, Inc., 2007 Laurent Jouanneau 10 * @copyright 2008 Yannick Le Guédart 9 11 * @link http://smarty.php.net/ 10 12 * @link http://jelix.org/ … … 29 31 */ 30 32 function jtpl_modifier_common_truncate($string, $length = 80, $etc = '...', 31 $break_words = false)33 $break_words = false) 32 34 { 33 if ($length == 0) 35 if (function_exists ('mb_strlen')) { 36 $f_strlen = 'mb_strlen'; 37 } 38 else { 39 $f_strlen = 'iconv_strlen'; 40 } 41 42 if (function_exists ('mb_substr')) { 43 $f_substr = 'mb_substr'; 44 } 45 else { 46 $f_substr = 'iconv_substr'; 47 } 48 49 if($length == 0) 34 50 return ''; 35 51 $charset = jTpl::getEncoding(); 36 if (iconv_strlen($string,$charset) > $length) {37 $length -= iconv_strlen($etc,$charset);38 if (!$break_words)39 $string = preg_replace('/\s+?(\S+)?$/', '', iconv_substr($string, 0, $length+1,$charset));40 52 41 return iconv_substr($string, 0, $length,$charset).$etc; 53 if($f_strlen ($string,$charset) > $length) { 54 $length -= $f_strlen($etc,$charset); 55 if(!$break_words) 56 $string = preg_replace('/\s+?(\S+)?$/', '', $f_substr($string, 0, $length+1,$charset)); 57 return $f_substr($string, 0, $length,$charset).$etc; 42 58 } else 43 59 return $string; 44 60 } 61 45 62 ?> branches/1.0.x/lib/jelix/plugins/tpl/common/modifier.truncate.php
r506 r988 6 6 * @author 7 7 * @contributor Laurent Jouanneau (utf8 compliance) 8 * @contributor Yannick Le Guédart 8 9 * @copyright 2001-2003 ispi of Lincoln, Inc., 2007 Laurent Jouanneau 10 * @copyright 2008 Yannick Le Guédart 9 11 * @link http://smarty.php.net/ 10 12 * @link http://jelix.org/ … … 29 31 */ 30 32 function jtpl_modifier_common_truncate($string, $length = 80, $etc = '...', 31 $break_words = false)33 $break_words = false) 32 34 { 33 if ($length == 0) 35 if (function_exists ('mb_strlen')) { 36 $f_strlen = 'mb_strlen'; 37 } 38 else { 39 $f_strlen = 'iconv_strlen'; 40 } 41 42 if (function_exists ('mb_substr')) { 43 $f_substr = 'mb_substr'; 44 } 45 else { 46 $f_substr = 'iconv_substr'; 47 } 48 49 if($length == 0) 34 50 return ''; 35 51 $charset = jTpl::getEncoding(); 36 if (iconv_strlen($string,$charset) > $length) {37 $length -= iconv_strlen($etc,$charset);38 if (!$break_words)39 $string = preg_replace('/\s+?(\S+)?$/', '', iconv_substr($string, 0, $length+1,$charset));40 52 41 return iconv_substr($string, 0, $length,$charset).$etc; 53 if($f_strlen ($string,$charset) > $length) { 54 $length -= $f_strlen($etc,$charset); 55 if(!$break_words) 56 $string = preg_replace('/\s+?(\S+)?$/', '', $f_substr($string, 0, $length+1,$charset)); 57 return $f_substr($string, 0, $length,$charset).$etc; 42 58 } else 43 59 return $string; 44 60 } 61 45 62 ?>
