X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcontacts.php;h=735ccec727e191599d53282ec2558c4d88afb37b;hb=46d383369cdb2fca67122f15aa2f68dff3f625d1;hp=410cced8e66092326ce9c82a436372e7cf04ca96;hpb=a843858654f475ae6b9ff88fc7bed636b12bd5f6;p=friendica.git diff --git a/mod/contacts.php b/mod/contacts.php index 410cced8e6..735ccec727 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -19,7 +19,7 @@ function contacts_init(&$a) { intval(local_user()), intval($contact_id) ); - if(! count($r)) { + if(! dbm::is_result($r)) { $contact_id = 0; } } @@ -169,7 +169,7 @@ function contacts_post(&$a) { intval($profile_id), intval(local_user()) ); - if(! count($r)) { + if(! dbm::is_result($r)) { notice( t('Could not locate selected profile.') . EOL); return; } @@ -211,7 +211,7 @@ function contacts_post(&$a) { intval($contact_id), intval(local_user()) ); - if($r && count($r)) + if($r && dbm::is_result($r)) $a->data['contact'] = $r[0]; return; @@ -237,7 +237,7 @@ function _contact_update($contact_id) { 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) { @@ -765,7 +765,7 @@ function contacts_content(&$a) { $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']; } @@ -780,8 +780,8 @@ function contacts_content(&$a) { $contacts = array(); - if(count($r)) { - foreach($r as $rr) { + if (dbm::is_result($r)) { + foreach ($r as $rr) { $contacts[] = _contact_detail_for_template($rr); } } @@ -894,16 +894,7 @@ function contact_posts($a, $contact_id) { $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; }