= htmlspecialchars($post['text'] ?? '') ?>
> = htmlspecialchars($post['link_label'] ?? $post['link']) ?>Update not found
No update with ID = htmlspecialchars($req_id) ?> exists.
It may have been deleted or the link may be incorrect.
* Returns 404 with styled error card if the ID is not found. */ require_once __DIR__ . '/config.php'; // ── Load helpers (reuse from index) ────────────────────────────────────────── function status_load_posts(): array { if (!file_exists(STATUS_JSON_PATH)) return []; $raw = json_decode(file_get_contents(STATUS_JSON_PATH), true); return is_array($raw) ? $raw : []; } function status_relative_time(string $iso): string { try { $dt = new DateTime($iso, new DateTimeZone('UTC')); $now = new DateTime('now', new DateTimeZone('UTC')); $diff = $now->getTimestamp() - $dt->getTimestamp(); if ($diff < 60) return 'just now'; if ($diff < 3600) return floor($diff / 60) . 'm ago'; if ($diff < 86400) return floor($diff / 3600) . 'h ago'; if ($diff < 604800) return floor($diff / 86400) . 'd ago'; if ($diff < 2592000) return floor($diff / 604800) . 'w ago'; return $dt->format('M j, Y'); } catch (Exception $e) { return ''; } } function status_abs_date(string $iso): string { try { $dt = new DateTime($iso, new DateTimeZone('UTC')); return $dt->format('F j, Y · g:i A') . ' UTC'; } catch (Exception $e) { return $iso; } } function status_iso(string $iso): string { try { $dt = new DateTime($iso, new DateTimeZone('UTC')); return $dt->format(DateTime::ATOM); } catch (Exception $e) { return $iso; } } // ── Find post ──────────────────────────────────────────────────────────────── $req_id = trim($_GET['id'] ?? ''); $all_posts = status_load_posts(); $post = null; $post_idx = null; foreach ($all_posts as $i => $p) { if (($p['id'] ?? '') === $req_id) { $post = $p; $post_idx = $i; break; } } $found = ($post !== null); if (!$found) http_response_code(404); // ── Prev / next navigation ─────────────────────────────────────────────────── $prev_post = ($found && $post_idx > 0) ? $all_posts[$post_idx - 1] : null; $next_post = ($found && $post_idx < count($all_posts) - 1) ? $all_posts[$post_idx + 1] : null; // ── Meta ────────────────────────────────────────────────────────────────────── $page_title = $found ? 'Update #' . htmlspecialchars($post['id']) . ' — ' . htmlspecialchars(STATUS_SITE_NAME) : '404 Not Found — ' . htmlspecialchars(STATUS_SITE_NAME); $canonical = STATUS_BASE_URL . '/post.php?id=' . rawurlencode($req_id); $og_desc = $found ? mb_substr(strip_tags($post['text'] ?? ''), 0, 200) : 'Update not found.'; ?>
No update with ID = htmlspecialchars($req_id) ?> exists.
It may have been deleted or the link may be incorrect.
= htmlspecialchars($post['text'] ?? '') ?>
> = htmlspecialchars($post['link_label'] ?? $post['link']) ?>