X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-order.php;h=38c953be9906c1a25073a9a6caba076e9279b7e1;hp=a1f7a2a08f284aa3a8a87311af2bbb1a6c940f4c;hb=00790481119eefa7a54a8dda1cb191fdf4f29226;hpb=5ab0d021f3e96722af5d96d2b9036430200c06cb diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index a1f7a2a08f..38c953be99 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -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 @@ -245,7 +246,7 @@ LIMIT 1", } // END - if // Calculate used points - $usedPoints = $content['target_send'] * getPaymentData(bigintval(postRequestElement('mail_type'))); + $usedPoints = $content['target_send'] * getPaymentPrice(bigintval(postRequestElement('mail_type'))); // Fix empty zip code if (!isPostRequestElementSet('zip')) { @@ -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 @@ -636,13 +637,13 @@ LIMIT 1", $content['category_selection'] = generateCategoryOptionsList(((isExtensionActive('html_mail')) && (isPostRequestElementSet('html'))) ? postRequestElement('html') : 'N', getMemberId()); // Mail type - $content['type_selection'] = ''; + $content['payment_selection'] = ''; foreach ($payments as $key => $value) { if (is_array($value)) { // Output option line - $content['type_selection'] .= '