]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
better looping in profile list
authorEvan Prodromou <evan@prodromou.name>
Thu, 20 Nov 2008 10:57:26 +0000 (05:57 -0500)
committerEvan Prodromou <evan@prodromou.name>
Thu, 20 Nov 2008 10:57:26 +0000 (05:57 -0500)
darcs-hash:20081120105726-84dde-bc863f49370dca492d46a5f46c65f46d01862acb.gz

lib/profilelist.php

index 4c2037e0580385f96fdd6135a236a93a8ece0665..b17b0ac9218af0d583cf6ba46e7fd27f96877032 100644 (file)
@@ -33,14 +33,15 @@ class ProfileList {
        function show_list() {
                
                common_element_start('ul', array('id' => 'profiles'));
+
+               $cnt = 0;
                
-               for ($i = 0; $i < min($cnt, PROFILES_PER_PAGE); $i++) {
-                       if ($this->profile->fetch()) {
-                               $this->show();
-                       } else {
-                               // shouldn't happen!
+               while ($this->profile->fetch()) {
+                       $cnt++;
+                       if($cnt > PROFILES_PER_PAGE) {
                                break;
                        }
+                       $this->show();
                }
                
                common_element_end('ul');