require_once('include/contact_selectors.php');
require_once('mod/contacts.php');
-function common_content(&$a) {
+function common_content(App &$a) {
$o = '';
$a->page['aside'] .= $vcard_widget;
}
- if(! count($c))
+ if (! dbm::is_result($c)) {
return;
+ }
if(! $cid) {
if(get_my_url()) {
dbesc(normalise_link(get_my_url())),
intval($profile_uid)
);
- if(count($r))
+ if (dbm::is_result($r))
$cid = $r[0]['id'];
else {
$r = q("SELECT `id` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
dbesc(normalise_link(get_my_url()))
);
- if(count($r))
+ if (dbm::is_result($r))
$zcid = $r[0]['id'];
}
}
$r = common_friends_zcid($uid, $zcid, $a->pager['start'], $a->pager['itemspage']);
- if(! count($r)) {
+ if (! dbm::is_result($r)) {
return $o;
}
$id = 0;
- foreach($r as $rr) {
+ foreach ($r as $rr) {
//get further details of the contact
$contact_details = get_contact_details_by_url($rr['url'], $uid);
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],
'about' => $contact_details['about'],
- 'account_type' => (($contact_details['community']) ? t('Forum') : ''),
+ 'account_type' => account_type($contact_details),
'network' => network_to_name($contact_details['network'], $contact_details['url']),
'photo_menu' => $photo_menu,
'id' => ++$id,