]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/all.php
Twitter-compatible API - moved show() to the right file
[quix0rs-gnu-social.git] / actions / all.php
index 944fec6d4b7c5958a7157e7a0e86a9157a0c8bb5..bd5b9f01e5f5dce8f642ea28300ee47d6d6734a1 100644 (file)
@@ -78,22 +78,24 @@ class AllAction extends StreamAction {
                        $page = 1;
                }
                
-               list($cnt, $notice) = $user->noticesWithFriends(($page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
+               $notice = $user->noticesWithFriends(($page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
                                                                                        
-               if ($cnt > 0) {
-                       common_element_start('ul', array('id' => 'notices'));
-                       for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) {
-                               if ($notice->fetch()) {
-                                       $this->show_notice($notice);
-                               } else {
-                                       // shouldn't happen!
-                                       break;
-                               }
+               common_element_start('ul', array('id' => 'notices'));
+               
+               $cnt = 0;
+               
+               while ($notice->fetch() && $cnt <= NOTICES_PER_PAGE) {
+                       $cnt++;
+                       
+                       if ($cnt > NOTICES_PER_PAGE) {
+                               break;
                        }
-                       common_element_end('ul');
+                       
+                       $this->show_notice($notice);
                }
+               common_element_end('ul');
 
                common_pagination($page > 1, $cnt > NOTICES_PER_PAGE,
-                                                 $page, 'all', array('nickname' => $profile->nickname));
+                                                 $page, 'all', array('nickname' => $user->nickname));
        }
 }