]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/usergroups.php
Bad route config (thanks brw12)
[quix0rs-gnu-social.git] / actions / usergroups.php
index 178a3586fdea7d473d77caf229039182992b1d32..45fed57d84714e13205c415aad65fc8f18e76a07 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,17 +137,15 @@ 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();
-                }
-            }
-
-            $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE,
+                $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE,
                               $this->page, 'usergroups',
                               array('nickname' => $this->user->nickname));
+            } else {
+                $this->showEmptyListMessage();
+            }
 
             Event::handle('EndShowUserGroupsContent', array($this));
         }