prepare('SELECT id, username, display_name FROM users WHERE username = ? LIMIT 1'); $user_stmt->execute([$req_username]); $profile_user = $user_stmt->fetch(); if (!$profile_user) { http_response_code(404); echo '

404 — User not found

Home'; exit; } $uid = (int)$profile_user['id']; $disp_name = $profile_user['display_name'] ?: $profile_user['username']; $initials = strtoupper(mb_substr($disp_name, 0, 1)); // Load public sessions $sessions = $pdo->prepare(" SELECT id, name, occasion, mystery_set, subject_name, photo_path, slug, created_at FROM sessions WHERE user_id = ? AND is_public = 1 AND occasion != 'novena_deceased' ORDER BY created_at DESC "); $sessions->execute([$uid]); $sessions = $sessions->fetchAll(); // Load public novena groups $novenas = $pdo->prepare(" SELECT ng.id, ng.name, ng.mystery_set, ng.subject_name, ng.photo_path, ng.slug, ng.created_at, COUNT(s.id) AS day_count FROM novena_groups ng LEFT JOIN sessions s ON s.novena_group_id = ng.id WHERE ng.user_id = ? AND ng.is_public = 1 GROUP BY ng.id ORDER BY ng.created_at DESC "); $novenas->execute([$uid]); $novenas = $novenas->fetchAll(); // Merge $all = []; foreach ($sessions as $r) { $r['_type'] = 'session'; $all[] = $r; } foreach ($novenas as $r) { $r['_type'] = 'novena'; $all[] = $r; } usort($all, fn($a, $b) => strcmp($b['created_at'], $a['created_at'])); $mystery_labels = [ 'sorrowful' => 'Sorrowful Mysteries', 'joyful' => 'Joyful Mysteries', 'glorious' => 'Glorious Mysteries', 'luminous' => 'Luminous Mysteries', 'by_day_of_week' => 'By Day of Week', ]; $occasion_labels = [ 'general_rosary' => 'General Rosary', 'memorial' => 'Memorial', 'novena_deceased' => 'Novena for Deceased', ]; ?> <?= htmlspecialchars($disp_name) ?> — <?= htmlspecialchars($site_name) ?>

@ public rosary

Public Rosaries

has no public rosary sessions yet.

9-Day Novena