// https://web.archive.org/web/20160405005550/http://portablecontacts.net/draft-spec.html
use Friendica\App;
+use Friendica\Core\Config;
function poco_init(App $a) {
- require_once 'include/bbcode.php';
-
$system_mode = false;
- if (intval(get_config('system', 'block_public')) || (get_config('system', 'block_local_dir'))) {
+ if (intval(Config::get('system', 'block_public')) || (Config::get('system', 'block_local_dir'))) {
http_status_exit(401);
}
$global = false;
if ($a->argc > 1 && $a->argv[1] === '@server') {
+ require_once 'include/socgraph.php';
// List of all servers that this server knows
$ret = poco_serverlist();
header('Content-type: application/json');
$cid = intval($a->argv[4]);
}
- if (! $system_mode AND ! $global) {
- $contacts = q("SELECT `user`.*,`profile`.`hide-friends` from user left join profile on `user`.`uid` = `profile`.`uid`
+ 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' and `profile`.`is-default` = 1 limit 1",
dbesc($user)
);
- if (! dbm::is_result($contacts) || $contacts[0]['hidewall'] || $contacts[0]['hide-friends']) {
+ if (! dbm::is_result($users) || $users[0]['hidewall'] || $users[0]['hide-friends']) {
http_status_exit(404);
}
- $user = $contacts[0];
+ $user = $users[0];
}
if ($justme) {
if (x($_GET, 'filtered')) {
$ret['filtered'] = false;
}
- if (x($_GET, 'updatedSince') AND ! $global) {
+ if (x($_GET, 'updatedSince') && ! $global) {
$ret['updatedSince'] = false;
}
$ret['startIndex'] = (int) $startIndex;
}
}
- if (($contact['about'] == "") AND isset($contact['pabout'])) {
+ 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']) AND ( $contact['pregion'] != "")) {
+ if (isset($contact['pregion']) && ( $contact['pregion'] != "")) {
if ($contact['location'] != "") {
$contact['location'] .= ", ";
}
$contact['location'] .= $contact['pregion'];
}
- if (isset($contact['pcountry']) AND ( $contact['pcountry'] != "")) {
+ if (isset($contact['pcountry']) && ( $contact['pcountry'] != "")) {
if ($contact['location'] != "") {
$contact['location'] .= ", ";
}
}
}
- if (($contact['gender'] == "") AND isset($contact['pgender'])) {
+ if (($contact['gender'] == "") && isset($contact['pgender'])) {
$contact['gender'] = $contact['pgender'];
}
- if (($contact['keywords'] == "") AND isset($contact['pub_keywords'])) {
+ if (($contact['keywords'] == "") && isset($contact['pub_keywords'])) {
$contact['keywords'] = $contact['pub_keywords'];
}
if (isset($contact['account-type'])) {
}
$about = Cache::get("about:" . $contact['updated'] . ":" . $contact['nurl']);
if (is_null($about)) {
+ require_once 'include/bbcode.php';
$about = bbcode($contact['about'], false, false);
Cache::set("about:" . $contact['updated'] . ":" . $contact['nurl'], $about);
}
if ($entry['network'] == NETWORK_STATUSNET) {
$entry['network'] = NETWORK_OSTATUS;
}
- if (($entry['network'] == "") AND ($contact['self'])) {
+ if (($entry['network'] == "") && ($contact['self'])) {
$entry['network'] = NETWORK_DFRN;
}
}