summaryrefslogtreecommitdiff
path: root/includes/planner.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/planner.inc')
-rw-r--r--includes/planner.inc42
1 files changed, 21 insertions, 21 deletions
diff --git a/includes/planner.inc b/includes/planner.inc
index 1bc5143..ce6e0cb 100644
--- a/includes/planner.inc
+++ b/includes/planner.inc
@@ -4,7 +4,7 @@ require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/travelling.inc"; global $tra
require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.inc";
require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/pronouns.inc";
require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isUserLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isUserLoggedIn; global $isLowerLoggedIn;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rainbow.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
@@ -14,9 +14,11 @@ $cloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ
$raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/gdapd.json"), true);
function pacifier($id) {
+ global $isLowerLoggedIn;
+
$metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $id . ".json"), true));
- if ($metadata["pacifier"]) {
+ if ($metadata["pacifier"] && !$isLowerLoggedIn) {
return "<img title='This pony likes to sleep with a pacifier.' data-bs-toggle='tooltip' src='/assets/logo/pacifier.png' style='margin-left:auto;float: right;opacity:.75;width:24px;height:24px;vertical-align: middle; filter: invert(1);'>";
}
@@ -113,6 +115,7 @@ function formatTime($time) {
function school($time, $first = false) {
global $school;
global $_PROFILE;
+ global $isLowerLoggedIn;
$day = date('Y-m-d', $time);
$parts = [];
@@ -127,6 +130,8 @@ function school($time, $first = false) {
}
}
+ if ($isLowerLoggedIn) $parts = [];
+
if (count($parts) > 0) {
if ($first) {
return ucfirst(implode(", ", $parts));
@@ -142,7 +147,7 @@ function school($time, $first = false) {
}
}
-function day($display, $diff): void { if ($diff < 0) $disabled = true; else $disabled = false; global $cloudburst; global $raindrops; ?>
+function day($display, $diff): void { if ($diff < 0) $disabled = true; else $disabled = false; global $cloudburst; global $raindrops; global $isLowerLoggedIn; ?>
<?php if (!isset($display)) {
$display = date('l', time() + (86400 * $diff));
}
@@ -194,10 +199,10 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<?php endif; ?>
</td>
<?php if (!isset($dayCloudburst[$index][1])): ?>
- <td class="planner-cofronter-inner planner-link" style="width:5%;text-align:center;border-left-color: transparent;border-bottom-color: transparent;">
+ <td class="planner-cofronter-inner planner-link" style="width:5%;text-align:center;border-left-color: transparent;border-bottom-color: transparent;"><?php if (!$isLowerLoggedIn): ?>
<a onclick="addCofronter('cloudburst', <?= $diff ?>, <?= $index ?>);" class="planner-add-link planner-add-link-cofronter">
<span class="planner-add-link-cofronter-inner"><img src="/assets/icons/add.svg" alt="" class="planner-add-icon"></span>
- </a>
+ </a><?php endif; ?>
</td>
<?php else: ?>
<td class="planner-link" style="border-bottom-color: transparent;width:41.35vw;" colspan="2">
@@ -211,7 +216,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<?php endif; ?>
</td>
<?php endif; ?>
- <?php elseif ($index === count($dayCloudburst)): ?>
+ <?php elseif ($index === count($dayCloudburst)): if (!$isLowerLoggedIn): ?>
<td class="planner-add-inner planner-link" colspan="5" style="border-top-color: transparent;border-bottom-color: transparent;">
<a onclick="addFronter('cloudburst', <?= $diff ?>, <?= $index ?>);" id="planner-add-link-cloudburst-<?= $diff ?>" class="planner-add-link">
<div class="planner-add-link-inner">
@@ -220,7 +225,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
</div>
</a>
</td>
- <?php else: ?>
+ <?php endif; else: ?>
<td colspan="5" class="planner-empty" style="border-top-color:transparent;border-bottom-color:transparent;"></td>
<?php endif; ?>
<?php if (isset($dayRaindrops[$index])): ?>
@@ -238,13 +243,13 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<?php endif; ?>
</td>
<?php if (!isset($dayRaindrops[$index][1])): ?>
- <td class="planner-cofronter-inner planner-link" style="border-bottom-color: transparent;border-left-color: transparent;width:5%;text-align:center;">
+ <td class="planner-cofronter-inner planner-link" style="border-bottom-color: transparent;border-left-color: transparent;width:5%;text-align:center;"><?php if (!$isLowerLoggedIn): ?>
<a onclick="addCofronter('raindrops', <?= $diff ?>, <?= $index ?>);" class="planner-add-link planner-add-link-cofronter">
<span class="planner-add-link-cofronter-inner"><img src="/assets/icons/add.svg" alt="" class="planner-add-icon"></span>
- </a>
+ </a><?php endif; ?>
</td>
<?php else: ?>
- <td class="planner-link" style="width:41.35vw;" colspan="2">
+ <td class="planner-link" style="border-bottom-color:transparent;width:41.35vw;" colspan="2">
<?php $member = getMemberWithoutSystem($dayRaindrops[$index][1]); ?>
<?php if ($member["name"] === "fusion"): ?>
<a class="member-link" onclick="openEditCofronter('raindrops', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><span class="member-link-inner"><img src="/assets/logo/newlogo.png" style="filter:grayscale(1);width:24px;"> <span class="member-link-text"><span class="merge-desktop" style="opacity:.75;">Multiple merged members</span></span></span></a>
@@ -255,7 +260,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<?php endif; ?>
</td>
<?php endif; ?>
- <?php elseif ($index === count($dayRaindrops)): ?>
+ <?php elseif ($index === count($dayRaindrops)): if (!$isLowerLoggedIn): ?>
<td class="planner-add-inner planner-link" colspan="5" style="border-top-color: transparent;border-bottom-color: transparent;">
<a onclick="addFronter('raindrops', <?= $diff ?>, <?= $index ?>);" id="planner-add-link-raindrops-<?= $diff ?>" class="planner-add-link">
<div class="planner-add-link-inner">
@@ -264,7 +269,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
</div>
</a>
</td>
- <?php else: ?>
+ <?php endif; else: ?>
<td colspan="5" class="planner-empty" style="border-top-color:transparent;border-bottom-color:transparent;"></td>
<?php endif; ?>
</tr>
@@ -473,7 +478,6 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
.member-link:hover .member-link-inner, .planner-add-link:hover .planner-add-link-inner, .planner-add-link-cofronter:hover .planner-add-link-cofronter-inner {
background-color: rgba(255, 255, 255, .125);
- /*background-color: rgba(255, 255, 255, .25);*/
}
</style>
@@ -862,15 +866,15 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<p class="text-muted">Editing for the <span id="edit-fronter-system">n/a</span></p>
<div class="list-group" id="list-cloudburst">
- <a class="list-group-item list-group-item-action edit-fronter-link" onclick="deleteFronter();">
+ <a class="list-group-item list-group-item-action edit-fronter-link <?= $isLowerLoggedIn ? "disabled" : "" ?>" onclick="deleteFronter();">
<img src="/assets/icons/delete.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">Delete</span>
</a>
- <a class="list-group-item list-group-item-action edit-fronter-link" onclick="moveFronterUp();">
+ <a class="list-group-item list-group-item-action edit-fronter-link <?= $isLowerLoggedIn ? "disabled" : "" ?>" onclick="moveFronterUp();">
<img src="/assets/icons/up.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">Move up</span>
</a>
- <a class="list-group-item list-group-item-action edit-fronter-link" onclick="moveFronterDown();">
+ <a class="list-group-item list-group-item-action edit-fronter-link <?= $isLowerLoggedIn ? "disabled" : "" ?>" onclick="moveFronterDown();">
<img src="/assets/icons/down.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">Move down</span>
</a>
@@ -898,14 +902,10 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<p class="text-muted">Editing for the <span id="edit-cofronter-system">n/a</span></p>
<div class="list-group" id="list-cloudburst">
- <a class="list-group-item list-group-item-action edit-cofronter-link" onclick="deleteCofronter();">
+ <a class="list-group-item list-group-item-action edit-cofronter-link <?= $isLowerLoggedIn ? "disabled" : "" ?>" onclick="deleteCofronter();">
<img src="/assets/icons/delete.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">Delete</span>
</a>
- <!--<a class="list-group-item list-group-item-action edit-fronter-link" onclick="invertCofronter();">
- <img src="/assets/icons/invert.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
- <span style="vertical-align: middle;">Invert main and secondary fronters</span>
- </a>-->
<a class="list-group-item list-group-item-action edit-cofronter-link" onclick="viewCofronterPage();">
<img src="/assets/icons/page.svg" style="width:24px;filter:invert(1);vertical-align: middle;">
<span style="vertical-align: middle;">View page</span>