diff --git a/content/showCategory.php b/content/showCategory.php index feb95ba..554c4a2 100644 --- a/content/showCategory.php +++ b/content/showCategory.php @@ -1,135 +1,61 @@ - + +

Kategorie:

- $limit = isset($_GET['limit']) ? (int)$_GET['limit'] : 10; - if (!in_array($limit, [10, 20, 50, 100])) { - $limit = 10; - } + +
+ + +
+ +

getTitle())) ? htmlspecialchars($article->getTitle()) : 'Kein Titel'; ?>

+

getContent())) ? htmlspecialchars($article->getContent()) : 'Kein Inhalt'; ?>

+
+ + +

Keine Artikel in dieser Kategorie gefunden.

+ +
-// Gesamtseitenzahl - $totalPages = max(1, ceil($totalResultsCount / $limit)); + + 1): ?> +
-// Aktuelle Seite auslesen und validieren - $currentPage = isset($_GET['page']) ? (int)$_GET['page'] : 1; - if ($currentPage < 1) { - $currentPage = 1; - } elseif ($currentPage > $totalPages) { - $currentPage = $totalPages; - } + + + -// Startpunkt im Array berechnen (Offset) - $offset = ($currentPage - 1) * $limit; - -// Nur die Ergebnisse für die aktuelle Seite ausschneiden -//$results = array_slice($all_results, $offset, $limit); - $results = $articles; - $resultCount = count($results); -} else { - echo "fehler"; -} - -?> - - -
- - - - - -
- -
- - - -
-
-

- - - -

-
-

Von:

- - - ❤️ - -
-
-
-
- - -
- -
- + +
-