From c049d942e9382df1a6ef209f43acd6acc4c18ff8 Mon Sep 17 00:00:00 2001 From: Jay Trees Date: Fri, 8 Apr 2022 16:36:08 +0200 Subject: [PATCH] Cap required release candidates needed --- src/pages/profile.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/pages/profile.php b/src/pages/profile.php index 119a5211..916b7e95 100644 --- a/src/pages/profile.php +++ b/src/pages/profile.php @@ -336,13 +336,22 @@ $page->navigation(); = CURDATE() - INTERVAL 30 DAY'; - $count_users = $database + $count_users = $database ->query('SELECT COUNT(`id`) FROM `users` WHERE ' . $user_is_active . ';') ->fetch(); - $count_users = reset($count_users); - $count_users_needed = max(1, round($count_users * 0.05, 0)); + $count_users = reset($count_users); + + $count_users_needed_minimum = 1; + $count_users_needed_maximum = 100; + $count_users_needed = min( + $count_users_needed_maximum, + max( + $count_users_needed_minimum, + round($count_users * 0.05, 0) + ) + ); $count_users_rc = $database ->query('SELECT COUNT(`id`)