]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Directory/lib/sortablesubscriptionlist.php
use an array of profiles rather than a looping cursor for profile lists
[quix0rs-gnu-social.git] / plugins / Directory / lib / sortablesubscriptionlist.php
index 234923c00323f3c904b44f44ef8892e265b07c7c..b61f760ef4cdc1aab0ed064d5cf754803f417c38 100644 (file)
@@ -130,17 +130,15 @@ class SortableSubscriptionList extends SubscriptionList
 
     function showProfiles()
     {
-        $cnt = 0;
+        $profiles = $this->profile->fetchAll();
 
-        while ($this->profile->fetch()) {
-            $cnt++;
-            if($cnt > PROFILES_PER_PAGE) {
-                break;
-            }
+        $cnt = count($profiles);
 
-            $odd = ($cnt % 2 == 0); // for zebra striping
+        $max = min($cnt, $this->maxProfiles());
 
-            $pli = $this->newListItem($this->profile, $odd);
+        for ($i = 0; $i < $max; $i++) {
+            $odd = ($i % 2 == 0); // for zebra striping
+            $pli = $this->newListItem($profiles[$i], $odd);
             $pli->show();
         }