]> git.mxchange.org Git - mailer.git/blobdiff - inc/mails/beg_mails.php
'what','action','module' and 'output_mode' wrapped into functions (WARNUNG: Code...
[mailer.git] / inc / mails / beg_mails.php
index 9a9872f746ee695a9967574d7f67cd0016b6ef98..424d1ccba4a49e25c25cf2f8d2cf84986b3dea9f 100644 (file)
@@ -45,7 +45,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode
-if ($GLOBALS['output_mode'] == 1) return;
+if (getOutputMode() == 1) return;
 
 // Create timemark from saved month
 $mark = mktime(0, 0, 0, getConfig('last_month'), date('d', time()), date('Y', time()));
@@ -53,35 +53,28 @@ $sql = ''; $mode = '';
 
 // Shall I sent activation or deactivation mail?
 $sql = "SELECT userid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE (beg_ral_notify ";
-switch (getConfig('beg_rallye'))
-{
+switch (getConfig('beg_rallye')) {
        case 'Y': // Begging rallye is activated
-               if (getConfig('beg_ral_en_notify') == 'Y')
-               {
+               if (getConfig('beg_ral_en_notify') == 'Y') {
                        // Okay, let's check for member accounts
                        $sql .= "= 0 OR (beg_ral_notify > 0 AND beg_ral_en_notify < beg_ral_di_notify)";
                        $mode = "en";
+               } else {
+                       // Do not notify!
+                       $sql = '';
                }
-        else
-        {
-               // Do not notify!
-               $sql = '';
-        }
-        break;
+               break;
 
        case 'N': // Begging rallye is deactivated
-               if (getConfig('beg_ral_di_notify') == 'Y')
-               {
+               if (getConfig('beg_ral_di_notify') == 'Y') {
                        // Okay, let's check for member accounts
                        $sql .= " > 0 AND beg_ral_di_notify < beg_ral_en_notify";
                        $mode = "di";
+               } else {
+               // Do not notify!
+               $sql = '';
                }
-        else
-        {
-               // Do not notify!
-               $sql = '';
-        }
-        break;
+               break;
 }
 
 if (!empty($sql)) {
@@ -92,13 +85,10 @@ if (!empty($sql)) {
        define('__BEG_MIN_POINTS' , translateComma(getConfig('beg_points')));
        define('__BEG_MAX_POINTS' , translateComma(getConfig('beg_points_max')));
        define('__BEG_MAX_WINNERS', round(getConfig('beg_ranks')));
-       if (getConfig('beg_ip_timeout') == 0)
-       {
+       if (getConfig('beg_ip_timeout') == 0) {
                // No IP locking setuped!
                define('__BEG_IP_LOCKER', getMessage('BEG_NO_LIMITATION'));
-       }
-       else
-       {
+       } else {
                // Create timemark
                define('__BEG_IP_LOCKER', createFancyTime(getConfig('beg_ip_timeout')));
        }