From 3b2ed78c1c23b29d9340a7c792cbac0dc56c7209 Mon Sep 17 00:00:00 2001 From: NOrtmann1 Date: Fri, 17 Jul 2026 16:16:14 +0200 Subject: [PATCH] Update showCategory.php --- content/showCategory.php | 208 ++++++++++++++++++++++++++++++++++----- 1 file changed, 185 insertions(+), 23 deletions(-) diff --git a/content/showCategory.php b/content/showCategory.php index a684f21..c3625a2 100644 --- a/content/showCategory.php +++ b/content/showCategory.php @@ -1,32 +1,194 @@ + +if(isset($articles)){ + $totalResultsCount = count($articles); + + $limit = isset($_GET['limit']) ? (int)$_GET['limit'] : 10; + if (!in_array($limit, [10, 20, 50, 100])) { + $limit = 10; + } + +// Gesamtseitenzahl + $totalPages = max(1, ceil($totalResultsCount / $limit)); + +// 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); +} + +?> + + +
-

+ + + +
+ +
+

Suchergebnisse

+

Treffer für Ihre Suchanfrage ""

+
+ + +
+ + + +
+
+

+ + + +

+
+

Von:

+ + + ❤️ + +
+
+
+
+ + + +

Keine Beiträge zu diesem Suchbegriff gefunden.

+ +

Unzulässige Suchanfrage

+ + + + +
+ +
+ +