update
This commit is contained in:
27
core/plugins/Smarty/modifier.shortThreadTitle.php
Normal file
27
core/plugins/Smarty/modifier.shortThreadTitle.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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;
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user