]> git.mxchange.org Git - mailer.git/blobdiff - inc/daily/daily_birthday.php
mailer project continued:
[mailer.git] / inc / daily / daily_birthday.php
index 4ff04e06348dc564d53616bf0d392a60a37bcaa1..96a1a8d8e2088ab8ffd4ececa0b07ec413b8949b 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -65,11 +65,14 @@ if ((getConfig('birthday_active')  == 'Y') && (isExtensionActive('autopurge')) &
 
 // Only confirmed members shall receive birthday mails...
 $result_birthday = SQL_QUERY_ESC("SELECT
-       `userid`,`email`,`birth_year`
+       `userid`,
+       `email`,
+       `birth_year`
 FROM
        `{?_MYSQL_PREFIX?}_user_data`
 WHERE
-       `status`='CONFIRMED' AND
+       `status`='CONFIRMED'
+       " . runFilterChain('user_exclusion_sql', ' ') . " AND
        `birth_day`=%s AND
        `birth_month`=%s AND
        `birthday_sent` < (UNIX_TIMESTAMP() - ({?ONE_DAY?} * 364))
@@ -88,13 +91,13 @@ if (!SQL_HASZERONUMS($result_birthday)) {
                // Simply subtract both values and you got the age... :)
                $age = $now - $bd;
 
-               if (getConfig('birthday_points') > 0) {
+               if (getBirthdayPoints() > 0) {
                        // Add more entries to the array
                        $content['age']    = $age;
                        $content['check']  = '';
 
                        // @TODO 4 is hard-coded here, should we move it out in config?
-                       for ($idx = '0'; $idx < 4; $idx++) {
+                       for ($idx = 0; $idx < 4; $idx++) {
                                $content['check'] .= generateRandomCode('8', mt_rand(0, $month . $day), $content['userid'], ($age * ($idx + 1)));
                        } // END - for
 
@@ -109,7 +112,7 @@ if (!SQL_HASZERONUMS($result_birthday)) {
                        $message = loadEmailTemplate('member_birthday_confirm', $content, bigintval($content['userid']));
                } else {
                        // Load default email template and fill in the age
-                       $message = loadEmailTemplate('member_birthday', $age, $content['userid']);
+                       $message = loadEmailTemplate('member_birthday', $content, $content['userid']);
                }
 
                // Send email