aboutsummaryrefslogtreecommitdiff
path: root/members/read/index.php
blob: 0bc10296da4ec62b6797c03b71c2d298ca13ca1c (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
46
47
48
49
<?php

if (isset($_GET['m'])) {
    $config = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/data/pluralkit.json"), true);
    $data = json_decode(file_get_contents("https://api.pluralkit.me/v2/systems/$config[system]/members"), true);

    $sel = null;
    foreach ($data as $item) {
        if ($item["uuid"] === $_GET['m']) {
            $sel = $item;
        }
    }

    if ($sel === null) {
        header("Location: /members");
        die();
    }
} else {
    header("Location: /members");
    die();
}

$title = $sel['display_name'] . " | System Members"; require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/gui/header.php"; ?>

<div class="container">
    <br>
    <h1><img src="<?= $sel['avatar_url'] ?>" class="memberview-icon"> <span style="vertical-align: middle;"><?= $sel['display_name'] ?></span></h1>
    <p><?= $sel['name'] ?> | <code><?= $sel['id'] ?></code> | <code><?= $sel['uuid'] ?></code></p>
    <p><?= $sel['description'] ?? "<span class='text-muted'>No description has been provided for this system member.</span>" ?></p>

    <h3>General Info</h3>
    <p>
        <b>Date Added:</b> <?= date("l F jS, Y \a\\t G:i:s (e)", strtotime($sel["created"])) ?><br>
        <?php if (isset($sel["pronouns"])): ?><b>Pronouns:</b> <?= $sel["pronouns"] ?><br><?php endif; ?>
        <?php if (isset($sel["birthday"])): ?><b>Birthday:</b> <?= $sel["birthday"] ?><br><?php endif; ?>
        <?php if (isset($sel["color"])): ?><b>Color:</b> <span style="background-color:#<?= $sel["color"] ?>;">&nbsp;&nbsp;&nbsp;&nbsp;</span> #<?= $sel["color"] ?><?php endif; ?>
    </p>

    <?php if (count($sel["proxy_tags"]) > 0): ?>
    <h3>PluralKit Proxy Tags</h3>
    <ul>
        <?php foreach ($sel["proxy_tags"] as $tag): ?>
            <li><?= $tag["prefix"] ?><i>text</i><?= $tag["suffix"] ?></li>
        <?php endforeach; ?>
    </ul>
    <?php endif; ?>
</div>

<?php require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/gui/footer.php"; ?>