X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fviewcontacts.php;h=30ae92f8e32e7d2a6a5c530bc380b2109cc56a1b;hb=3359f3f5c7ecc4b6a34c4fcfc095ab4dd5fab0f1;hp=c9f465676cfe6da34991f3290cae8a998b0a10be;hpb=d4c3dcf2fccefcb2c79881be09fd3b1c73dc611a;p=friendica.git diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php index c9f465676c..30ae92f8e3 100644 --- a/mod/viewcontacts.php +++ b/mod/viewcontacts.php @@ -1,10 +1,15 @@ data['user'] = $r[0]; $a->profile_uid = $r[0]['uid']; @@ -28,10 +34,10 @@ function viewcontacts_init(&$a) { } -function viewcontacts_content(&$a) { +function viewcontacts_content(App $a) { require_once("mod/proxy.php"); - if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) { notice( t('Public access denied.') . EOL); return; } @@ -47,18 +53,20 @@ function viewcontacts_content(&$a) { } $r = q("SELECT COUNT(*) AS `total` FROM `contact` - WHERE `uid` = %d AND (NOT `blocked` OR `pending`) AND NOT `hidden` AND NOT `archive` + WHERE `uid` = %d AND NOT `blocked` AND NOT `pending` + AND NOT `hidden` AND NOT `archive` AND `network` IN ('%s', '%s', '%s')", intval($a->profile['uid']), dbesc(NETWORK_DFRN), dbesc(NETWORK_DIASPORA), dbesc(NETWORK_OSTATUS) ); - if (dbm::is_result($r)) + if (DBM::is_result($r)) $a->set_pager_total($r[0]['total']); $r = q("SELECT * FROM `contact` - WHERE `uid` = %d AND (NOT `blocked` OR `pending`) AND NOT `hidden` AND NOT `archive` + WHERE `uid` = %d AND NOT `blocked` AND NOT `pending` + AND NOT `hidden` AND NOT `archive` AND `network` IN ('%s', '%s', '%s') ORDER BY `name` ASC LIMIT %d, %d", intval($a->profile['uid']), @@ -68,16 +76,18 @@ function viewcontacts_content(&$a) { intval($a->pager['start']), intval($a->pager['itemspage']) ); - if (!dbm::is_result($r)) { + if (!DBM::is_result($r)) { info(t('No contacts.').EOL); return $o; } $contacts = array(); - foreach($r as $rr) { - if($rr['self']) + foreach ($r as $rr) { + /// @TODO This triggers an E_NOTICE if 'self' is not there + if ($rr['self']) { continue; + } $url = $rr['url']; @@ -90,19 +100,19 @@ function viewcontacts_content(&$a) { else $url = zrl($url); - $contact_details = get_contact_details_by_url($rr['url'], $a->profile['uid'], $rr); + $contact_details = Contact::getDetailsByURL($rr['url'], $a->profile['uid'], $rr); $contacts[] = array( 'id' => $rr['id'], 'img_hover' => sprintf( t('Visit %s\'s profile [%s]'), $contact_details['name'], $rr['url']), - 'photo_menu' => contact_photo_menu($rr), + 'photo_menu' => Contact::photoMenu($rr), 'thumb' => proxy_url($contact_details['thumb'], false, PROXY_SIZE_THUMB), 'name' => htmlentities(substr($contact_details['name'],0,20)), 'username' => htmlentities($contact_details['name']), 'details' => $contact_details['location'], 'tags' => $contact_details['keywords'], 'about' => $contact_details['about'], - 'account_type' => account_type($contact_details), + 'account_type' => Contact::getAccountType($contact_details), 'url' => $url, 'sparkle' => '', 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),