summaryrefslogtreecommitdiff
path: root/public/users.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-05-10 22:55:31 +0500
committerilotterytea <iltsu@alright.party>2025-05-10 22:55:31 +0500
commit1af6b91342f8e8ee61eccf6673b5e0db6d4e7002 (patch)
treeba73e71348a21af483a4b9a12b3d95edbd0b2065 /public/users.php
parent188e05083b1034a5865ce01f2924835b8fbe4808 (diff)
feat: badges table
Diffstat (limited to 'public/users.php')
-rw-r--r--public/users.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/public/users.php b/public/users.php
index 1d803e7..3320451 100644
--- a/public/users.php
+++ b/public/users.php
@@ -344,7 +344,6 @@ if ($is_json) {
<!-- Role -->
<?php
if ($role) {
- $badge_path = sprintf("/%s/userdata/badges/%s/3x.webp", INSTANCE_STATIC_FOLDER, $role["badge_id"] ?? "");
$bg_color_split = explode(":", $role["background_color"]);
$bg_color = match ($bg_color_split[0]) {
"solid" => sprintf("background: rgba(%s);", $bg_color_split[1]),
@@ -353,11 +352,11 @@ if ($is_json) {
default => ""
};
- if (is_file($_SERVER["DOCUMENT_ROOT"] . $badge_path)): ?>
+ if ($role["badge_id"]): ?>
<div class="box row small-gap items-center" style="<?php echo $bg_color; ?>">
<div>
- <img src="<?php echo $badge_path ?>" alt="<?php echo $role["name"] ?>" width="54"
- height="54">
+ <img src="/static/userdata/badges/<?php echo $role["badge_id"] ?>/3x.webp"
+ alt="<?php echo $role["name"] ?>" width="54" height="54">
</div>
<div class="column">
<p><?php echo $role["name"] ?></p>