From 645ee8aeb9a68043361566ce9afc4df064312d2a Mon Sep 17 00:00:00 2001 From: Eskimue Date: Fri, 24 Apr 2026 13:00:20 +0200 Subject: [PATCH] Monatsvorhersage erst nach button --- public/monatsvorhersage.php | 41 ++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/public/monatsvorhersage.php b/public/monatsvorhersage.php index 4a2410f..3d4422b 100644 --- a/public/monatsvorhersage.php +++ b/public/monatsvorhersage.php @@ -11,6 +11,7 @@ $publicBasePath = './'; $currentYear = (int) date('Y'); $selectedYear = isset($_GET['year']) ? (int) $_GET['year'] : $currentYear; $selectedMonth = isset($_GET['month']) ? max(1, min(12, (int) $_GET['month'])) : (int) date('n'); +$shouldRunForecast = isset($_GET['run']) && $_GET['run'] === '1'; // ------------------------------------------------------------------------- // Bereits berechnete Bausteine der Monatsvorschau @@ -241,6 +242,25 @@ $seasonChanges = []; $timeChanges = []; $monthEventList = []; $starDataError = null; +$monthNarrativeText = ''; +$observationTipInsertSql = ''; +$observationTipCalendarIcs = ''; +$chartConfig = null; +$chartConfigJson = 'null'; +$starDataJson = '[]'; +$lineStarDataJson = '[]'; +$constellationLinesJson = '[]'; +$messierDataJson = '[]'; +$planetDataJson = '[]'; +$moonDataJson = 'null'; +$monthChartCometsJson = '[]'; +$moonPhaseEventsJson = '[]'; +$starDataErrorJson = 'null'; +$observationTipCalendarIcsJson = '""'; +$observationTipCalendarFilenameJson = json_encode( + sprintf('astrotools-monatsereignisse-%04d-%02d.ics', $selectedYear, $selectedMonth), + JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES +); if (!function_exists('buildMonthOccultationStarLabel')) { function buildMonthOccultationStarLabel(array $row): string @@ -1228,6 +1248,8 @@ $chartLongitude = isset($currentLocation['longitude']) ? (float) $currentLocatio $chartElevation = isset($currentLocation['elevation']) && $currentLocation['elevation'] !== null ? (float) $currentLocation['elevation'] : 640.0; $chartTimezone = (string) (($currentLocation['timezone'] ?? null) ?: 'Europe/Berlin'); +if ($shouldRunForecast) { + $monthTime = $monthSkyTimes[$selectedMonth]; $chartLocalTime = new DateTimeImmutable( sprintf('%04d-%02d-15 %02d:%02d:00', $selectedYear, $selectedMonth, $monthTime['hour'], $monthTime['minute']), @@ -2366,6 +2388,7 @@ $moonPhaseEventsJson = json_encode($moonPhaseEvents, JSON_UNESCAPED_UNICODE | JS $starDataErrorJson = json_encode($starDataError, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $observationTipCalendarIcsJson = json_encode($observationTipCalendarIcs, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $observationTipCalendarFilenameJson = json_encode(sprintf('astrotools-monatsereignisse-%04d-%02d.ics', $selectedYear, $selectedMonth), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); +} ?>
@@ -2376,6 +2399,8 @@ $observationTipCalendarFilenameJson = json_encode(sprintf('astrotools-monatserei

Die Sternkarte wird für den 15. des gewählten Monats mit der festen Monatsuhrzeit erzeugt.

+ +