]> git.mxchange.org Git - mailer.git/blobdiff - inc/reset/reset_birthday.php
More wrapper functions introduced, duplicate language strings merged:
[mailer.git] / inc / reset / reset_birthday.php
index 2586efbecae11f653bc48e3a35bf010f7897d2a9..b194ef628f45829cf204e1632717a28b04bf337d 100644 (file)
@@ -46,6 +46,9 @@ if (!defined('__SECURITY')) {
        return;
 }
 
+// Debug line
+//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Daily reset started.');
+
 // Get current day (01 to 31), month (01 to 12) and year (4-digits year)
 $day   = getDay();
 $month = getMonth();
@@ -71,7 +74,7 @@ ORDER BY
        `userid` ASC",
        array($day, $month, $value), __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result_birthday) > 0) {
+if (!SQL_HASZERONUMS($result_birthday)) {
        // Start sending out birthday mails
        while ($content = SQL_FETCHARRAY($result_birthday)) {
                // Calculate own timestamp for birthday and today
@@ -88,7 +91,7 @@ if (SQL_NUMROWS($result_birthday) > 0) {
 
                        // @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)));
+                               $content['check'] .= generateRandomCode('8', mt_rand(0, $month . $day), $content['userid'], ($age * ($idx + 1)));
                        } // END - for
 
                        // Insert row into database
@@ -117,5 +120,8 @@ if (SQL_NUMROWS($result_birthday) > 0) {
        SQL_FREERESULT($result_birthday);
 } // END - if
 
+// Debug line
+//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Daily reset ended.');
+
 // [EOF]
 ?>