Пример #1
0
 private function templateUsers(GWF_Group $group)
 {
     $users = GDO::table('GWF_User');
     $gid = $group->getVar('group_id');
     $gn = $group->urlencode('group_name');
     $by = Common::getGet('by', '');
     $dir = Common::getGet('dir', '');
     $orderby = $users->getMultiOrderby($by, $dir);
     $ipp = 50;
     $nItems = $group->getVar('group_memberc');
     $nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
     $page = Common::clamp(Common::getGetInt('page', 1), 1, $nPages);
     $from = GWF_PageMenu::getFrom($page, $ipp);
     $ug = GWF_TABLE_PREFIX . 'usergroup';
     $hidden = GWF_UserGroup::HIDDEN;
     $conditions = "(SELECT 1 FROM {$ug} WHERE ug_userid=user_id AND ug_groupid={$gid} AND ug_options&{$hidden}=0)";
     $tVars = array('sort_url' => GWF_WEB_ROOT . 'users_in_group/' . $gid . '/' . $gn . '/by/%BY%/%DIR%/page-1', 'pagemenu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . sprintf('users_in_group/%s/%s/by/%s/%s/page-%%PAGE%%', $gid, $gn, urlencode($by), urlencode($dir))), 'users' => $users->selectObjects('*', $conditions, $orderby, $ipp, $from));
     return $this->module->templatePHP('users.php', $tVars);
 }