summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <git@evanprodromou.name>2009-01-24 10:53:28 +0100
committerEvan Prodromou <git@evanprodromou.name>2009-01-24 10:53:28 +0100
commit8f19855cd0742e3ca9cb97d2287fbfbe48507d51 (patch)
treec658016ef4d2c94b7b7eb9aa2f2d2070ac430dac /actions
parent1b07e65277fafde9e8b9e1809e012d4e954fc2c2 (diff)
try to fix groups with a new qry
Diffstat (limited to 'actions')
-rw-r--r--actions/groups.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/actions/groups.php b/actions/groups.php
index 39dc2232b..72adbbde8 100644
--- a/actions/groups.php
+++ b/actions/groups.php
@@ -106,12 +106,19 @@ class GroupsAction extends Action
_('Create a new group'));
$this->elementEnd('p');
+ $limit = GROUPS_PER_PAGE + 1;
$offset = ($this->page-1) * GROUPS_PER_PAGE;
- $limit = GROUPS_PER_PAGE + 1;
+
+ $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;
+ }
$groups = new User_group();
- $groups->orderBy('created DESC');
- $groups->limit($offset, $limit);
+ $groups->query($qry);
if ($groups->find()) {
$gl = new GroupList($groups, null, $this);
@@ -119,7 +126,7 @@ class GroupsAction extends Action
}
$this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE,
- $this->page, 'groups');
+ $this->page, 'groups', array());
}
function showSections()