24 lines
786 B
PHP
24 lines
786 B
PHP
<?php
|
|
require_once __DIR__ . '/lib/bootstrap.php';
|
|
$me = current_user();
|
|
$page = max(1, (int)($_GET['p'] ?? 1));
|
|
$off = ($page - 1) * PER_PAGE;
|
|
|
|
$s = db()->prepare("SELECT id,username,tagline,last_seen,is_admin FROM users
|
|
ORDER BY username LIMIT ? OFFSET ?");
|
|
$s->execute([PER_PAGE + 1, $off]);
|
|
$rows = $s->fetchAll();
|
|
$more = count($rows) > PER_PAGE;
|
|
if ($more) array_pop($rows);
|
|
|
|
page_start('Members', ['back' => '/index.php']);
|
|
foreach ($rows as $r) {
|
|
$lab = $r['username'] . ($r['is_admin'] ? ' [a]' : '')
|
|
. ($r['last_seen'] ? ' (' . ago((int)$r['last_seen']) . ')' : '');
|
|
p_link('/profile.php', $lab, ['id' => $r['id']]);
|
|
}
|
|
if (!$rows) p_para('No members.');
|
|
p_pager('/users.php', $page, $more);
|
|
p_links([['/index.php', 'Home']]);
|
|
page_end();
|