From 7f17c1484a2529f5561e2c74d51d66fbd6ee9aa6 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 25 Apr 2020 23:33:01 +0200 Subject: [PATCH 1/5] Update src/Model/Profile.php Co-Authored-By: Hypolite Petovan --- src/Model/Profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 24db78a00a..dc7e02642a 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -887,7 +887,7 @@ class Profile */ public static function searchProfiles($start = 0, $count = 100, $search = null) { - $publish = (DI::config()->get('system', 'publish_all') ? 'true' : "`publish` = 1"); + $publish = (DI::config()->get('system', 'publish_all') ? '' : "AND `publish` = 1"); $total = 0; if (!empty($search)) { From 37b9031a27e0627a942d6a73a075418ca086b755 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 25 Apr 2020 23:33:11 +0200 Subject: [PATCH 2/5] Update src/Model/Profile.php Co-Authored-By: Hypolite Petovan --- src/Model/Profile.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Model/Profile.php b/src/Model/Profile.php index dc7e02642a..d834024103 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -936,7 +936,13 @@ class Profile ); } else { $profiles = DBA::p("SELECT * FROM `owner-view` - WHERE $publish AND NOT `blocked` AND NOT `account_removed` $order LIMIT ?,?", $start, $count); + WHERE NOT `blocked` AND NOT `account_removed` + $publish + $order + LIMIT ?, ?", + $start, + $count + ); } } From 3f9c78a20bb325983fe7f1823e38884d6a63a314 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 26 Apr 2020 08:04:03 +0200 Subject: [PATCH 3/5] Update src/Model/Profile.php Co-Authored-By: Hypolite Petovan --- src/Model/Profile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Model/Profile.php b/src/Model/Profile.php index d834024103..261c7cc22e 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -893,7 +893,8 @@ class Profile if (!empty($search)) { $searchTerm = '%' . $search . '%'; $cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `owner-view` - WHERE $publish AND NOT `blocked` AND NOT `account_removed` + WHERE NOT `blocked` AND NOT `account_removed` + $publish AND ((`name` LIKE ?) OR (`nickname` LIKE ?) OR (`about` LIKE ?) OR From 3107680e51b0b1fdbcd5fb810574f797e13241a1 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 26 Apr 2020 08:04:17 +0200 Subject: [PATCH 4/5] Update src/Model/Profile.php Co-Authored-By: Hypolite Petovan --- src/Model/Profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 261c7cc22e..9311df83b6 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -906,7 +906,7 @@ class Profile $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm); } else { $cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` - FROM `owner-view` WHERE $publish AND NOT `blocked` AND NOT `account_removed`"); + FROM `owner-view` WHERE NOT `blocked` AND NOT `account_removed` $publish"); } if (DBA::isResult($cnt)) { From 7e8bcc903401e8fb4b014ba0a58a7db1d655a054 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 26 Apr 2020 08:04:34 +0200 Subject: [PATCH 5/5] Update src/Model/Profile.php Co-Authored-By: Hypolite Petovan --- src/Model/Profile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 9311df83b6..e534741232 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -922,7 +922,8 @@ class Profile $searchTerm = '%' . $search . '%'; $profiles = DBA::p("SELECT * FROM `owner-view` - WHERE $publish AND NOT `blocked` AND NOT `account_removed` + WHERE NOT `blocked` AND NOT `account_removed` + $publish AND ((`name` LIKE ?) OR (`nickname` LIKE ?) OR (`about` LIKE ?) OR