42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
require_once __DIR__ . '/lib/bootstrap.php';
|
|
$me = current_user();
|
|
|
|
page_start('Home');
|
|
p_para(setting('motd', 'Welcome!'));
|
|
|
|
if ($me) {
|
|
$n = unread_count((int)$me['id']);
|
|
p_para('Hello ' . $me['username'] . ($n ? " - you have $n new message(s)." : '.'));
|
|
$links = [
|
|
['/inbox.php', 'Inbox' . ($n ? " ($n new)" : '')],
|
|
['/forum.php', 'Forum'],
|
|
['/games.php', 'Games'],
|
|
['/profile.php', 'My profile'],
|
|
['/users.php', 'Member list'],
|
|
['/about.php', 'About this site'],
|
|
];
|
|
if ($me['is_admin']) $links[] = ['/admin/index.php', 'Admin tools'];
|
|
$links[] = ['/logout.php', 'Log out'];
|
|
p_links($links);
|
|
} else {
|
|
p_links([
|
|
['/login.php', 'Log in'],
|
|
['/signup.php', 'Sign up'],
|
|
['/forum.php', 'Browse forum'],
|
|
['/about.php', 'About this site'],
|
|
]);
|
|
}
|
|
|
|
// stats
|
|
$d = db();
|
|
$uc = (int)$d->query("SELECT COUNT(*) FROM users")->fetchColumn();
|
|
$pc = (int)$d->query("SELECT COUNT(*) FROM posts")->fetchColumn();
|
|
p_rule();
|
|
p_para("$uc members, $pc posts.");
|
|
p_para('Also on telnet: wap.txt3.net port 12300 (tailscale).');
|
|
if (!is_wml()) {
|
|
p_para('Markup mode: ' . mode() . ' (WML clients are auto-detected).', 'small');
|
|
}
|
|
page_end();
|