]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Show correct number of profile avatars and 'all' link in subs asides
authorZach Copley <zach@controlyourself.ca>
Thu, 2 Jul 2009 01:40:14 +0000 (18:40 -0700)
committerZach Copley <zach@controlyourself.ca>
Thu, 2 Jul 2009 01:40:14 +0000 (18:40 -0700)
lib/profileaction.php
lib/profileminilist.php

index 2519922b2b28e8292e9a4a51e270b8e6af3e8416..eeb5dbe48d80db5510b98861626f62ad6badd343 100644 (file)
@@ -108,7 +108,9 @@ class ProfileAction extends OwnerDesignAction
 
         $this->element('h2', null, _('Subscriptions'));
 
-        if ($profile) {
+        $cnt = 0;
+
+        if (!empty($profile)) {
             $pml = new ProfileMiniList($profile, $this);
             $cnt = $pml->show();
             if ($cnt == 0) {
@@ -137,7 +139,9 @@ class ProfileAction extends OwnerDesignAction
 
         $this->element('h2', null, _('Subscribers'));
 
-        if ($profile) {
+        $cnt = 0;
+
+        if (!empty($profile)) {
             $pml = new ProfileMiniList($profile, $this);
             $cnt = $pml->show();
             if ($cnt == 0) {
index 09bef6f7c6158a054c806b210add89c8b3b2daea..357b4a2db4930c8979e3ffc07fba124fe28ee03d 100644 (file)
@@ -47,6 +47,7 @@ define('PROFILES_PER_MINILIST', 27);
 
 class ProfileMiniList extends ProfileList
 {
+
     function startList()
     {
         $this->out->elementStart('ul', 'entities users xoxo');
@@ -56,6 +57,23 @@ class ProfileMiniList extends ProfileList
     {
         return new ProfileMiniListItem($profile, $this->action);
     }
+
+    function showProfiles()
+    {
+        $cnt = 0;
+
+        while ($this->profile->fetch()) {
+            $cnt++;
+            if ($cnt > PROFILES_PER_MINILIST) {
+                break;
+            }
+            $pli = $this->newListItem($this->profile);
+            $pli->show();
+        }
+
+        return $cnt;
+    }
+
 }
 
 class ProfileMiniListItem extends ProfileListItem