$NOW = $YEAR + 12 * $MONTH + 365 * $DAY;
// Simply subtract both values and you got the age... :)
$AGE = $NOW - $BD;
if (getConfig('birthday_points') > 0) {
$NOW = $YEAR + 12 * $MONTH + 365 * $DAY;
// Simply subtract both values and you got the age... :)
$AGE = $NOW - $BD;
if (getConfig('birthday_points') > 0) {
- // Prepare array for loading template
- $content = array(
- 'age' => $AGE,
- 'points' => TRANSLATE_COMMA(getConfig('birthday_points')),
- 'check' => "",
- );
+ // Add more entries to the array
+ $content['age'] = $AGE;
+ $content['points'] = TRANSLATE_COMMA(getConfig('birthday_points'));
+ $content['check'] = "";
- $content['check'] .= generateRandomCodde("8", mt_rand(0, "$MONTH$DAY"), $uid, ($AGE*($idx+1)));
+ $content['check'] .= generateRandomCodde("8", mt_rand(0, "$MONTH$DAY"), $content['userid'], ($AGE*($idx+1)));
}
// Insert row into database
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_birthday` (userid, points, chk_value) VALUES ('%s','%s','%s' )",
}
// Insert row into database
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_birthday` (userid, points, chk_value) VALUES ('%s','%s','%s' )",
- array(bigintval($uid), getConfig('birthday_points'), $content['check']), __FILE__, __LINE__);
+ array(bigintval($content['userid']), getConfig('birthday_points'), $content['check']), __FILE__, __LINE__);
// 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",
// 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",