From 2bf81134c781731c31c05e58535e7b787c5169db Mon Sep 17 00:00:00 2001 From: Tobias Feigel Date: Sun, 29 Jun 2025 10:59:56 +0200 Subject: [PATCH 1/3] chore: reformat and clean up PHP templates, snippets, and configurations Standardized code formatting across multiple files for improved readability and consistency. --- site/config/config.php | 6 +- site/snippets/dwz.php | 120 ++++++++----- site/snippets/footer.php | 17 +- site/snippets/header.php | 46 ++--- site/snippets/termine.php | 329 +++++++++++++++++++++-------------- site/snippets/titel.php | 12 +- site/templates/default.php | 35 ++-- site/templates/dwz.php | 43 +++-- site/templates/home.php | 38 ++-- site/templates/impressum.php | 42 +++-- site/templates/satzung.php | 142 ++++++++++----- site/templates/termine.php | 41 +++-- 12 files changed, 523 insertions(+), 348 deletions(-) diff --git a/site/config/config.php b/site/config/config.php index e1fe667..00828c1 100644 --- a/site/config/config.php +++ b/site/config/config.php @@ -1,5 +1,5 @@ true, - ]; \ No newline at end of file +return [ + 'debug' => true, +]; \ No newline at end of file diff --git a/site/snippets/dwz.php b/site/snippets/dwz.php index a9981ef..9be1f99 100644 --- a/site/snippets/dwz.php +++ b/site/snippets/dwz.php @@ -1,54 +1,84 @@ $dwzA; - }); - } +function safe($val) +{ + return $val === null || $val === false || $val === '' || $val === 'N' + ? '-' : htmlspecialchars($val); +} + +// Nach DWZ absteigend sortieren +if ($players && is_array($players)) { + usort($players, function ($a, $b) { + $dwzA = isset($a['dwz']) && is_numeric($a['dwz']) ? (int)$a['dwz'] + : 0; + $dwzB = isset($b['dwz']) && is_numeric($b['dwz']) ? (int)$b['dwz'] + : 0; + + return $dwzB <=> $dwzA; + }); +} ?> +
- - - - - - - - - - - - - - - - - - - +
PlatzMitgl.TitelNameDWZELO
- -
+ + + + + + + + + + + + + + + + + + - - + + + + + + + - - - - - -
PlatzMitgl.TitelNameDWZELO
+ + - + -
+ Keine Daten verfügbar. +
Keine Daten verfügbar.
-
+ + + +
\ No newline at end of file diff --git a/site/snippets/footer.php b/site/snippets/footer.php index 977cce9..8f67ccd 100644 --- a/site/snippets/footer.php +++ b/site/snippets/footer.php @@ -1,13 +1,13 @@