Next join replaced by view

This commit is contained in:
Michael 2020-04-24 12:24:10 +00:00
parent 0950e4bada
commit 3e5c3dce01

View File

@ -4170,20 +4170,11 @@ class Diaspora
*/ */
private static function createProfileData($uid) private static function createProfileData($uid)
{ {
$r = q( $profile = DBA::selectFirst('owner-view', ['uid', 'addr', 'name', 'location', 'net-publish', 'dob', 'about', 'pub_keywords'], ['uid' => $uid]);
"SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `user`.*, `user`.`prvkey` AS `uprvkey`, `contact`.`addr` if (!DBA::isResult($profile)) {
FROM `profile`
INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
INNER JOIN `contact` ON `profile`.`uid` = `contact`.`uid`
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
intval($uid)
);
if (!$r) {
return []; return [];
} }
$profile = $r[0];
$handle = $profile["addr"]; $handle = $profile["addr"];
$split_name = self::splitName($profile['name']); $split_name = self::splitName($profile['name']);
@ -4212,7 +4203,7 @@ class Diaspora
$about = BBCode::toMarkdown($profile['about']); $about = BBCode::toMarkdown($profile['about']);
$location = Profile::formatLocation($profile); $location = $profile['location'];
$tags = ''; $tags = '';
if ($profile['pub_keywords']) { if ($profile['pub_keywords']) {
$kw = str_replace(',', ' ', $profile['pub_keywords']); $kw = str_replace(',', ' ', $profile['pub_keywords']);