]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/usergroups.php
Group discovery from text functions polished
[quix0rs-gnu-social.git] / actions / usergroups.php
index 178a3586fdea7d473d77caf229039182992b1d32..b705afe06886993cc40e5908257c5cbe99e25f68 100644 (file)
@@ -88,7 +88,7 @@ class UsergroupsAction extends ProfileAction
             return false;
         }
 
-        $this->user = User::staticGet('nickname', $nickname);
+        $this->user = User::getKV('nickname', $nickname);
 
         if (!$this->user) {
             // TRANS: Client error displayed requesting groups for a non-existing user.
@@ -104,7 +104,7 @@ class UsergroupsAction extends ProfileAction
             return false;
         }
 
-        $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
+        $this->page = $this->trimmed('page', 1);
 
         return true;
     }
@@ -137,12 +137,11 @@ class UsergroupsAction extends ProfileAction
 
             $groups = $this->user->getGroups($offset, $limit);
 
-            if ($groups) {
+            if ($groups instanceof User_group) {
                 $gl = new GroupList($groups, $this->user, $this);
                 $cnt = $gl->show();
-                if (0 == $cnt) {
-                    $this->showEmptyListMessage();
-                }
+            } else {
+                $this->showEmptyListMessage();
             }
 
             $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE,