]> git.mxchange.org Git - friendica.git/blobdiff - mod/directory.php
More usage of dbm::is_result($r) instead of count($r):
[friendica.git] / mod / directory.php
index 9050a050a60e7211d24544477ad91af7d630b3c6..d83fe244ab0669ac415b7b18f7898b1b9768c9aa 100644 (file)
@@ -78,7 +78,7 @@ function directory_content(&$a) {
        $r = $db->q("SELECT COUNT(*) AS `total` FROM `profile`
                        LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
                        WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 $sql_extra ");
-       if(count($r))
+       if(dbm::is_result($r))
                $a->set_pager_total($r[0]['total']);
 
        $order = " ORDER BY `name` ASC ";
@@ -90,7 +90,7 @@ function directory_content(&$a) {
                        LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
                        LEFT JOIN `contact` ON `contact`.`uid` = `user`.`uid`
                        WHERE `is-default` = 1 $publish AND `user`.`blocked` = 0 AND `contact`.`self` $sql_extra $order LIMIT ".$limit);
-       if(count($r)) {
+       if(dbm::is_result($r)) {
 
                if(in_array('small', $a->argv))
                        $photo = 'thumb';
@@ -99,7 +99,6 @@ function directory_content(&$a) {
 
                foreach($r as $rr) {
 
-                       $community = '';
                        $itemurl= '';
 
                        $itemurl = (($rr['addr'] != "") ? $rr['addr'] : $rr['profile_url']);
@@ -128,13 +127,6 @@ function directory_content(&$a) {
 //                     if(strlen($rr['gender']))
 //                             $details .= '<br />' . t('Gender: ') . $rr['gender'];
 
-
-                       // show if account is a community account
-                       /// @TODO The other page types should be also respected, but first we need a good 
-                       /// translatiion and systemwide consistency for displaying the page type
-                       if((intval($rr['page-flags']) == PAGE_COMMUNITY) OR (intval($rr['page-flags']) == PAGE_PRVGROUP))
-                               $community = true;
-
                        $profile = $rr;
 
                        if((x($profile,'address') == 1)
@@ -171,7 +163,7 @@ function directory_content(&$a) {
                                'img_hover' => $rr['name'],
                                'name' => $rr['name'],
                                'details' => $details,
-                               'account_type' => ($community ? t('Forum') : ''),
+                               'account_type' => account_type($rr),
                                'profile' => $profile,
                                'location' => $location_e,
                                'tags' => $rr['pub_keywords'],
@@ -206,7 +198,7 @@ function directory_content(&$a) {
                        '$gdirpath' => $gdirpath,
                        '$desc' => t('Find on this site'),
                        '$contacts' => $entries,
-                       '$finding' => t('Finding:'),
+                       '$finding' => t('Results for:'),
                        '$findterm' => (strlen($search) ? $search : ""),
                        '$title' => t('Site Directory'),
                        '$submit' => t('Find'),