za znaki końca linii, przycina, prawdopodobnie będzie wstawiać * ------------------------------------------------------------- */ function smarty_function_formatText($params, &$smarty) { require_once $smarty->_get_plugin_filepath('modifier', 'truncate'); if (!isset($params['lenght'])) { $lenght = CONTENT_MAX_DISP_LEN; } else { $lenght = $params['lenght']; unset($params['lenght']); } if (!isset($params['etc'])) { $etc = '...'; } else { $etc = $params['etc']; unset($params['etc']); } $string = $params['text']; unset($params['text']); if (!isset($params['moreTitle'])) { $wiecejT = "Zobacz więcej"; } else { $wiecejT = $params['moreTitle']; unset($params['moreTitle']); } if (!isset($params['moreName'])) { $wiecejN = " "; } else { $wiecejN = $params['moreName']; unset($params['moreName']); } $string = nl2br($string); if(isset($params['urlWiecej'])) $params['moreUrl'] = $params['urlWiecej']; if (is_integer($lenght)) { if (!isset($params['moreUrl']) && !isset($params['noMoreUrl'])) { $moreArr = array(); foreach ($params as $key => $val) { if($key != "limit") $moreArr[] = "$key,$val"; } $params['moreUrl'] = implode(',', $moreArr); $params['moreUrl'] .= ".html"; } $string = smarty_modifier_truncate($string, $lenght, $etc); } if (isset($params['moreUrl']) && $params['moreUrl']) { $more = ' '.$wiecejN.''; } else { $more = ''; } return $string . $more; } ?>