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); }
private function getPMMessage(GWF_User $user, GWF_Group $group, $bbcode = true) { # bbcode urls, no web root needed $href_join = '/index.php?mo=Usergroups&me=Join&gid=' . $group->getVar('group_id'); $href_deny = '/index.php?mo=Usergroups&me=Join&deny=' . $group->getVar('group_id'); $founder = $group->getFounder(); if ($bbcode === true) { $link_yes = sprintf('[url=%s]%s[/url]', $href_join, $href_join); $link_no = sprintf('[url=%s]%s[/url]', $href_deny, $href_deny); } else { $link_yes = GWF_HTML::anchor($href_join, $href_join); $link_no = GWF_HTML::anchor($href_deny, $href_deny); } return $this->module->langUser($user, 'invite_message', array($user->getVar('user_name'), $founder->getVar('user_name'), $group->getName(), $link_yes, $link_no)); }