1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- defined('GNUSOCIAL') || die();
- class GroupsByPostsSection extends GroupSection
- {
- public function getGroups()
- {
- $limit = GROUPS_PER_SECTION;
- $qry = <<<END
- SELECT *
- FROM user_group INNER JOIN (
- SELECT group_id AS id, COUNT(group_id) AS value
- FROM group_inbox
- GROUP BY group_id
- ) AS t1 USING (id)
- ORDER BY value DESC LIMIT {$limit};
- END;
- $group = Memcached_DataObject::cachedQuery('User_group', $qry, 3600);
- return $group;
- }
- public function title()
- {
- // TRANS: Title for groups with the most posts section.
- return _('Active groups');
- }
- public function divId()
- {
- return 'top_groups_by_post';
- }
- }
|