+ }
+ }
+ if ($fields_ret['tags']) {
+ $tags = str_replace(","," ",$rr['keywords']);
+ $tags = explode(" ", $tags);
+
+ $cleaned = array();
+ foreach ($tags as $tag) {
+ $tag = trim(strtolower($tag));
+ if ($tag != "") {
+ $cleaned[] = $tag;
+ }
+ }
+
+ $entry['tags'] = array($cleaned);
+ }
+ if ($fields_ret['address']) {
+ $entry['address'] = array();
+
+ // 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['plocation'])) {
+ $entry['address']['locality'] = $rr['plocation'];
+ }
+ if (isset($rr['pregion'])) {
+ $entry['address']['region'] = $rr['pregion'];
+ }
+ // See above
+ //if (isset($rr['ppostalcode']))
+ // $entry['address']['postalCode'] = $rr['ppostalcode'];
+
+ if (isset($rr['pcountry'])) {
+ $entry['address']['country'] = $rr['pcountry'];
+ }
+ }
+
+ if ($fields_ret['contactType']) {
+ $entry['contactType'] = intval($rr['contact-type']);