<?php
include_once '_user.php';
?>
<!doctype html>
<html>
    <head>
        <meta charset="utf-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <title><?=$title ?? 'flash.moe message board';?></title>
        <link href="/style.css" type="text/css" rel="stylesheet"/>
    </head>
    <body>
        <div class="wrapper<?php if(user_has_flag(current_user_id(), FMF_UF_SCROLLBEYOND)) { echo ' scrollbeyond'; }?>">
            <div class="header">
                <h1>flash.moe message board</h1>
                <div class="header-wrap">
                    <div class="header-nav">
                        <a href="/">Home</a>
                        <?php if(session_active()) { ?>
                        <a href="/settings">Settings</a>
                        <a href="/logout/<?=logout_token();?>">Log out</a>
                        <?php } else { ?>
                        <a href="/login">Log in</a>
                        <a href="/register">Register</a>
                        <?php } ?>
                    </div>
                    <?php if(empty($hideSearch)) { ?>
                    <form method="get" action="/search" class="header-search">
                        <input type="search" name="q"/>
                        <input type="submit" value="Search"/>
                    </form>
                    <?php } ?>
                </div>
            </div>