Hello,
I want to truncate user nickname
By searching on the web I found a function to truncate a text:
function Truncate_Text($text, $max_lenght)
{
if (strlen($text) > $max_lenght)
{
$text = substr($text, 0, $max_lenght);
$last_space = strrpos($text, "");
$text = substr($text, 0, $last_space)."...";
}
return $text;
}
echo Truncate_Text("Your example text", 20);
If the Joomla's variable which returns the nickname was as simple as "$text", I could make the change myself, but like the variable is."$ This-> _s4j-> GetUser ($ row) . "my skills in php I am unable to change the script.
Someone there can help me?
Thank you very much