X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fall.php;h=bd5b9f01e5f5dce8f642ea28300ee47d6d6734a1;hb=e440b9cea02549032ba4f79c43964219dea23d82;hp=944fec6d4b7c5958a7157e7a0e86a9157a0c8bb5;hpb=9515303b14288041576c50c1729f874c2e17191f;p=quix0rs-gnu-social.git diff --git a/actions/all.php b/actions/all.php index 944fec6d4b..bd5b9f01e5 100644 --- a/actions/all.php +++ b/actions/all.php @@ -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)); } }