From 2465bbaac85657c60f03f0e87976c388e55555f5 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 28 Mar 2018 08:04:20 +0000 Subject: [PATCH] Fixed SQL query --- mod/directory.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mod/directory.php b/mod/directory.php index f1e079d681..1179b6c53a 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -78,13 +78,12 @@ 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 " ); - $cnt = dba::selectFirst("SELECT COUNT(*) AS `total` FROM `profile` + $cnt = dba::fetch_first("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 " - ); + WHERE `is-default` $publish AND NOT `user`.`blocked` $sql_extra"); if (DBM::is_result($cnt)) { $a->set_pager_total($cnt['total']); }