+ if (is_array($r)) {
+ if (dbm::is_result($r)) {
+ foreach ($r as $rr) {
+ if (!isset($rr['generation'])) {
+ if ($global) {
+ $rr['generation'] = 3;
+ } elseif ($system_mode) {
+ $rr['generation'] = 1;
+ } else {
+ $rr['generation'] = 2;
+ }
+ }
+
+ 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'];
+ }
+
+ if (isset($rr['pcountry']) AND ($rr['pcountry'] != "")) {
+ if ($rr['location'] != "") {
+ $rr['location'] .= ", ";
+ }
+ $rr['location'] .= $rr['pcountry'];
+ }
+ }
+
+ if (($rr['gender'] == "") AND isset($rr['pgender'])) {
+ $rr['gender'] = $rr['pgender'];
+ }
+ if (($rr['keywords'] == "") AND isset($rr['pub_keywords'])) {
+ $rr['keywords'] = $rr['pub_keywords'];
+ }
+ if (isset($rr['account-type'])) {
+ $rr['contact-type'] = $rr['account-type'];
+ }
+ $about = Cache::get("about:".$rr['updated'].":".$rr['nurl']);
+ if (is_null($about)) {
+ $about = bbcode($rr['about'], false, false);
+ Cache::set("about:".$rr['updated'].":".$rr['nurl'],$about);
+ }
+
+ // Non connected persons can only see the keywords of a Diaspora account
+ if ($rr['network'] == NETWORK_DIASPORA) {
+ $rr['location'] = "";
+ $about = "";
+ $rr['gender'] = "";
+ }
+