12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- class GroupsByMembersSection extends GroupSection
- {
- function getGroups()
- {
- $qry = 'SELECT user_group.*, count(*) as value ' .
- 'FROM user_group JOIN group_member '.
- 'ON user_group.id = group_member.group_id ' .
- 'GROUP BY user_group.id,user_group.nickname,user_group.fullname,user_group.homepage,user_group.description,user_group.location,user_group.original_logo,user_group.homepage_logo,user_group.stream_logo,user_group.mini_logo,user_group.created,user_group.modified ' .
- 'ORDER BY value DESC ';
- $limit = GROUPS_PER_SECTION;
- $offset = 0;
- if (common_config('db','type') == 'pgsql') {
- $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
- } else {
- $qry .= ' LIMIT ' . $offset . ', ' . $limit;
- }
- $group = Memcached_DataObject::cachedQuery('User_group',
- $qry,
- 3600);
- return $group;
- }
- function title()
- {
-
- return _('Popular groups');
- }
- function divId()
- {
- return 'top_groups_by_member';
- }
- }
|