From 898b52edcb47bcb3e9d6106e74ca73e74ea01e70 Mon Sep 17 00:00:00 2001 From: sillylaird Date: Thu, 3 Sep 2026 00:33:59 +0000 Subject: import live www.sillylaird.ca webroot --- startpage/render_cards.php | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 startpage/render_cards.php (limited to 'startpage/render_cards.php') diff --git a/startpage/render_cards.php b/startpage/render_cards.php new file mode 100644 index 0000000..369a5fd --- /dev/null +++ b/startpage/render_cards.php @@ -0,0 +1,76 @@ + $title, 'image' => $image, 'alt' => $alt !== '' ? $alt : 'Visual', 'links' => []]; + continue; + } + if ($cur === null) continue; + $parts = array_map('trim', explode('|', $line, 2)); + $label = $parts[0] ?? ''; + $url = $parts[1] ?? ''; + if ($label !== '' && startpage_valid_card_url($url)) $cur['links'][] = ['label' => $label, 'url' => $url]; + } + if ($cur !== null) $cards[] = $cur; + $all = array_values(array_filter($cards, fn($card) => $card['links'] !== [])); + return $all; +} + +function startpage_seasonal_sports_image(string $image): string { + // Sports card logo follows the local season: Belleville Senators (AHL) + // October–April, Belleville Kodiaks (OSL Sr B lacrosse) May–September. + if ($image !== 'belleville.png') return $image; + $month = (int)date('n'); + return ($month >= 5 && $month <= 9) ? 'kodiaks.png' : 'belleville.png'; +} + +$allCardData = startpage_card_data(); +foreach ($allCardData as &$card) { + $card['image'] = startpage_seasonal_sports_image($card['image']); +} +unset($card); +?> + +
+
+ + +
+
+
<?= htmlspecialchars($card['alt'], ENT_QUOTES, 'UTF-8') ?>
+ +
+
+ + -- cgit v1.2.3