"SELECT COUNT(*) AS `total`
FROM `profile`
JOIN `user` ON `user`.`uid` = `profile`.`uid`
- WHERE `user`.`hidewall` = 0
+ WHERE `profile`.`net-publish`
AND MATCH(`pub_keywords`) AGAINST (?)",
$search
);
"SELECT `pub_keywords`, `username`, `nickname`, `user`.`uid`
FROM `user`
JOIN `profile` ON `user`.`uid` = `profile`.`uid`
- WHERE `user`.`hidewall` = 0
+ WHERE `profile`.`net-publish`
AND MATCH(`pub_keywords`) AGAINST (?)
LIMIT ?, ?",
$search,
$cid = intval($a->argv[4]);
}
- if (! $system_mode && ! $global) {
- $users = q("SELECT `user`.*,`profile`.`hide-friends` from user left join profile on `user`.`uid` = `profile`.`uid`
- where `user`.`nickname` = '%s' limit 1",
- DBA::escape($nickname)
- );
- if (! DBA::isResult($users) || $users[0]['hidewall'] || $users[0]['hide-friends']) {
+ if (!$system_mode && !$global) {
+ $user = DBA::fetchFirst("SELECT `user`.`uid`, `user`.`nickname` FROM `user`
+ INNER JOIN `profile` ON `user`.`uid` = `profile`.`uid`
+ WHERE `user`.`nickname` = ? AND NOT `profile`.`hide-friends`",
+ $nickname);
+ if (!DBA::isResult($user)) {
throw new \Friendica\Network\HTTPException\NotFoundException();
}
-
- $user = $users[0];
}
if ($justme) {
return;
}
- $fields = ['nickname', 'page-flags', 'account-type', 'hidewall'];
+ $fields = ['nickname', 'page-flags', 'account-type'];
$user = DBA::selectFirst('user', $fields, ['uid' => $uid]);
if (!DBA::isResult($user)) {
return;