X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fviewcontacts.php;h=3fd5d79e1b4ae16cfaa12739745656617d53b3d9;hb=fc9dbc0899aed223378be677356cd74e722dfd14;hp=6fb3b37fd5dc5be9618d25a7cbcf9eca31717081;hpb=425bd83c8d257c0c2de7d3b7c104df6caa504ed8;p=friendica.git diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php index 6fb3b37fd5..3fd5d79e1b 100644 --- a/mod/viewcontacts.php +++ b/mod/viewcontacts.php @@ -16,8 +16,9 @@ function viewcontacts_init(&$a) { dbesc($nick) ); - if(! count($r)) + if (! dbm::is_result($r)) { return; + } $a->data['user'] = $r[0]; $a->profile_uid = $r[0]['uid']; @@ -47,18 +48,18 @@ function viewcontacts_content(&$a) { } $r = q("SELECT COUNT(*) AS `total` FROM `contact` - WHERE `uid` = %d AND NOT `blocked` AND NOT `hidden` AND NOT `archive` + WHERE `uid` = %d AND (NOT `blocked` OR `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(count($r)) + if (dbm::is_result($r)) $a->set_pager_total($r[0]['total']); $r = q("SELECT * FROM `contact` - WHERE `uid` = %d AND NOT `blocked` AND NOT `hidden` AND NOT `archive` + WHERE `uid` = %d AND (NOT `blocked` OR `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,7 +69,7 @@ function viewcontacts_content(&$a) { intval($a->pager['start']), intval($a->pager['itemspage']) ); - if(!count($r)) { + if (!dbm::is_result($r)) { info(t('No contacts.').EOL); return $o; }