]> git.mxchange.org Git - friendica.git/blobdiff - mod/viewcontacts.php
added spaces + curly braces
[friendica.git] / mod / viewcontacts.php
index 2eae8fec8e41813cdf3e21d19e80c584d6a71d40..3fd5d79e1b4ae16cfaa12739745656617d53b3d9 100644 (file)
@@ -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 `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
+               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 `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
+               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;
        }
@@ -102,7 +103,7 @@ function viewcontacts_content(&$a) {
                        'details'       => $contact_details['location'],
                        'tags'          => $contact_details['keywords'],
                        'about'         => $contact_details['about'],
-                       'account_type'  => (($contact_details['community']) ? t('Forum') : ''),
+                       'account_type'  => account_type($contact_details),
                        'url' => $url,
                        'sparkle' => '',
                        'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),