diff options
author | Minteck <contact@minteck.org> | 2023-02-25 19:59:31 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-25 19:59:31 +0100 |
commit | 3d77712a9ab014635c75a33ea0f491bbda6aead3 (patch) | |
tree | 616bef5215db4f1d1cea2566079db2a130363e6b /includes/homepage.inc | |
parent | 15bb1453008237edbc2cb4e82a9eb44db6f99794 (diff) | |
download | pluralconnect-3d77712a9ab014635c75a33ea0f491bbda6aead3.tar.gz pluralconnect-3d77712a9ab014635c75a33ea0f491bbda6aead3.tar.bz2 pluralconnect-3d77712a9ab014635c75a33ea0f491bbda6aead3.zip |
Updated 16 files and added 2 files (automated)
Diffstat (limited to 'includes/homepage.inc')
-rw-r--r-- | includes/homepage.inc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/includes/homepage.inc b/includes/homepage.inc new file mode 100644 index 0000000..c078e89 --- /dev/null +++ b/includes/homepage.inc @@ -0,0 +1,28 @@ +<?php + +global $app; +global $travelling; + +function newHomepage($id, $page, $title) { + $system = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $id . "/general.json"), true); + + ?> + <div class="new-homepage-system" id="new-homepage-system-<?= $id ?>"> + <?php if ($title): ?> + <a href="/<?= $page ?>" style="height: 48px; display: flex; align-items: center; justify-content: center; border-top-left-radius: 10px; border-top-right-radius: 10px; text-align: center; text-decoration: none; color: white; background-color: #<?= $system["color"] ?? "000000" ?>55" class="new-homepage-system-title" id="new-homepage-system-<?= $id ?>-title"> + <div> + <img src="<?= getAsset($id) ?>" style="width: 48px; vertical-align: middle;"><b style="vertical-align: middle; margin-left: 5px;"><?= $system["name"] ?></b> + </div> + </a> + <?php endif; ?> + + <div class="new-homepage-system-list" id="new-homepage-system-<?= $id ?>-list"> + <?php $list = array_values(withTravelers(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $id . "/members.json"), true), $id), $id)); foreach ($list as $index => $member): ?> + <a href="/<?= $member["name"] ?>" class="new-homepage-link <?= $index === count($list) - 1 ? "new-homepage-link-last" : "" ?>" style="color: white !important; text-decoration: none !important; display: block; background-color: #<?= $member["color"] ?>22; padding: 5px 10px;"> + <img src="<?= getAsset($id, $member["id"]) ?>" style="width: 32px; height: 32px; vertical-align: middle; background-color: rgba(0, 0, 0, .25); border-radius: 999px;"> + <span style="width: calc(100% - 37px); vertical-align: middle; margin-left: 5px;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;"><?= $member["display_name"] ?? $member["name"] ?></span> + </a> + <?php endforeach; ?> + </div> + </div> +<?php }
\ No newline at end of file |