12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- defined('GNUSOCIAL') || die();
- class TopPostersSection extends ProfileSection
- {
- public function getProfiles()
- {
- $limit = PROFILES_PER_SECTION;
- $qry = sprintf(
- <<<'END'
- SELECT *
- FROM profile INNER JOIN (
- SELECT profile_id AS id, COUNT(profile_id) AS value
- FROM notice
- %1$sGROUP BY profile_id
- ) AS t1 USING (id)
- ORDER BY value DESC LIMIT %2$d;
- END,
- (common_config('public', 'localonly') ? 'WHERE notice.is_local = 1 ' : ''),
- $limit
- );
- $profile = Memcached_DataObject::cachedQuery('Profile', $qry, 6 * 3600);
- return $profile;
- }
- public function title()
- {
- // TRANS: Title for top posters section.
- return _('Top posters');
- }
- public function divId()
- {
- return 'top_posters';
- }
- }
|