]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Paging fix for threaded notice lists
authorBrion Vibber <brion@pobox.com>
Mon, 28 Feb 2011 23:40:43 +0000 (15:40 -0800)
committerBrion Vibber <brion@pobox.com>
Mon, 28 Feb 2011 23:40:43 +0000 (15:40 -0800)
lib/threadednoticelist.php

index d95a1879802e280ac7a44548adc3210e3893d582..c1c4b4f36a3513b4ffa0361bf685e76e4c4fcaf4 100644 (file)
@@ -69,6 +69,12 @@ class ThreadedNoticeList extends NoticeList
         $cnt = 0;
         $conversations = array();
         while ($this->notice->fetch() && $cnt <= NOTICES_PER_PAGE) {
+            $cnt++;
+
+            if ($cnt > NOTICES_PER_PAGE) {
+                break;
+            }
+
             $convo = $this->notice->conversation;
             if (!empty($conversations[$convo])) {
                 // Seen this convo already -- skip!
@@ -86,12 +92,6 @@ class ThreadedNoticeList extends NoticeList
             $notice->limit(1);
             $notice->find(true);
 
-            $cnt++;
-
-            if ($cnt > NOTICES_PER_PAGE) {
-                break;
-            }
-
             try {
                 $item = $this->newListItem($notice);
                 $item->show();