From 484748d080de5cb480684146f51bd38b998905e0 Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Sun, 9 Feb 2014 19:55:57 -0500 Subject: [PATCH] Only retrieve birthdays for members with more than 9 posts --- Sources/Subs-Calendar.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/Subs-Calendar.php b/Sources/Subs-Calendar.php index 8caf58f..233e4a9 100644 --- a/Sources/Subs-Calendar.php +++ b/Sources/Subs-Calendar.php @@ -111,6 +111,7 @@ function getBirthdayRange($low_date, $high_date) $year_high = (int) substr($high_date, 0, 4); // Collect all of the birthdays for this month. I know, it's a painful query. + // xxx added posts > 9 for birthdays $result = $smcFunc['db_query']('birthday_array', ' SELECT id_member, real_name, YEAR(birthdate) AS birth_year, birthdate FROM {db_prefix}members @@ -122,8 +123,9 @@ function getBirthdayRange($low_date, $high_date) DATE_FORMAT(birthdate, {string:year_low}) BETWEEN {date:low_date} AND {date:high_date}' . ($year_low == $year_high ? '' : ' OR DATE_FORMAT(birthdate, {string:year_high}) BETWEEN {date:low_date} AND {date:high_date}') . ' ) - AND is_activated = {int:is_activated}', + AND is_activated = {int:is_activated} AND posts > {int:posts}', array( + 'posts' => 9, 'is_activated' => 1, 'no_month' => 0, 'no_day' => 0,