summaryrefslogtreecommitdiff
path: root/_profile
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-12 22:01:50 +0100
committerMinteck <contact@minteck.org>2023-02-12 22:01:50 +0100
commitdc1de74470b953c9b5c7834b272df58287be8eff (patch)
tree965a5992968b872554eb676ff9141dcd286c79ab /_profile
parentde3eeee25f63de933571240b29b7cb0605472b12 (diff)
downloaddelta-dc1de74470b953c9b5c7834b272df58287be8eff.tar.gz
delta-dc1de74470b953c9b5c7834b272df58287be8eff.tar.bz2
delta-dc1de74470b953c9b5c7834b272df58287be8eff.zip
Updated 8 files and added 8 files (automated)
Diffstat (limited to '_profile')
-rw-r--r--_profile/index.php76
1 files changed, 65 insertions, 11 deletions
diff --git a/_profile/index.php b/_profile/index.php
index 5bcfb08..a7f01ca 100644
--- a/_profile/index.php
+++ b/_profile/index.php
@@ -35,8 +35,12 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
<div class="container">
<br><br>
<h1>
- <span><?= $data["nick_name"] ?? $data["first_name"] . " " . $data["last_name"] ?><?php if (isset($data["nick_name"]) && trim($data["nick_name"]) !== ""): ?> <small><small><small>(<?= $data["first_name"] . " " . $data["last_name"] ?>)</small></small></small><?php endif; ?><?php if ($data["plus"] && !$data["ultra"]): ?> <small><small><small><small><small><small><span class="badge badge-plus rounded-pill" style="vertical-align: middle; margin-top: -5px;">PLUS</span></small></small></small></small></small></small><?php elseif ($data["plus"] && $data["ultra"]): ?> <small><small><small><small><small><small><span class="badge badge-ultra rounded-pill" style="vertical-align: middle; margin-top: -5px;">ULTRA</span></small></small></small></small></small></small><?php endif; ?></span>
- <span style="float: right;"><?php if ($id === $_USER): ?><a href="/edit/<?= $id ?>" class="btn btn-outline-dark"><?= l("lang_people_edit") ?></a><?php endif; ?>
+ <span><?= $data["nick_name"] ?? $data["first_name"] . " " . $data["last_name"] ?><?php if (isset($data["nick_name"]) && trim($data["nick_name"]) !== ""): ?> <small><small><small>(<?= $data["first_name"] . " " . $data["last_name"] ?>)</small></small></small><?php endif; ?></span>
+ <span style="float: right;">
+ <div style="display: inline-block; margin-right: 10px;">
+ <?php badges($data) ?>
+ </div>
+ <?php if ($id === $_USER): ?><a href="/edit/<?= $id ?>" class="btn btn-outline-dark"><?= l("lang_people_edit") ?></a><?php endif; ?>
<div class="dropdown" style="display: inline-block;">
<button type="button" class="btn btn-outline-dark dropdown-toggle" data-bs-toggle="dropdown"><?= l("lang_profile_options") ?></button>
<ul class="dropdown-menu">
@@ -53,7 +57,8 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
</span>
</h1>
- <div id="profile-grid" style="margin-top: 20px; display: grid; grid-template-columns: repeat(2, 1fr); grid-column-gap: 20px;">
+ <div id="profile-grid" style="margin-top: 20px; display: grid; grid-template-columns: repeat(<?= hasProfileSetting("hide", false) ? "1" : "2" ?>, 1fr); grid-column-gap: 20px;">
+ <?php if (!hasProfileSetting("hide", false)): ?>
<div class="card">
<div class="card-body">
<table>
@@ -72,15 +77,18 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
</table>
</div>
</div>
+ <?php endif; ?>
<div class="card">
<div class="card-body">
- <div id="profile-grid-user" style="display: grid; grid-template-columns: 64px max-content; grid-gap: 10px;">
+ <div id="profile-grid-user" style="display: grid; grid-template-columns: <?= hasProfileSetting("photo", true) ? "64px max-content" : "1fr" ?>; grid-gap: 10px;">
+ <?php if (hasProfileSetting("photo", true)): ?>
<div style="display: flex; align-items: center;">
<img src="<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/uploads/" . $id . ".jpg") ? "/uploads/" . $id . ".jpg" : "/icons/defaultuser.svg" ?>" style="width: 64px; height: 64px; border-radius: 100%;">
</div>
+ <?php endif; ?>
<table>
<tr>
- <td><img alt="" src="/icons/age.svg" style="vertical-align: middle; width: 29px; padding-right: 5px;"></td>
+ <td style="width: 28px;"><img alt="" src="/icons/age.svg" style="vertical-align: middle; width: 29px; padding-right: 5px;"></td>
<td><?php
if (isset($data["birth"])):
@@ -88,7 +96,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
$bdate = strtotime($data["birth"]);
echo(timeAgo($bdate, false, true) . " " . l("lang_profile_old"));
- ?> (<?= l("lang_profile_birth") ?> <?= formatDate($data["birth"], false) ?>)<?php else: ?>-<?php endif; ?></td>
+ ?><?php if (hasProfileSetting("birth", true)): ?> (<?= l("lang_profile_birth") ?> <?= formatDate($data["birth"], false) ?>)<?php endif; ?><?php else: ?>-<?php endif; ?></td>
</tr>
<tr>
<?php
@@ -96,12 +104,12 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
$email = $data["email"];
?>
- <td><img alt="" src="/icons/email.svg" style="vertical-align: middle; width: 29px; padding-right: 5px;"></td>
- <td><a href="mailto:<?= $email ?>"><?= $email ?></a></td>
+ <td style="width: 28px;"><img alt="" src="/icons/email.svg" style="vertical-align: middle; width: 29px; padding-right: 5px;"></td>
+ <td><?php if (hasProfileSetting("email", true)): ?><a href="mailto:<?= $email ?>"><?= $email ?></a><?php else: ?><?= l("lang_studio_redacted") ?><?php endif; ?></td>
</tr>
<tr>
- <td><img alt="" src="/icons/phone.svg" style="vertical-align: middle; width: 29px; padding-right: 5px;"></td>
- <td><?php if (isset($data["phone"]) && $data["phone"] !== ""): ?><a href="tel:<?= str_replace(" ", "", $data["phone"]) ?>"><?= $data["phone"] ?></a><?php else: ?>-<?php endif; ?></td>
+ <td style="width: 28px;"><img alt="" src="/icons/phone.svg" style="vertical-align: middle; width: 29px; padding-right: 5px;"></td>
+ <td><?php if (hasProfileSetting("phone", true)): ?><?php if (isset($data["phone"]) && $data["phone"] !== ""): ?><a href="tel:<?= str_replace(" ", "", $data["phone"]) ?>"><?= $data["phone"] ?></a><?php else: ?>-<?php endif; ?><?php else: ?><?= l("lang_studio_redacted") ?><?php endif; ?></td>
</tr>
</table>
</div>
@@ -109,12 +117,58 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/navigation.php";
</div>
</div>
+ <?php if (hasProfileSetting("detailed", false)): ?>
+ <div id="profile-grid-2" style="margin-top: 20px; display: grid; grid-template-columns: repeat(2, 1fr); grid-column-gap: 20px;">
+ <div class="card">
+ <div class="card-body">
+ <div style="height: 28px; display: flex; align-items: center;"><b><?= l("lang_studio_details_most") ?></b></div>
+ <?php
+
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/history/" . $_USER . ".json")) {
+ $history = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/history/" . $_USER . ".json"), true);
+ } else {
+ $history = [];
+ }
+
+ uasort($history, function ($a, $b) { return $b - $a; });
+ array_filter($history, function ($i) { return getFileFromId($i) !== null; }, ARRAY_FILTER_USE_KEY);
+
+ ?>
+
+ <table>
+ <?php if (isset(array_keys($history)[0])): ?>
+ <tr>
+ <td style="width: 28px;"><img alt="" src="/icons/<?= getTypeFromId(array_keys($history)[0]) ?>.svg" style="vertical-align: middle; width: 29px; padding-right: 5px;"></td>
+ <td><a href="<?= getUrlFromId(array_keys($history)[0]) ?>"><?= getNameFromId(array_keys($history)[0]) ?></a></td>
+ </tr>
+ <?php endif; ?>
+ <?php if (isset(array_keys($history)[1])): ?>
+ <tr>
+ <td style="width: 28px;"><img alt="" src="/icons/<?= getTypeFromId(array_keys($history)[1]) ?>.svg" style="vertical-align: middle; width: 29px; padding-right: 5px;"></td>
+ <td><a href="<?= getUrlFromId(array_keys($history)[1]) ?>"><?= getNameFromId(array_keys($history)[1]) ?></a></td>
+ </tr>
+ <?php endif; ?>
+ </table>
+ </div>
+ </div>
+
+ <div class="card">
+ <div class="card-body">
+ <div style="height: 28px; display: flex; align-items: center;"><b><?= l("lang_studio_details_requests") ?></b></div>
+ <span class="text-muted">Not working as of M4</span>
+ </div>
+ </div>
+ </div>
+ <?php endif ;?>
+
<div style="margin-top: 20px;">
<?php if (isset($data["contents"]) && trim($data["contents"] !== "")): ?>
<div>
- <?= $data["contents"] ?>
+ <?= str_replace("<script>", "&lt;script&gt;", $data["contents"]) ?>
</div>
+ <?php if (!hasProfileSetting("hide", false)): ?>
<small class="text-muted"><?= str_replace("%1", timeAgo($data["update"]), l("lang_time_update")) ?></small>
+ <?php endif; ?>
<?php else: ?>
<p class="text-muted"><?= l("lang_profile_empty") ?></p>
<?php endif; ?>