X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fcontact_widgets.php;h=b359781ffd734b818187caaa65df898bc57ac9ba;hb=dbb5df7f7d65e4f94add3f0684d9bff40e5f8167;hp=0b82fcb8f36b64b090fe82a99e14d07225d74123;hpb=5921fd03e57b8e95a8f21656c2c37eb0ff974767;p=friendica.git diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 0b82fcb8f3..b359781ffd 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -1,8 +1,11 @@ $rr['network'], 'name' => network_to_name($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' )); - } + while ($rr = dba::fetch($r)) { + /// @TODO If 'network' is not there, this triggers an E_NOTICE + if ($rr['network']) { + $nets[] = array('ref' => $rr['network'], 'name' => network_to_name($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' )); } } + dba::close($r); if (count($nets) < 2) { return ''; @@ -229,18 +230,14 @@ function common_friends_visitor_widget($profile_uid) { if (! $cid) { if (get_my_url()) { - $r = q("select id from contact where nurl = '%s' and uid = %d limit 1", - dbesc(normalise_link(get_my_url())), - intval($profile_uid) - ); + $r = dba::select('contact', array('id'), + array('nurl' => normalise_link(get_my_url()), 'uid' => $profile_uid), array('limit' => 1)); if (dbm::is_result($r)) { - $cid = $r[0]['id']; + $cid = $r['id']; } else { - $r = q("select id from gcontact where nurl = '%s' limit 1", - dbesc(normalise_link(get_my_url())) - ); + $r = dba::select('gcontact', array('id'), array('nurl' => normalise_link(get_my_url())), array('limit' => 1)); if (dbm::is_result($r)) - $zcid = $r[0]['id']; + $zcid = $r['id']; } } } @@ -268,7 +265,7 @@ function common_friends_visitor_widget($profile_uid) { return replace_macros(get_markup_template('remote_friends_common.tpl'), array( '$desc' => sprintf( tt("%d contact in common", "%d contacts in common", $t), $t), - '$base' => App::get_baseurl(), + '$base' => System::baseUrl(), '$uid' => $profile_uid, '$cid' => (($cid) ? $cid : '0'), '$linkmore' => (($t > 5) ? 'true' : ''),