X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fgroups.php;h=8aacff8b0ecd1cd2efe86de5b35a6a7b90312f03;hb=63c4eef64322da6a360c9ef3d7e1a20de9ca9cdd;hp=e05908956be1a070da1f7e13ddb8b82371e706f3;hpb=c8b8f07af14ad2ce9d0c0267962dd3bbf6473a4b;p=quix0rs-gnu-social.git diff --git a/actions/groups.php b/actions/groups.php index e05908956b..8aacff8b0e 100644 --- a/actions/groups.php +++ b/actions/groups.php @@ -21,14 +21,14 @@ * * @category Personal * @package StatusNet - * @author Evan Prodromou - * @author Sarven Capadisli + * @author Evan Prodromou + * @author Sarven Capadisli * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -41,9 +41,9 @@ require_once INSTALLDIR.'/lib/grouplist.php'; * * @category Personal * @package StatusNet - * @author Evan Prodromou + * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class GroupsAction extends Action @@ -109,17 +109,21 @@ class GroupsAction extends Action } $offset = ($this->page-1) * GROUPS_PER_PAGE; - $limit = GROUPS_PER_PAGE + 1; + $limit = GROUPS_PER_PAGE + 1; + + $qry = 'SELECT user_group.* '. + 'from user_group join local_group on user_group.id = local_group.group_id '. + 'order by user_group.created desc '. + 'limit ' . $limit . ' offset ' . $offset; $groups = new User_group(); - $groups->orderBy('created DESC'); - $groups->limit($offset, $limit); $cnt = 0; - if ($groups->find()) { - $gl = new GroupList($groups, null, $this); - $cnt = $gl->show(); - } + + $groups->query($qry); + + $gl = new GroupList($groups, null, $this); + $cnt = $gl->show(); $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE, $this->page, 'groups');