27 lines
505 B
PHP
27 lines
505 B
PHP
<?php
|
||
/**
|
||
* @author mago
|
||
*/
|
||
|
||
function smarty_modifier_shortThreadTitle($string) {
|
||
|
||
/* nie wywali<6C>em tego na zewn<77>trz bo to w sumie tylko w jednym miejscu jest potrzebne
|
||
* nie podejrzewam <20>eby kto<74> jeszcze tego u<>ywa<77>
|
||
* */
|
||
$letterLimit = 25;
|
||
|
||
$arr = explode(' ',$string);
|
||
|
||
$ret = '';
|
||
|
||
foreach($arr AS $k => $v){
|
||
$spacer = ($k>0?' ':'');
|
||
if(strlen($ret.$spacer.$v) <= $letterLimit)$ret .= $spacer.$v;
|
||
}
|
||
|
||
if(strlen($string) > strlen($ret))$ret .= '...';
|
||
|
||
return $ret;
|
||
|
||
}
|
||
?>
|