intval(local_user()),
intval($contact_id)
);
- if(! count($r)) {
+ if(! dbm::is_result($r)) {
$contact_id = 0;
}
}
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) {
$r = q("SELECT COUNT(*) AS `total` FROM `contact`
WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ",
intval($_SESSION['uid']));
- if(count($r)) {
+ if(dbm::is_result($r)) {
$a->set_pager_total($r[0]['total']);
$total = $r[0]['total'];
}
$contacts = array();
- if(count($r)) {
+ 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;
}