Chat output

This commit is contained in:
lopar 2018-03-02 22:47:04 +02:00
parent af75583404
commit 16704acba7
2 changed files with 7 additions and 2 deletions

View File

@ -17,12 +17,13 @@ $uid = $_SESSION['uid'];
if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg);
$chat = db::c()->query('SELECT * FROM `chat` ORDER BY `id` ASC LIMIT 50');
$chat = db::c()->query('SELECT `msg`, `msgdate`, (SELECT `login` FROM `users` WHERE `users`.`id` = `uid`) AS `from` FROM `chat` ORDER BY `id` ASC LIMIT 50');
while ($message = $chat->fetch_assoc()) {
$d = new DateTime($message['msgdate']);
$m = htmlspecialchars($message['msg']);
echo $d->format('H:i').": " . $m."<br>";
// echo $d->format('H:i').": " . $m."<br>";
sprintf('$s [%s]: $s <br>', $d->format('H:i'),$message['from'],$m);
}

View File

@ -1467,6 +1467,10 @@ function getslot($i, $user1 = 0)
}
}
function nickname(){
$s=1;
}
function nick($user)
{
$r = '';