by include.php). // Built from fitme3070_info + work_hours so admin edits stay in sync. $ld_gym = current_gym(); $ld = [ '@context' => 'https://schema.org', '@type' => 'ExerciseGym', 'name' => $ld_gym['name'] !== '' ? $ld_gym['name'] : (($info['name'] ?? '') !== '' ? $info['name'] : 'FitMe 3070'), 'url' => gym_url($ld_gym), 'image' => base_url(img_compat_rel(($ld_gym['hero_image'] ?? '') !== '' ? $ld_gym['hero_image'] : 'site/assets/img/home.jpg')), 'logo' => base_url(img_compat_rel(gym_logo($ld_gym) ?: 'site/assets/img/logos/logo_black.svg')), ]; if (!empty($info['phone'])) $ld['telephone'] = site_tel($info['phone']); if (!empty($info['email'])) $ld['email'] = $info['email']; if (!empty($info['adress'])) { $ld['address'] = [ '@type' => 'PostalAddress', 'streetAddress' => $info['adress'], 'addressLocality' => ($ld_gym['locality'] ?? '') !== '' ? $ld_gym['locality'] : 'Mira', 'addressCountry' => 'PT', ]; } if (!empty($info['google_maps_link'])) $ld['hasMap'] = $info['google_maps_link']; $ld_same_as = array_values(array_filter([$info['facebook'] ?? '', $info['instagram'] ?? ''])); if ($ld_same_as) $ld['sameAs'] = $ld_same_as; // Opening hours: the 'segunda' row in work_hours covers Mon-Fri (see index.php). $ld_days = [ 'segunda' => ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], 'sabado' => ['Saturday'], 'domingo' => ['Sunday'], ]; $ld_hours = []; foreach ((isset($GLOBALS['pdo']) ? site_work_hours($GLOBALS['pdo']) : []) as $h) { if (!isset($ld_days[$h['week_day']])) continue; $ld_hours[] = [ '@type' => 'OpeningHoursSpecification', 'dayOfWeek' => $ld_days[$h['week_day']], 'opens' => substr((string) $h['open'], 0, 5), 'closes' => substr((string) $h['close'], 0, 5), ]; } if ($ld_hours) $ld['openingHoursSpecification'] = $ld_hours; ?>