X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Freset%2Freset_birthday.php;h=fb4feb0b5e3de5160f65378ed25ad99bd25d42fe;hb=8ffce31d9ae39991adf913512d8f5db24fda0b2a;hp=dfadfaca9f0908ec20e1f2c8826aed309d4b9be7;hpb=1ebf518b9552f71ee95de6f4b80e6de3a27716d1;p=mailer.git diff --git a/inc/reset/reset_birthday.php b/inc/reset/reset_birthday.php index dfadfaca9f..fb4feb0b5e 100644 --- a/inc/reset/reset_birthday.php +++ b/inc/reset/reset_birthday.php @@ -1,7 +1,7 @@ 0)) { - $add = " AND `last_online` >= (UNIX_TIMESTAP() - %s)"; + $add = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)"; $value = getConfig('ap_inactive_since'); } // END - if @@ -69,7 +69,8 @@ WHERE `birth_month`=%s AND `birthday_sent` < (UNIX_TIMESTAMP() - ".(getConfig('ONE_DAY') * 364).") ".$add." -ORDER BY `userid` ASC", +ORDER BY + `userid` ASC", array($day, $month, $value), __FILE__, __LINE__); if (SQL_NUMROWS($result_birthday) > 0) { @@ -85,17 +86,19 @@ if (SQL_NUMROWS($result_birthday) > 0) { if (getConfig('birthday_points') > 0) { // Add more entries to the array $content['age'] = $age; - $content['points'] = translateComma(getConfig('birthday_points')); $content['check'] = ''; // @TODO 4 is hard-coded here, should we move it out in config? - for ($idx = 0; $idx < 4; $idx++) { - $content['check'] .= generateRandomCode("8", mt_rand(0, $month.$day), $content['userid'], ($age * ($idx + 1))); + for ($idx = '0'; $idx < 4; $idx++) { + $content['check'] .= generateRandomCode('8', mt_rand(0, $month.$day), $content['userid'], ($age * ($idx + 1))); } // END - for // Insert row into database - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_birthday` (userid, points, chk_value) VALUES ('%s','%s','%s' )", - array(bigintval($content['userid']), getConfig('birthday_points'), $content['check']), __FILE__, __LINE__); + SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_birthday` (`userid`, `points`, `chk_value`) VALUES (%s,{?birthday_points?},'%s' )", + array( + bigintval($content['userid']), + $content['check'] + ), __FILE__, __LINE__); // Load email template with confirmation link $message = loadEmailTemplate('member_birthday_confirm', $content, bigintval($content['userid'])); @@ -105,7 +108,7 @@ if (SQL_NUMROWS($result_birthday) > 0) { } // Send email - sendEmail($content['email'], getMessage('HAPPY_BIRTHDAY'), $message); + sendEmail($content['email'], getMessage('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",