summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-01-24 11:05:38 +0100
committerEvan Prodromou <evan@controlyourself.ca>2009-01-24 11:05:38 +0100
commita611408dca7658ab72c18f65b7687322a08e4bd8 (patch)
treefe701d0998fb59cd26f0ea160b659d3f03ee37e8
parent8f19855cd0742e3ca9cb97d2287fbfbe48507d51 (diff)
Revert "try to fix groups with a new qry"
This reverts commit 8f19855cd0742e3ca9cb97d2287fbfbe48507d51.
-rw-r--r--actions/groups.php15
1 files changed, 4 insertions, 11 deletions
diff --git a/actions/groups.php b/actions/groups.php
index 72adbbde8..39dc2232b 100644
--- a/actions/groups.php
+++ b/actions/groups.php
@@ -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()