]> git.mxchange.org Git - mailer.git/blobdiff - inc/monthly/monthly_beg.php
Caching of expensive PHP functions:
[mailer.git] / inc / monthly / monthly_beg.php
index 67fecfc51473196d2ae2dc8755c2c2ba55744277..63440b567a33a198e2963cc3f88b5777ded38934 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
  * Mailer v0.2.1-FINAL                                Start: 10/22/2005 *
- * ===================                          Last change: 10/22/2005 *
+ * ===================                          Last change: 06/20/2010 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : monthly_beg.php                                  *
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-} elseif (!isExtensionActive('beg')) {
+} elseif ((getOutputMode() == 1) || (!isResetModeEnabled())) {
+       // Do not execute when script is in CSS mode or no daily reset
+       return;
+} elseif ((!isExtensionActive('beg')) || (getConfig('beg_rallye') != 'Y')) {
+       logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension disabled.');
        return;
 }
 
-// Do not execute when script is in CSS mode or no daily reset
-if ((getOutputMode() == 1) || (!isResetModeEnabled()) || (getConfig('beg_rallye') != 'Y')) return;
-//* DEBUG: */ outputHtml(basename(__FILE__)."<br />");
-
 // Get current month (2 digits)
-$curr = date('m', time());
+$curr = getMonth();
 
 // Check if month is done
 if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getConfig('beg_ranks') > 0) && (getOutputMode() != 1)) {
@@ -90,13 +90,9 @@ LIMIT {?beg_ranks?}", __FILE__, __LINE__);
                        // Add points to user's account directly
                        addPointsDirectly('monthly_beg', $content['userid'], $content['points']);
 
-                       // Translate gender/points
-                       $content['gender'] = translateGender($content['gender']);
-                       $content['points'] = translateComma($content['points']);
-
                        // Load email template and email it away
                        $message = loadEmailTemplate('member_beg', $content, bigintval($content['userid']));
-                       sendEmail($content['email'], getMessage('BEG_MONTHLY_RALLYE'), $message);
+                       sendEmail($content['email'], '{--BEG_MONTHLY_RALLYE--}', $message);
                } // END - while
 
                // Reset accounts
@@ -107,5 +103,5 @@ LIMIT {?beg_ranks?}", __FILE__, __LINE__);
        SQL_FREERESULT($result_main);
 } // END - if
 
-//
+// [EOF]
 ?>