mirror of
https://github.com/claradex/nativegallery.git
synced 2024-12-23 00:50:55 +03:00
add online users
This commit is contained in:
parent
9941f1e561
commit
6a9c46eb00
1 changed files with 9 additions and 1 deletions
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue