. /** * Base class for sections showing lists of people * * @category Widget * @package GNUsocial * @author Evan Prodromou * @copyright 2009 StatusNet, Inc. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ defined('GNUSOCIAL') || die(); /** * Base class for sections * * These are the widgets that show interesting data about a person * group, or site. * * @copyright 2009 StatusNet, Inc. * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ 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'; } }