Autosave: 20260325-162615
This commit is contained in:
parent
4ad7fde6c2
commit
bcdbd5300c
72
includes/webinar_schedule.php
Normal file
72
includes/webinar_schedule.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
function webinar_schedule_base_timezone(): DateTimeZone {
|
||||
static $timezone = null;
|
||||
|
||||
if ($timezone === null) {
|
||||
$timezone = new DateTimeZone('Europe/Berlin');
|
||||
}
|
||||
|
||||
return $timezone;
|
||||
}
|
||||
|
||||
function webinar_default_title(): string {
|
||||
return 'Building Scalable Apps with AppWizzy';
|
||||
}
|
||||
|
||||
function webinar_start_datetime(array $webinar): DateTimeImmutable {
|
||||
$scheduledAt = trim((string) ($webinar['scheduled_at'] ?? ''));
|
||||
|
||||
if ($scheduledAt === '') {
|
||||
$scheduledAt = '2026-03-25 18:00:00';
|
||||
}
|
||||
|
||||
return new DateTimeImmutable($scheduledAt, webinar_schedule_base_timezone());
|
||||
}
|
||||
|
||||
function webinar_end_datetime(DateTimeImmutable $start, int $durationMinutes = 60): DateTimeImmutable {
|
||||
$durationMinutes = max(1, $durationMinutes);
|
||||
|
||||
return $start->add(new DateInterval('PT' . $durationMinutes . 'M'));
|
||||
}
|
||||
|
||||
function webinar_time_label(DateTimeInterface $start, string $timezone): string {
|
||||
$localStart = DateTimeImmutable::createFromInterface($start)->setTimezone(new DateTimeZone($timezone));
|
||||
|
||||
return strtoupper($localStart->format('gA T'));
|
||||
}
|
||||
|
||||
function webinar_utc_stamp(DateTimeInterface $dateTime): string {
|
||||
return DateTimeImmutable::createFromInterface($dateTime)
|
||||
->setTimezone(new DateTimeZone('UTC'))
|
||||
->format('Ymd\THis\Z');
|
||||
}
|
||||
|
||||
function webinar_schedule_data(array $webinar, int $durationMinutes = 60): array {
|
||||
$title = trim((string) ($webinar['title'] ?? ''));
|
||||
if ($title === '') {
|
||||
$title = webinar_default_title();
|
||||
}
|
||||
|
||||
$start = webinar_start_datetime($webinar);
|
||||
$end = webinar_end_datetime($start, $durationMinutes);
|
||||
|
||||
$berlin = webinar_time_label($start, 'Europe/Berlin');
|
||||
$newYork = webinar_time_label($start, 'America/New_York');
|
||||
$losAngeles = webinar_time_label($start, 'America/Los_Angeles');
|
||||
|
||||
return [
|
||||
'title' => $title,
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
'date_long' => $start->format('l, F j, Y'),
|
||||
'berlin_label' => $berlin,
|
||||
'new_york_label' => $newYork,
|
||||
'los_angeles_label' => $losAngeles,
|
||||
'timezone_line' => $berlin . ' | ' . $newYork . ' | ' . $losAngeles,
|
||||
'hero_line' => strtoupper($start->format('l, F j') . ' | ' . $newYork . ' | ' . $losAngeles . ' | ' . $berlin),
|
||||
'calendar_sentence' => 'Professional Vibe-Coding Webinar. Join us on ' . $start->format('F jS') . ' at ' . $berlin . ' | ' . $newYork . ' | ' . $losAngeles . ' to learn the fastest way to go from an idea to a working app you own.',
|
||||
'calendar_description' => "Professional Vibe-Coding Webinar
|
||||
|
||||
Join us for this webinar on " . $start->format('F jS') . ' at ' . $berlin . ' | ' . $newYork . ' | ' . $losAngeles . '. The fastest way to go from an idea to a working app you own, running on your server, with your database, using real frameworks.',
|
||||
];
|
||||
}
|
||||
20
index.php
20
index.php
@ -1,3 +1,21 @@
|
||||
<?php
|
||||
require_once 'db/config.php';
|
||||
require_once 'includes/webinar_schedule.php';
|
||||
|
||||
$heroSchedule = webinar_schedule_data([]);
|
||||
|
||||
try {
|
||||
$stmt = db()->prepare('SELECT title, scheduled_at FROM webinars WHERE id = ? LIMIT 1');
|
||||
$stmt->execute([1]);
|
||||
$heroWebinar = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($heroWebinar) {
|
||||
$heroSchedule = webinar_schedule_data($heroWebinar);
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// Keep fallback schedule if the database is temporarily unavailable.
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@ -273,7 +291,7 @@
|
||||
|
||||
<h1 class="webinar-title" style="line-height: 1.2;">Building Scalable Apps with AppWizzy</h1>
|
||||
<h2 class="webinar-subtitle">Professional Vibe-Coding Webinar</h2>
|
||||
<div class="webinar-time">WEDNESDAY, MARCH 25 | 12PM EDT | 9AM PDT | 6PM CET</div>
|
||||
<div class="webinar-time"><?php echo htmlspecialchars($heroSchedule['hero_line'], ENT_QUOTES, 'UTF-8'); ?></div>
|
||||
<p class="webinar-description">The fastest way to go from an idea to a working app you own, running on your server, with your database, using real frameworks.</p>
|
||||
<div class="speakers-section">
|
||||
<h3>Speakers</h3>
|
||||
|
||||
8668
mail/mail.log
8668
mail/mail.log
File diff suppressed because it is too large
Load Diff
BIN
register.php
BIN
register.php
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user