By: Cristian R.
Date: 2003-10-09
Time: 19:23
|
Minor modification for max= parameter
Hi, just a little quick hack for the max= parameter of Merge-Fields.
As is for TBS 1.81, the max= parameter just cuts the field being printed to 'max' characters, where ever the field exceeds it. This often doesn't look nice, as words are just plain truncated.
A nicer alternative is to replace the line 677 of tbs_class.php (v1.81) wich reads :
$tbs_CurrVal = substr($tbs_CurrVal,0,$max-1).'...' ;
to this :
$tbs_CurrVal = preg_replace('/\s\S*$/','...',substr($tbs_CurrVal,0,$max-3));
This minor modification prevents words from being truncated, when the field exceeds the max= value. The result is far more better, to my modest opinion.
Hope you like the tip. Credits for this are not mine, I just stole that one from Class SDConvertText, as found at phpclasses.org
Greetz from Argentina, home of Maradona, Tando & Dulce de Leche!
|