Added stuff.

This commit is contained in:
2026-03-10 14:12:55 -04:00
parent e5a92d6d4e
commit 0e72c0c8d6
2 changed files with 37 additions and 1 deletions

View File

@@ -1 +1,33 @@
<?php echo "hi" ?>
<?php
$sites = file("sites.txt", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$current = $_GET['site'] ?? '';
if (!$current) {
echo "No site specified.";
exit;
}
$index = array_search($current, $sites);
if ($index === false) {
echo "Site not in ring.";
exit;
}
$total = count($sites);
$prevIndex = ($index - 1 + $total) % $total;
$nextIndex = ($index + 1) % $total;
$prev = $sites[$prevIndex];
$next = $sites[$nextIndex];
?>
<div class="webring">
<a href="<?= htmlspecialchars($prev) ?>">← Previous</a>
|
<a href="<?= htmlspecialchars($next) ?>">Next →</a>
</div>