X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fpoco.php;h=7dcf3b4a02e3794a2d2dbbb17a76aa72a751f60a;hb=74479c4020499e6aa7866b5478366932b723c515;hp=c5f5427b9e85b33e86a0a6d877fea1016f058ee9;hpb=0cd241bcbe762e38e2eba0c58800eb60a2240e36;p=friendica.git diff --git a/mod/poco.php b/mod/poco.php index c5f5427b9e..7dcf3b4a02 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -2,6 +2,8 @@ // See here for a documentation for portable contacts: // https://web.archive.org/web/20160405005550/http://portablecontacts.net/draft-spec.html +use Friendica\App; + function poco_init(App $a) { require_once("include/bbcode.php"); @@ -157,27 +159,27 @@ function poco_init(App $a) { if (x($_GET,'updatedSince') AND !$global) { $ret['updatedSince'] = false; } - $ret['startIndex'] = (int) $startIndex; $ret['itemsPerPage'] = (int) $itemsPerPage; $ret['totalResults'] = (int) $totalResults; $ret['entry'] = array(); + $fields_ret = array( - 'id' => false, - 'displayName' => false, - 'urls' => false, - 'updated' => false, + 'id' => false, + 'displayName' => false, + 'urls' => false, + 'updated' => false, 'preferredUsername' => false, - 'photos' => false, - 'aboutMe' => false, - 'currentLocation' => false, - 'network' => false, - 'gender' => false, - 'tags' => false, - 'address' => false, - 'contactType' => false, - 'generation' => false + 'photos' => false, + 'aboutMe' => false, + 'currentLocation' => false, + 'network' => false, + 'gender' => false, + 'tags' => false, + 'address' => false, + 'contactType' => false, + 'generation' => false ); if ((! x($_GET,'fields')) || ($_GET['fields'] === '@all')) { @@ -207,17 +209,14 @@ function poco_init(App $a) { if (($rr['about'] == "") AND isset($rr['pabout'])) { $rr['about'] = $rr['pabout']; } - if ($rr['location'] == "") { if (isset($rr['plocation'])) { $rr['location'] = $rr['plocation']; } - if (isset($rr['pregion']) AND ($rr['pregion'] != "")) { if ($rr['location'] != "") { $rr['location'] .= ", "; } - $rr['location'] .= $rr['pregion']; } @@ -295,7 +294,6 @@ function poco_init(App $a) { } else { $entry['updated'] = $rr['updated']; } - $entry['updated'] = date("c", strtotime($entry['updated'])); } if ($fields_ret['photos']) { @@ -349,7 +347,6 @@ function poco_init(App $a) { if ($fields_ret['contactType']) { $entry['contactType'] = intval($rr['contact-type']); } - $ret['entry'][] = $entry; } } else { @@ -358,7 +355,6 @@ function poco_init(App $a) { } else { http_status_exit(500); } - logger("End of poco", LOGGER_DEBUG); if ($format === 'xml') { @@ -373,5 +369,4 @@ function poco_init(App $a) { } else { http_status_exit(500); } - }