. */ require_once ROOT . '/php/replace.php'; require_once ROOT . '/php/session.php'; require_once ROOT . '/php/user.php'; $username = get_username(); if ($username === null) { $account = import(ROOT . '/html/guest.html'); } else { $admin = is_admin() ? import(ROOT . '/html/admin-link.html') : ''; $account = replace(ROOT . '/html/account.html', [ '{{username}}' => htmlspecialchars($username, ENT_QUOTES, 'UTF-8'), '{{profile}}' => rawurlencode($username), '{{admin}}' => $admin ]); } $targets = [ '{{navbar}}' => replace(ROOT . '/html/navbar.html', [ '{{account}}' => $account ]) ]; $html = replace(ROOT . '/html/header.html', $targets); echo $html; ?>