require_once('include/Contact.php');
require_once('include/contact_selectors.php');
-function viewcontacts_init(&$a) {
+function viewcontacts_init(App $a) {
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
return;
dbesc($nick)
);
- if(! count($r))
+ if (! dbm::is_result($r)) {
return;
+ }
$a->data['user'] = $r[0];
$a->profile_uid = $r[0]['uid'];
}
-function viewcontacts_content(&$a) {
+function viewcontacts_content(App $a) {
require_once("mod/proxy.php");
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
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`
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
- if(!count($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'];