Stadionzeitung gegen TDC Lindau 2 mit Jugendbeitrag vorbereiten

This commit is contained in:
2026-10-24 11:52:57 +02:00
parent bd8f1dd129
commit fd305673aa
37 changed files with 790 additions and 2 deletions

View File

@@ -393,6 +393,30 @@ if (is_file($szFile)) {
if (is_file($szFile)) {
$szData = $szData ?? (json_decode((string) file_get_contents($szFile), true) ?: []);
foreach ($szData['issues'] ?? [] as $ausgabe) {
if (is_array($ausgabe['beitrag'] ?? null)) {
$beitrag = $ausgabe['beitrag'];
foreach (['heading', 'source', 'source_url', 'image_credit'] as $feld) {
if (trim((string) ($beitrag[$feld] ?? '')) === '') {
$errors[] = "Stadionzeitung '{$ausgabe['slug']}': Beitrag ohne {$feld}.";
}
}
$quelle = (string) ($beitrag['source_url'] ?? '');
if (!filter_var($quelle, FILTER_VALIDATE_URL) || parse_url($quelle, PHP_URL_SCHEME) !== 'https') {
$errors[] = "Stadionzeitung '{$ausgabe['slug']}': Beitrag mit ungültiger Quellen-URL.";
}
$foto = $beitrag['image'] ?? [];
if (empty($foto['base']) || empty($foto['widths']) || empty($foto['alt'])) {
$errors[] = "Stadionzeitung '{$ausgabe['slug']}': Beitragsfoto oder Alt-Text fehlt.";
}
foreach ($foto['widths'] ?? [] as $w) {
if (!is_file(PUBLIC_PATH . '/assets/' . ($foto['base'] ?? '') . "-{$w}.jpg")) {
$errors[] = "Stadionzeitung '{$ausgabe['slug']}': Beitragsfoto fehlt ({$w}px).";
}
}
if (!is_file(PUBLIC_PATH . '/assets/img/stadionzeitung/' . $ausgabe['slug'] . '/qr-beitrag.png')) {
$errors[] = "Stadionzeitung '{$ausgabe['slug']}': Beitrags-QR fehlt.";
}
}
if (is_array($ausgabe['rueckblick'] ?? null)) {
$rueckblick = $ausgabe['rueckblick'];
$foto = $rueckblick['image'] ?? [];