bug 1190: Limit number of news items
authorMichael Tänzer <neo@nhng.de>
Mon, 15 Jul 2013 16:51:18 +0000 (18:51 +0200)
committerMichael Tänzer <neo@nhng.de>
Mon, 15 Jul 2013 16:51:18 +0000 (18:51 +0200)
Signed-off-by: Michael Tänzer <neo@nhng.de>
pages/index/0.php

index 805b147..76dcd28 100644 (file)
@@ -41,6 +41,7 @@
        $query = "//channel/item";
        $items = $xpath->query($query);
 
+       $count = 0;
        foreach($items as $id => $item) {
                $query = "./title";
                $nodeList = $xpath->query($query, $item);
                $title = '';
                $description = '';
                $link = '';
+
+               count++;
+               if ($count >= 3) {
+                       break;
+               }
        }
 ?>