);
$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());
// 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`
$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
} // END - if
// And shall I check that his URL is not in the black list?
- if (isUrlBlacklisted(postRequestElement('url'))) {
+ if ((isExtensionActive('blacklist')) && (isUrlBlacklisted(postRequestElement('url')))) {
// Create redirect-URL
$data['url'] = 'modules.php?module=login&what=order&code=' . getCode('BLIST_URL') . '&blist=' . $GLOBALS['blacklist_data'][postRequestElement('url')]['timestamp'];
} // END - if
} // 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')) {
} 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'";
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)) {
$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;
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
$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'] .= ' <option value="' . $payments[$key]['id'] . '"';
- if (($OLD_ORDER) && ($content['payment_id'] == $payments[$key]['id'])) $content['type_selection'] .= ' selected="selected"';
- $content['type_selection'] .= '>{%pipe,translateComma=' . $payments[$key]['price'] . '%} {--PER_MAIL--} - ' . $payments[$key]['mail_title'] . ' - ' . round($payments[$key]['payment']) . ' {--PAYMENT--}</option>';
+ $content['payment_selection'] .= ' <option value="' . $payments[$key]['id'] . '"';
+ if (($OLD_ORDER) && ($content['payment_id'] == $payments[$key]['id'])) $content['payment_selection'] .= ' selected="selected"';
+ $content['payment_selection'] .= '>{%pipe,translateComma=' . $payments[$key]['price'] . '%} {--PER_MAIL--} - ' . $payments[$key]['mail_title'] . ' - ' . round($payments[$key]['payment']) . ' {--PAYMENT--}</option>';
} // END - if
} // END - foreach