// Do not execute when script is in CSS mode
return;
} elseif (!isExtensionActive('birthday')) {
+ // Extension not active/installed
logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension disabled.');
return;
}
$month = getMonth();
$year = getYear();
+// Init variable
+$lastOnline = '';
+
// Shall I include only active members?
-$add = '%s'; $value = '';
-if ((getConfig('birthday_active')) && (isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getApInactiveSince() > 0)) {
- $add = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
+if ((getConfig('birthday_active') == 'Y') && (isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
+ $add = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
} // END - if
// Only confirmed members shall receive birthday mails...
-$result_birthday = SQL_QUERY_ESC("SELECT `userid`, `email`, `birth_year`
+$result_birthday = SQL_QUERY_ESC("SELECT
+ `userid`, `email`, `birth_year`
FROM
`{?_MYSQL_PREFIX?}_user_data`
WHERE
`birth_day`=%s AND
`birth_month`=%s AND
`birthday_sent` < (UNIX_TIMESTAMP() - ({?ONE_DAY?} * 364))
- ".$add."
+ ".$lastOnline."
ORDER BY
`userid` ASC",
- array($day, $month, $value), __FILE__, __LINE__);
+ array($day, $month), __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result_birthday)) {
// Start sending out birthday mails
}
// Send email
- sendEmail($content['email'], '{--MEMBER_HAPPY_BIRTHDAY_SUBJECT--}', $message);
+ sendEmail($content['userid'], '{--MEMBER_HAPPY_BIRTHDAY_SUBJECT--}', $message);
// Remember him that he has received a birthday mail
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `birthday_sent`=UNIX_TIMESTAMP() WHERE `userid`=%s LIMIT 1",