Features & functions Try the demo Download Bugtracker Submit new issue

HostDrone (software) ~ minor

# 128. Layout breaks if length is above 20 in v...


Project: HostDrone (software)
Reported by: Anonymous at 2012-09-11 11:00:53

Error/issue description

Affected elements

Question concerning: Layout and design (mark-up, etc) which was written using PHP on All (platform irrelevant)

In the words of the user...

Add function that crops the length of the version output so that it doesnt break the layout if it's above 20 chars.

// FUNCTION Return a trimmed string
function doTrimString($str, $max_length){ // ex. doTrimString($myarticle, 100)
if(strlen($str) > $max_length){
$offset = ($max_length - 3) - strlen($str);
$str = substr($str, 0, strrpos($str, ' ', $offset));
}
return $str;
}


Comments