• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved [Gesior Acc] bug character comment

Xavicrak

New Member
Joined
Mar 23, 2010
Messages
186
Reaction score
4
hi
When i write long comment in character , appears all in ONE line


sinttulotixfw.png

plz
how i can fix this???
 
Last edited:
i have fixed it, try
PHP:
$comment = $player->getComment();
			$wrapcomment = wordwrap($comment, 80, "\n", true);
			if(!empty($comment))
			{
				if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;
				$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Comment:</TD><TD>'.$wrapcomment.'<br/></i></span></TD></TR>';
			}
 
Last edited:
better version than up
PHP:
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>';
			}
 
Last edited:
Back
Top