. /** * 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 = 'SELECT profile.*, COUNT(*) AS value ' . 'FROM profile JOIN notice ON profile.id = notice.profile_id ' . (common_config('public', 'localonly') ? 'WHERE is_local = 1 ' : '') . 'GROUP BY profile.id, nickname, fullname, profileurl, homepage, bio, location, profile.created, profile.modified ' . 'ORDER BY value DESC LIMIT ' . $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'; } }