summaryrefslogtreecommitdiff
path: root/lib/partials.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-07-26 19:42:00 +0500
committerilotterytea <iltsu@alright.party>2025-07-26 19:42:00 +0500
commit2e4a3afc44c3f5e25dd1a59fbd787cc9d56798f9 (patch)
tree512e70a2368474b56232947a360a98c9e5abab21 /lib/partials.php
parentd706a8676d0127aca8e23b2c850433540d4b051e (diff)
feat: MOTD
Diffstat (limited to 'lib/partials.php')
-rw-r--r--lib/partials.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/partials.php b/lib/partials.php
index d9eaaf5..288f660 100644
--- a/lib/partials.php
+++ b/lib/partials.php
@@ -16,12 +16,25 @@ function html_big_navbar()
}
}
+ $line = null;
+ $line_path = $_SERVER['DOCUMENT_ROOT'] . '/../MOTD.txt';
+ if (file_exists($line_path) && $contents = file_get_contents($line_path)) {
+ $lines = explode("\n", trim($contents));
+ $line_count = count($lines);
+ if ($line_count > 0) {
+ $line = $lines[intval(date('j')) % $line_count];
+ }
+ }
+
echo '' ?>
<section class="column justify-center align-center gap-8 navbar">
- <div class="column justify-center grow">
+ <div class="column align-center justify-center grow">
<a href="/">
<h1><img src="<?= $brand_url ?>" alt="<?= INSTANCE_NAME ?>"></h1>
</a>
+ <?php if (isset($line)): ?>
+ <p><i>&quot;<?= $line ?>&quot;</i></p>
+ <?php endif; ?>
</div>
<div class="row gap-8 justify-center">