Fix chat msg dublications
This commit is contained in:
parent
e13e29c8ee
commit
7618c3d64c
5
chat.php
5
chat.php
@ -29,10 +29,9 @@ FROM `chat` ORDER BY `id` ASC LIMIT 50');
|
||||
while ($message = $chat->fetch_assoc()) {
|
||||
$d = new DateTime($message['msgdate']);
|
||||
$m = htmlspecialchars($message['msg']);
|
||||
if (!empty($message['type'])) {
|
||||
if ($message['type'] == 'sys') {
|
||||
echo sprintf('<span style="color:maroon">%s %s</span>', $d->format('H:i'),$m)." <br>";
|
||||
}
|
||||
echo sprintf('%s [%s]: %s', $d->format('H:i'),$message['from'],$m)." <br>";
|
||||
} else echo sprintf('%s [%s]: %s', $d->format('H:i'),$message['from'],$m)." <br>";
|
||||
}
|
||||
}
|
||||
show_messages();
|
||||
|
Loading…
Reference in New Issue
Block a user