]> git.mxchange.org Git - mailer.git/blobdiff - inc/mails/birthday_mails.php
Fixed typo in function name
[mailer.git] / inc / mails / birthday_mails.php
index 0a69e1c09ed01ac7e256086bee540e18f3fe7885..80a1f06a9e269f535b50544c370cfd4fbac99a3a 100644 (file)
@@ -40,8 +40,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode
-global $CSS;
-if (($CSS == 1) || (!defined('__DAILY_RESET'))) return;
+if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return;
 
 // Get current day (01 to 31), month (01 to 12) and year (4-digits year)
 $DAY   = date("d", time());
@@ -57,8 +56,8 @@ if ((getConfig('birthday_active')) && (EXT_IS_ACTIVE("autopurge")) && (getConfig
 
 // Only confirmed members shall receive birthday mails...
 $result_birthday = SQL_QUERY_ESC("SELECT userid, email, birth_year
-FROM `{!MYSQL_PREFIX!}_user_data`
-WHERE status='CONFIRMED' AND birth_day=%s AND birth_month=%s AND birthday_sent < (UNIX_TIMESTAMP() - ".(getConfig('one_day') * 364).")".$ADD."
+FROM `{!_MYSQL_PREFIX!}_user_data`
+WHERE `status`='CONFIRMED' AND birth_day=%s AND birth_month=%s AND birthday_sent < (UNIX_TIMESTAMP() - ".(getConfig('one_day') * 364).")".$ADD."
 ORDER BY userid",
  array($DAY, $MONTH, $VALUE), __FILE__, __LINE__);
 
@@ -81,11 +80,11 @@ if (SQL_NUMROWS($result_birthday) > 0) {
                        );
 
                        for ($idx = 0; $idx < 4; $idx++) {
-                               $content['check'] .= GEN_RANDOM_CODE("8", mt_rand(0, "$MONTH$DAY"), $uid, ($AGE*($idx+1)));
+                               $content['check'] .= generateRandomCodde("8", mt_rand(0, "$MONTH$DAY"), $uid, ($AGE*($idx+1)));
                        }
 
                        // Insert row into database
-                       SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_user_birthday` (userid, points, chk_value) VALUES ('%s','%s','%s' )",
+                       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__);
 
                        // Load email template with confirmation link
@@ -99,7 +98,7 @@ if (SQL_NUMROWS($result_birthday) > 0) {
                SEND_EMAIL($uid, HAPPY_BIRTHDAY, $msg);
 
                // 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",
+               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET birthday_sent=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1",
                        array(bigintval($uid)), __FILE__, __LINE__);
        }