true]); $ret['url'] = Channel::url($channel); $ret['avatar'] = $channel['xchan_photo_l']; $ret['avatar_static'] = $channel['xchan_photo_l']; if ($cover_photo) { $ret['header'] = $cover_photo['url']; $ret['header_static'] = $cover_photo['url']; } $ret['followers_count'] = intval($followers[0]['total']); $ret['following_count'] = intval($following[0]['total']); $ret['statuses_count'] = intval($statuses[0]['total']); $ret['last_status_at'] = datetime_convert('UTC', 'UTC', $channel['lastpost'], ATOM_TIME); return $ret; } public static function format_site() { $register = intval(get_config('system', 'register_policy')); $u = q("select count(channel_id) as total from channel where channel_removed = 0"); $i = q("select count(id) as total from item where item_origin = 1"); $s = q("select count(site_url) as total from site"); $admins = q("select * from channel left join account on account_id = channel_account_id where ( account_roles & 4096 ) > 0 and account_default_channel = channel_id"); $adminsx = Channel::from_id($admins[0]['channel_id']); $ret = []; $ret['uri'] = z_root(); $ret['title'] = System::get_site_name(); $ret['description'] = bbcode(get_config('system', 'siteinfo', ''), ['export' => true]); $ret['email'] = get_config('system', 'admin_email'); $ret['version'] = System::get_project_version(); $ret['registrations'] = (($register) ? true : false); $ret['approval_required'] = (($register === REGISTER_APPROVE) ? true : false); $ret['invites_enabled'] = false; $ret['urls'] = []; $ret['stats'] = [ 'user_count' => intval($u[0]['total']), 'status_count' => intval($i[0]['total']), 'domain_count' => intval($s[0]['total']), ]; $ret['contact_account'] = self::format_channel($adminsx); return $ret; } }