intval(local_user()),
intval($contact_id)
);
- if(! count($r)) {
+ if(! dbm::is_result($r)) {
$contact_id = 0;
}
}
if (($a->data['contact']['network'] != "") AND ($a->data['contact']['network'] != NETWORK_DFRN)) {
$networkname = format_network_name($a->data['contact']['network'],$a->data['contact']['url']);
- } else
+ } else
$networkname = '';
$vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array(
'$addr' => (($a->data['contact']['addr'] != "") ? ($a->data['contact']['addr']) : ""),
'$network_name' => $networkname,
'$network' => t('Network:'),
- 'account_type' => (($a->data['contact']['forum'] || $a->data['contact']['prv']) ? t('Forum') : '')
+ '$account_type' => account_type($a->data['contact'])
));
$finpeople_widget = '';
$follow_widget = '';
intval($profile_id),
intval(local_user())
);
- if(! count($r)) {
+ if(! dbm::is_result($r)) {
notice( t('Could not locate selected profile.') . EOL);
return;
}
intval($contact_id),
intval(local_user())
);
- if($r && count($r))
+ if($r && dbm::is_result($r))
$a->data['contact'] = $r[0];
return;
intval($contact_id));
} else
// pull feed and consume it, which should subscribe to the hub.
- proc_run(PRIORITY_MEDIUM, "include/onepoll.php", $contact_id, "force");
+ proc_run(PRIORITY_HIGH, "include/onepoll.php", $contact_id, "force");
}
function _contact_update_profile($contact_id) {
'$url' => $url,
'$profileurllabel' => t('Profile URL'),
'$profileurl' => $contact['url'],
- 'account_type' => (($contact['forum'] || $contact['prv']) ? t('Forum') : ''),
+ '$account_type' => account_type($contact),
'$location' => bbcode($contact["location"]),
'$location_label' => t("Location:"),
+ '$xmpp' => bbcode($contact["xmpp"]),
+ '$xmpp_label' => t("XMPP:"),
'$about' => bbcode($contact["about"], false, false),
'$about_label' => t("About:"),
'$keywords' => $contact["keywords"],
intval($a->pager['itemspage'])
);
+ $contacts = array();
+
if(dbm::is_result($r)) {
foreach($r as $rr) {
$contacts[] = _contact_detail_for_template($rr);
$o .= $tab_str;
- $r = q("SELECT `id` FROM `item` WHERE `contact-id` = %d LIMIT 1", intval($contact_id));
- if ($r)
- $o .= posts_from_contact($a, $contact_id);
- elseif ($contact["url"]) {
- $r = q("SELECT `id` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
- dbesc(normalise_link($contact["url"])));
-
- if ($r[0]["id"] <> 0)
- $o .= posts_from_gcontact($a, $r[0]["id"]);
- }
+ $o .= posts_from_contact_url($a, $contact["url"]);
return $o;
}
function _contact_detail_for_template($rr){
- $community = '';
-
switch($rr['rel']) {
case CONTACT_IS_FRIEND:
$dir_icon = 'images/lrarrow.gif';
$sparkle = '';
}
- //test if contact is a forum page
- if (isset($rr['forum']) OR isset($rr['prv']))
- $community = ($rr['forum'] OR $rr['prv']);
-
-
return array(
'img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']),
'edit_hover' => t('Edit contact'),
'thumb' => proxy_url($rr['thumb'], false, PROXY_SIZE_THUMB),
'name' => htmlentities($rr['name']),
'username' => htmlentities($rr['name']),
- 'account_type' => ($community ? t('Forum') : ''),
+ 'account_type' => account_type($rr),
'sparkle' => $sparkle,
'itemurl' => (($rr['addr'] != "") ? $rr['addr'] : $rr['url']),
'url' => $url,