]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/groups.php
Merge branch '0.7.x' into 0.8.x
[quix0rs-gnu-social.git] / actions / groups.php
index 72adbbde8ca778a57e75c52eb3bc564b0a229ed4..26b52a5fcd4dde75618205ccb3716900a8a4d6b8 100644 (file)
@@ -51,7 +51,7 @@ class GroupsAction extends Action
     var $page = null;
     var $profile = null;
 
-    function isReadOnly()
+    function isReadOnly($args)
     {
         return true;
     }
@@ -106,19 +106,12 @@ class GroupsAction extends Action
                        _('Create a new group'));
         $this->elementEnd('p');
 
-        $limit = GROUPS_PER_PAGE + 1;
         $offset = ($this->page-1) * GROUPS_PER_PAGE;
-
-        $qry = 'SELECT * from User_group ' .
-          'ORDER by created DESC ';
-        if (common_config('db','type') == 'pgsql') {
-            $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
-        } else {
-            $qry .= ' LIMIT ' . $offset . ', ' . $limit;
-        }
+        $limit =  GROUPS_PER_PAGE + 1;
 
         $groups = new User_group();
-        $groups->query($qry);
+        $groups->orderBy('created DESC');
+        $groups->limit($offset, $limit);
 
         if ($groups->find()) {
             $gl = new GroupList($groups, null, $this);
@@ -126,7 +119,7 @@ class GroupsAction extends Action
         }
 
         $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE,
-                          $this->page, 'groups', array());
+                          $this->page, 'groups');
     }
 
     function showSections()