add online users

This commit is contained in:
themohooks 2024-07-08 23:52:22 +03:00
parent 9941f1e561
commit 6a9c46eb00

View file

@ -185,8 +185,16 @@ foreach ($photos as $pd) {
<h4>Сейчас на сайте (<?=DB::query('SELECT COUNT(*) FROM users WHERE online>=:time-300 ORDER BY online DESC', array(':time'=>time()))[0]['COUNT(*)']?>)</h4>
<div>
<?php
$online = DB::query('SELECT * FROM users WHERE online>=:time-300 ORDER BY online DESC', array(':time'=>time()));
foreach ($online as $o) {
echo '<a href="/author/'.$o['id'].'/">'.$o['username'].'</a>, ';
}
?>
</div>
</td> </td>
</tr> </tr>
</table> </table>