]> git.mxchange.org Git - friendica.git/blobdiff - mod/directory.php
Use gravity instead of verb
[friendica.git] / mod / directory.php
index b8b0482127172fd38b4e178aa41a7f147cf4b9d6..a83b1b76ceb6f9aebb60598d2acdf4528227cd95 100644 (file)
@@ -78,15 +78,14 @@ function directory_content(App $a)
                                (`profile`.`prv_keywords` LIKE '%$search%'))";
        }
 
-       $publish = ((Config::get('system', 'publish_all')) ? '' : " AND `publish` = 1 " );
+       $publish = (Config::get('system', 'publish_all') ? '' : " AND `publish` = 1 " );
 
 
-       $total = 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 (DBM::is_result($total)) {
-               $a->set_pager_total($total[0]['total']);
+       $cnt = dba::fetch_first("SELECT COUNT(*) AS `total` FROM `profile`
+                               LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
+                               WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` $sql_extra");
+       if (DBM::is_result($cnt)) {
+               $a->set_pager_total($cnt['total']);
        }
 
        $order = " ORDER BY `name` ASC ";
@@ -97,7 +96,8 @@ function directory_content(App $a)
                        `contact`.`addr`, `contact`.`url` AS profile_url FROM `profile`
                        LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
                        LEFT JOIN `contact` ON `contact`.`uid` = `user`.`uid`
-                       WHERE `is-default` $publish AND `user`.`blocked` = 0 AND `contact`.`self` $sql_extra $order LIMIT ".$limit
+                       WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` AND `contact`.`self`
+                       $sql_extra $order LIMIT $limit"
        );
        if (DBM::is_result($r)) {
                if (in_array('small', $a->argv)) {
@@ -157,7 +157,7 @@ function directory_content(App $a)
                        $location_e = $location;
 
                        $photo_menu = [
-                               'profile' => [L10n::t("View Profile"), Profile::zrl($profile_link)]
+                               'profile' => [L10n::t("View Profile"), Contact::magicLink($profile_link)]
                        ];
 
                        $entry = [