]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
correct pagination for noticelist
authorEvan Prodromou <evan@status.net>
Tue, 2 Aug 2011 15:22:37 +0000 (11:22 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 2 Aug 2011 15:22:37 +0000 (11:22 -0400)
lib/noticelist.php
lib/threadednoticelist.php

index c52380dfc9602e1d1e3edf345e1ac6ac25f873cd..3bd7b05b4adb8c446d40d2225f86ef848c78b531 100644 (file)
@@ -84,7 +84,7 @@ class NoticeList extends Widget
         $this->out->elementStart('ol', array('class' => 'notices xoxo'));
 
                $notices = $this->notice->fetchAll();
-               
+               $total   = count($notices);
                $notices = array_slice($notices, 0, NOTICES_PER_PAGE);
                
        $this->prefill($notices);
@@ -104,7 +104,7 @@ class NoticeList extends Widget
         $this->out->elementEnd('ol');
         $this->out->elementEnd('div');
 
-        return count($notices);
+        return $total;
     }
 
     /**
index 45c11453a7a63699f9cfb866c39939375d08f9c2..ab25e85e9bda0e955e132e3b29980f637cbc3eb1 100644 (file)
@@ -77,11 +77,11 @@ class ThreadedNoticeList extends NoticeList
         $this->out->elementStart('ol', array('class' => 'notices threaded-notices xoxo'));
 
                $notices = $this->notice->fetchAll();
+               $total = count($notices);
                $notices = array_slice($notices, 0, NOTICES_PER_PAGE);
                
        $this->prefill($notices);
        
-        $cnt = 0;
         $conversations = array();
         
         foreach ($notices as $notice) {
@@ -120,7 +120,7 @@ class ThreadedNoticeList extends NoticeList
         $this->out->elementEnd('ol');
         $this->out->elementEnd('div');
 
-        return $cnt;
+        return $total;
     }
 
     /**