Это так понимаю не то?
foreach ($this->msgs as $r)
{
$tiempo = gmdate($this->fecha, $r->time + $this
->user->gmt * 3600);
echo '<div id="KIDE_id_' . $r->id . '" class="KIDE_msg_top">';
if ($this->show_hour) echo '<span class="KIDE_msg_hour"> ' . gmdate($this->formato_hora, $r->time + $this->user->gmt * 3600) . '</span> ';
echo '<span title="' . $tiempo . '" oncontextmenu="event.preventDefault();kide.mensaje(\'' . addslashes($r->name) . '\',' . $r->userid . ',' . $r->id . ',\'' . $r->url . '\',\'' . $tiempo . '\',\'' . $r->sesion . '\',' . $r->rango . ',\'' . $r->img . '\')" class="' . KideHelper::getRango($r->rango, 'KIDE_') . '">';
echo '<span style="cursor: pointer" title="' . $tiempo . '" onclick="kide.insertSmile(\'' . addslashes($r->name) , ', ' . '\')" class="' . KideHelper::getRango($r->rango, 'KIDE_') . '">';
echo $r->name;
echo "</span>";
$c = $r->color === '' ? 'class="' . KideHelper::getRango($r->rango, 'KIDE_dc_') . ' KIDE_msg"' : 'style="color:#' . $r->color . '"';
echo ': <span ' . $c . '>' . $r->text . ' </span>
<i class="fa fa-reply qutes" title="Цитировать" aria-hidden="true"></i>
<span class="hig K_copy"><i class="fa fa-clipboard" title="Копировать" aria-hidden="true"></i></span>
<span class="editors"><i class="fa fa-pencil" aria-hidden="true"></i></span></br>
</div>';
}