summaryrefslogtreecommitdiff
path: root/src/partials.php
blob: d245708559260bc6096778883698ec11ffac9e08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
function html_navigation_bar()
{
    echo '' ?>
    <section class="navbar">
        <a href="/" class="brand" style="color:black;text-decoration:none;">
            <img src="/static/img/brand/mini.webp" alt="">
            <h2 style="margin-left:8px;font-size:24px;"><b><?php echo "alright.party" ?></b></h2>
        </a>
        <div class="links">
            <a href="/emotes" class="button">Emotes</a>
            <a href="/users.php" class="button">Users</a>
            <a href="/emotes/upload.php" class="button">Upload</a>
            <a href="/account" class="button">Account</a>
        </div>
        <?php
        if (isset($_SESSION["user_id"])) {
            echo '' ?>
            <a href="/users.php?id=<?php echo $_SESSION["user_id"] ?>" class="links" style="margin-left:auto;">
                Signed in as <?php echo $_SESSION["user_name"] ?> <img
                    src="/static/userdata/avatars/<?php echo $_SESSION["user_id"] ?>" width="24" height="24" />
            </a>
            <?php ;
        }
        ?>
    </section>
    <?php ;
}

function html_navigation_search()
{
    echo '' ?>
    <section class="box">
        <div class="box navtab">
            Search...
        </div>
        <div class="box content">
            <form action="<?php echo $_SERVER["REQUEST_URI"] ?>" method="GET">
                <input type="text" name="q" style="padding:4px;" value="<?php echo $_GET["q"] ?? "" ?>"><br>
                <button type="submit" style="width:100%;margin-top:6px;">Find</button>
            </form>
        </div>
    </section>
    <?php ;
}