function wordlength($txt, $limit)
{
$words = explode(' ', $txt);
foreach($words as $v)
{
if(strlen($v) > $limit)
{
return false;
}
}
return true;
}
$comment = $player->getComment();
$newlines = array("\r\n", "\n", "\r");
$comment_with_lines = str_replace($newlines, '<br />', $comment, $count);
if($count < 50)
$comment = $comment_with_lines;
$wrapcomment = wordwrap($comment, 75, "\n", true);
if(!empty($comment))
{
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
if(!wordlength($comment, 75))
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Comment:</TD><TD>'.$wrapcomment.'<br/></i></span></TD></TR>';
else
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Comment:</TD><TD>'.$comment.'<br/></i></span></TD></TR>';
}