]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-unlock_emails.php
Some more wrappers added, code cleanups:
[mailer.git] / inc / modules / admin / what-unlock_emails.php
index 74384a2434c50551d10d758f531963eb0e6705d4..52faf0d8a9498ad94bb1af7966f2f570c9aea5c6 100644 (file)
@@ -55,9 +55,9 @@ WHERE
 ORDER BY
        `timestamp` ASC", __FILE__, __LINE__);
 
-if ((SQL_NUMROWS($result_main) > 0) || (isFormSent('lock'))) {
+if ((!SQL_HASZERONUMS($result_main)) || (isFormSent('lock'))) {
        if (isFormSent('accept')) {
-               if (countPostSelection() > 0) {
+               if (ifPostContainsSelections()) {
                        // Accept mail orders
                        foreach (postRequestParameter('sel') as $id => $value) {
                                // Secure id number
@@ -93,7 +93,7 @@ LIMIT 1",
                                        } // END - if
 
                                        // Check for bonus extension version >= 0.4.4 for the order bonus
-                                       if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (getConfig('bonus_active') == 'Y')) {
+                                       if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (isBonusRallyeActive())) {
                                                // Add points directly
                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_order`=`bonus_order`+{?bonus_order?} WHERE `userid`=%s LIMIT 1",
                                                        array(bigintval($content['sender'])), __FILE__, __LINE__);
@@ -123,8 +123,8 @@ LIMIT 1",
 
                // Mails unlocked for mail delivery
                loadTemplate('admin_settings_saved', false, $message);
-       } elseif (isPostRequestParameterSet(('reject'))) {
-               if (countPostSelection() > 0) {
+       } elseif (isPostRequestParameterSet('reject')) {
+               if (ifPostContainsSelections()) {
                        // Reject mail orders
                        $OUT = '';
                        foreach (postRequestParameter('sel') as $id => $value) {
@@ -146,7 +146,7 @@ LIMIT 1",
                                sendEmail($content['sender'], '{--MEMBER_ORDER_REJECTED--}', $message_user);
 
                                // If you do not enter an URL to redirect to, your URL will be set!
-                               if ((!isPostRequestParameterSet('redirect')) || (postRequestParameter('redirect') == 'http://')) setPostRequestParameter('redirect', getConfig('URL'));
+                               if ((!isPostRequestParameterSet('redirect')) || (postRequestParameter('redirect') == 'http://')) setPostRequestParameter('redirect', getUrl());
 
                                // Redirect URL
                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET url='%s', `data_type`='NEW' WHERE `id`=%s LIMIT 1",
@@ -168,7 +168,7 @@ LIMIT 1",
                        // Nothing selected
                        loadTemplate('admin_settings_saved', false, '{--ADMIN_MAILS_NOTHING_CHECKED--}');
                }
-       } elseif ((isFormSent('lock')) && (countPostSelection() > 0) && (getConfig('url_blacklist') == 'Y')) {
+       } elseif ((isFormSent('lock')) && (ifPostContainsSelections()) && (getConfig('url_blacklist') == 'Y')) {
                // Lock URLs
                foreach (postRequestParameter('sel') as $id => $url) {
                        // Secure id number