);
} elseif ($system_mode) {
Logger::log("Start system mode query", Logger::DEBUG);
- $contacts = q("SELECT `contact`.*, `profile`.`about` AS `pabout`, `profile`.`locality` AS `plocation`, `profile`.`pub_keywords`,
- `profile`.`address` AS `paddress`, `profile`.`region` AS `pregion`,
- `profile`.`postal-code` AS `ppostalcode`, `profile`.`country-name` AS `pcountry`, `user`.`account-type`
- FROM `contact` INNER JOIN `profile` ON `profile`.`uid` = `contact`.`uid`
- INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
- WHERE `self` = 1 AND `profile`.`net-publish`
- LIMIT %d, %d",
- intval($startIndex),
- intval($itemsPerPage)
- );
+ $contacts = DBA::selectToArray('owner-view', [], ['net-publish' => true], ['limit' => [$startIndex, $itemsPerPage]]);
} else {
Logger::log("Start query for user " . $user['nickname'], Logger::DEBUG);
$contacts = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
}
}
- if (($contact['about'] == "") && isset($contact['pabout'])) {
- $contact['about'] = $contact['pabout'];
- }
- if ($contact['location'] == "") {
- if (isset($contact['plocation'])) {
- $contact['location'] = $contact['plocation'];
- }
- if (isset($contact['pregion']) && ( $contact['pregion'] != "")) {
- if ($contact['location'] != "") {
- $contact['location'] .= ", ";
- }
- $contact['location'] .= $contact['pregion'];
- }
-
- if (isset($contact['pcountry']) && ( $contact['pcountry'] != "")) {
- if ($contact['location'] != "") {
- $contact['location'] .= ", ";
- }
- $contact['location'] .= $contact['pcountry'];
- }
- }
-
if (($contact['keywords'] == "") && isset($contact['pub_keywords'])) {
$contact['keywords'] = $contact['pub_keywords'];
}
$entry['address'] = [];
// Deactivated. It just reveals too much data. (Although its from the default profile)
- //if (isset($rr['paddress']))
- // $entry['address']['streetAddress'] = $rr['paddress'];
+ //if (isset($rr['address']))
+ // $entry['address']['streetAddress'] = $rr['address'];
- if (isset($contact['plocation'])) {
- $entry['address']['locality'] = $contact['plocation'];
+ if (isset($contact['locality'])) {
+ $entry['address']['locality'] = $contact['locality'];
}
- if (isset($contact['pregion'])) {
- $entry['address']['region'] = $contact['pregion'];
+ if (isset($contact['region'])) {
+ $entry['address']['region'] = $contact['region'];
}
// See above
- //if (isset($rr['ppostalcode']))
- // $entry['address']['postalCode'] = $rr['ppostalcode'];
+ //if (isset($rr['postal-code']))
+ // $entry['address']['postalCode'] = $rr['postal-code'];
- if (isset($contact['pcountry'])) {
- $entry['address']['country'] = $contact['pcountry'];
+ if (isset($contact['country'])) {
+ $entry['address']['country'] = $contact['country'];
}
}
$sql_extra = sprintf(" AND `item`.`private` != %s ", Item::PRIVATE);
- $r = q(
- "SELECT `contact`.*, `user`.`nickname`, `user`.`timezone`, `user`.`page-flags`, `user`.`account-type`
- FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
- WHERE `contact`.`self` AND `user`.`nickname` = '%s' LIMIT 1",
- DBA::escape($owner_nick)
- );
-
- if (! DBA::isResult($r)) {
+ $owner = DBA::selectFirst('owner-view', [], ['nickname' => $owner_nick]);
+ if (!DBA::isResult($owner)) {
Logger::log(sprintf('No contact found for nickname=%d', $owner_nick), Logger::WARNING);
exit();
}
- $owner = $r[0];
$owner_id = $owner['uid'];
$sql_post_table = "";
}
// Only show contact details when we are allowed to
- $r = q(
- "SELECT `profile`.`about`, `profile`.`name`, `profile`.`homepage`, `user`.`nickname`,
- `user`.`timezone`, `profile`.`locality`, `profile`.`region`, `profile`.`country-name`,
- `profile`.`pub_keywords`, `profile`.`xmpp`, `profile`.`dob`
- FROM `profile`
- INNER JOIN `user` ON `user`.`uid` = `profile`.`uid`
- WHERE NOT `user`.`hidewall` AND `user`.`uid` = %d",
- intval($owner['uid'])
- );
- if (DBA::isResult($r)) {
- $profile = $r[0];
-
+ $profile = DBA::selectFirst('owner-view',
+ ['about', 'name', 'homepage', 'nickname', 'timezone', 'locality', 'region', 'country-name', 'pub_keywords', 'xmpp', 'dob'],
+ ['uid' => $owner['uid'], 'hidewall' => false]);
+ if (DBA::isResult($profile)) {
XML::addElement($doc, $author, "poco:displayName", $profile["name"]);
XML::addElement($doc, $author, "poco:updated", $namdate);
"notify_new_posts" => ["notify_new_posts"],
"fetch_further_information" => ["fetch_further_information"],
"ffi_keyword_blacklist" => ["ffi_keyword_blacklist"],
+ "guid" => ["user", "guid"],
+ "theme" => ["user", "theme"],
+ "language" => ["user", "language"],
"email" => ["user", "email"],
"uprvkey" => ["user", "prvkey"],
"upubkey" => ["user", "pubkey"],
"timezone" => ["user", "timezone"],
- "nickname" => ["user", "nickname"], /// @todo Remove duplicate
+ "nickname" => ["user", "nickname"], /// @todo Replaces all uses of "nickname" with "nick"
+ "username" => ["user", "username"], /// @todo Replaces all uses of "username" with "name"
"sprvkey" => ["user", "sprvkey"],
"spubkey" => ["user", "spubkey"],
"page-flags" => ["user", "page-flags"],