function showContent() { $this->elementStart('p', array('id' => 'new_group')); $this->element('a', array('href' => common_local_url('newgroup'), 'class' => 'more'), _('Create a new group')); $this->elementEnd('p'); $this->elementStart('p', array('id' => 'group_search')); $this->element('a', array('href' => common_local_url('groupsearch'), 'class' => 'more'), _('Search for more groups')); $this->elementEnd('p'); if (Event::handle('StartShowUserGroupsContent', array($this))) { $offset = ($this->page - 1) * GROUPS_PER_PAGE; $limit = GROUPS_PER_PAGE + 1; $groups = $this->user->getGroups($offset, $limit); if ($groups instanceof User_group) { $gl = new GroupList($groups, $this->user, $this); $cnt = $gl->show(); $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE, $this->page, 'usergroups', array('nickname' => $this->user->nickname)); } else { $this->showEmptyListMessage(); } Event::handle('EndShowUserGroupsContent', array($this)); } }
function showContent() { if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->getTarget())) { $notice = sprintf(_('Groups let you find and talk with ' . 'people of similar interests. ' . 'You can [search for groups](%%%%action.groups%%%%) in your instance or ' . '[create a new group](%%%%action.newgroup%%%%). ' . 'You can also follow groups ' . 'from other GNU social instances: click on the remote button below ' . 'and copy the group\'s link. ' . 'You can find a list of GNU social groups [here](http://skilledtests.com/wiki/List_of_federated_GNU_social_groups)' . '')); $this->elementStart('div', 'instructions'); $this->raw(common_markup_to_html($notice)); $this->elementEnd('div'); } if (Event::handle('StartShowUserGroupsContent', array($this))) { $offset = ($this->page - 1) * GROUPS_PER_PAGE; $limit = GROUPS_PER_PAGE + 1; $groups = $this->getTarget()->getGroups($offset, $limit); if ($groups instanceof User_group) { $gl = new GroupList($groups, $this->getTarget(), $this); $cnt = $gl->show(); if (0 == $cnt) { $this->showEmptyListMessage(); } else { $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE, $this->page, 'usergroups', array('nickname' => $this->getTarget()->getNickname())); } } Event::handle('EndShowUserGroupsContent', array($this)); } }
function showContent() { if (common_logged_in()) { $this->elementStart('p', array('id' => 'new_group')); $this->element('a', array('href' => common_local_url('newgroup'), 'class' => 'more'), _('Create a new group')); $this->elementEnd('p'); } $offset = ($this->page - 1) * GROUPS_PER_PAGE; $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(); $cnt = 0; $groups->query($qry); $gl = new GroupList($groups, null, $this); $cnt = $gl->show(); $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE, $this->page, 'groups'); }
function showContent() { $this->elementStart('p', array('id' => 'new_group')); $this->element('a', array('href' => common_local_url('newgroup'), 'class' => 'more'), _('Create a new group')); $this->elementEnd('p'); $this->elementStart('p', array('id' => 'group_search')); $this->element('a', array('href' => common_local_url('groupsearch'), 'class' => 'more'), _('Search for more groups')); $this->elementEnd('p'); $offset = ($this->page - 1) * GROUPS_PER_PAGE; $limit = GROUPS_PER_PAGE + 1; $groups = $this->user->getGroups($offset, $limit); if ($groups) { $gl = new GroupList($groups, $this->user, $this); $cnt = $gl->show(); } $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE, $this->page, 'usergroups', array('nickname' => $this->user->nickname)); }
function showContent() { $this->elementStart('p', array('id' => 'new_group')); $this->element('a', array('href' => common_local_url('newgroup'), 'class' => 'more'), _('Create a new group')); $this->elementEnd('p'); $offset = ($this->page - 1) * GROUPS_PER_PAGE; $limit = GROUPS_PER_PAGE + 1; $groups = new User_group(); $groups->orderBy('created DESC'); $groups->limit($offset, $limit); if ($groups->find()) { $gl = new GroupList($groups, null, $this); $cnt = $gl->show(); } $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE, $this->page, 'groups'); }