- : datetime_convert('UTC',date_default_timezone_get(),$r[0]['last-update'],'D, j M Y, g:i A'));
-
- if($r[0]['last-update'] !== '0000-00-00 00:00:00')
- $last_update .= ' ' . (($r[0]['last-update'] == $r[0]['success_update']) ? t("\x28Update was successful\x29") : t("\x28Update was not successful\x29"));
-
- $lblsuggest = (($r[0]['network'] === NETWORK_DFRN)
- ? '<div id="contact-suggest-wrapper"><a href="fsuggest/' . $r[0]['id'] . '" id="contact-suggest">' . t('Suggest friends') . '</a></div>' : '');
-
- $poll_enabled = (($r[0]['network'] !== NETWORK_DIASPORA) ? true : false);
+ : datetime_convert('UTC',date_default_timezone_get(),$contact['last-update'],'D, j M Y, g:i A'));
+
+ if($contact['last-update'] !== '0000-00-00 00:00:00')
+ $last_update .= ' ' . (($contact['last-update'] == $contact['success_update']) ? t("\x28Update was successful\x29") : t("\x28Update was not successful\x29"));
+
+ $lblsuggest = (($contact['network'] === NETWORK_DFRN) ? t('Suggest friends') : '');
+
+ $poll_enabled = (($contact['network'] !== NETWORK_DIASPORA) ? true : false);
+
+ $nettype = sprintf( t('Network type: %s'),network_to_name($contact['network']));
+
+ $common = count_common_friends(local_user(),$contact['id']);
+ $common_text = (($common) ? sprintf( tt('%d contact in common','%d contacts in common', $common),$common) : '');
+
+ $polling = (($contact['network'] === NETWORK_MAIL | $contact['network'] === NETWORK_FEED) ? 'polling' : '');
+
+ $x = count_all_friends(local_user(), $contact['id']);
+ $all_friends = (($x) ? t('View all contacts') : '');
+
+ // tabs
+ $tabs = array(
+ array(
+ 'label' => (($contact['blocked']) ? t('Unblock') : t('Block') ),
+ 'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/block',
+ 'sel' => '',
+ ),
+ array(
+ 'label' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
+ 'url' => $a->get_baseurl(true) . '/contacts/' . $contact_id . '/ignore',
+ 'sel' => '',
+ ),
+ array(
+ 'label' => t('Repair'),
+ 'url' => $a->get_baseurl(true) . '/crepair/' . $contact_id,
+ 'sel' => '',
+ )
+ );
+ $tab_tpl = get_markup_template('common_tabs.tpl');
+ $tab_str = replace_macros($tab_tpl, array('$tabs' => $tabs));