]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-order.php
More rewrites to configuration:
[mailer.git] / inc / modules / member / what-order.php
index 0cc9a78a8c293836a71eee34f7189fd54bc65dcd..38c953be9906c1a25073a9a6caba076e9279b7e1 100644 (file)
@@ -56,7 +56,7 @@ $data = array(
 );
 
 $ALLOWED = getUserData('receive_mails') - getUserData('mail_orders');
-if (getConfig('order_max_full') == 'MAX') $ALLOWED = getUserData('receive_mails');
+if (getOrderMaxFull() == 'MAX') $ALLOWED = getUserData('receive_mails');
 
 // Now check his points amount
 $totalPoints = getTotalPoints(getMemberId());
@@ -69,6 +69,7 @@ if ((isExtensionInstalledAndNewer('holiday', '0.1.3')) && (isUserDataEnabled('ho
        // Continue with the frametester, we first need to store the data temporary in the pool
        //
        // First we would like to store the data and get it's pool position back...
+       // @TODO Try to move out url_tlock to a filter for extra SQL statements
        $result = SQL_QUERY_ESC("SELECT
        `id`,
        `data_type`
@@ -107,7 +108,7 @@ LIMIT 1",
                        $TEST = str_replace(array(PHP_EOL, chr(13)), array('', ''), postRequestElement('text'));
 
                        // Text length within allowed length?
-                       if (strlen($TEST) > getConfig('max_tlength')) {
+                       if (strlen($TEST) > getMaxTextLength()) {
                                // Text is too long!
                                $data['url'] = 'modules.php?module=login&what=order&code=' . getCode('OVERLENGTH');
                        } // END - if
@@ -428,10 +429,10 @@ LIMIT 1",
 } elseif (postRequestElement('receiver') == '0') {
        // Not enougth receivers selected
        $data['url'] = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS1');
-} elseif (($ALLOWED == '0') && (getConfig('order_max_full') == 'ORDER')) {
+} elseif (($ALLOWED == '0') && (getOrderMaxFull() == 'ORDER')) {
        // No more mail orders allowed
        displayMessage('{--MEMBER_ORDER_ALLOWED_EXHAUSTED--}');
-} elseif (getTotalUnconfirmedMails(getMemberId()) < getConfig('unconfirmed')) {
+} elseif (getTotalUnconfirmedMails(getMemberId()) < getConfig('max_unconfirmed')) {
        // Show only enabled categories to the user ...
        $whereStatement = " WHERE `visible`='Y'";
 
@@ -544,7 +545,7 @@ LIMIT 1",
                        SQL_FREERESULT($result_cats);
 
                        // Now we need to load the mail types...
-                       $result = SQL_QUERY("SELECT `id`, `price`, `payment`, `mail_title` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `payment` ASC", __FILE__, __LINE__);
+                       $result = SQL_QUERY("SELECT `id`, `price`, `payment`, `mail_title` FROM `{?_MYSQL_PREFIX?}_payments` WHERE `price` > 0 AND `payment` > 0 ORDER BY `payment` ASC", __FILE__, __LINE__);
 
                        $payments = array();
                        if (!SQL_HASZERONUMS($result)) {
@@ -566,7 +567,7 @@ LIMIT 1",
                                $content['total_points'] = $totalPoints;
 
                                // Check how many mail orders he has placed today and how many he's allowed to send
-                               switch (getConfig('order_max_full')) {
+                               switch (getOrderMaxFull()) {
                                        case 'MAX': // He is allowed to send as much as possible
                                                $content['order_max_full'] = '{--MEMBER_ORDER_ALLOWED_MAX--}';
                                                break;
@@ -576,7 +577,7 @@ LIMIT 1",
                                                break;
 
                                        default: // Unknown/invalid
-                                               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", getConfig('order_max_full')));
+                                               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown order_mas_full config detected.", getOrderMaxFull()));
                                                $content['order_max_full'] = '{--MEMBER_ORDER_ALLOWED_UNKNOWN--}';
                                                break;
                                } // END - switch