X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=doubler.php;h=e3e4d073ccc7e59713b0aa966de0640dce3d4288;hb=03cf8f5966d13bab1c193b16ecbdf62fa6fbcce4;hp=2f8b0a234172d0f9c6d54e394ff9e1292eb90d3c;hpb=20741b93fd58620af677a7f1039ffd16ea6ec689;p=mailer.git diff --git a/doubler.php b/doubler.php index 2f8b0a2341..e3e4d073cc 100644 --- a/doubler.php +++ b/doubler.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -39,11 +39,11 @@ require('inc/libs/security_functions.php'); // Init start time -$GLOBALS['startTime'] = microtime(true); +$GLOBALS['__start_time'] = microtime(TRUE); -// Set module -$GLOBALS['module'] = 'doubler'; -$GLOBALS['output_mode'] = '0'; +// Set module and output mode +$GLOBALS['__module'] = 'doubler'; +$GLOBALS['__output_mode'] = '0'; // Load the required file(s) require('inc/config-global.php'); @@ -85,7 +85,7 @@ if (isFormSent()) { setPostRequestElement('points', bigintval(round(convertCommaToDot(postRequestElement('points'))))); // Probe for enough points - $probe_points = ((postRequestElement('points') >= getConfig('doubler_min')) && (postRequestElement('points') <= getConfig('doubler_max'))); + $probe_points = ((postRequestElement('points') >= getDoublerMin()) && (postRequestElement('points') <= getDoublerMax())); // Check all together if ((isUserDataValid()) && (getUserData('password') == generateHash(postRequestElement('password'), substr(getUserData('password'), 0, -40))) && (getUserData('status') == 'CONFIRMED') && ($probe_points)) { @@ -96,13 +96,13 @@ if (isFormSent()) { $points = getTotalPoints(getUserData('userid')); // So let's continue with probing his points amount - if (($points - getConfig('doubler_left') - postRequestElement('points') * getConfig('doubler_charge') / 100) >= 0) { + if (($points - getConfig('doubler_left') - postRequestElement('points') * getDoublerCharge() / 100) >= 0) { // Enough points are left so let's continue with the doubling process // Create doubling "account" with *DOUBLED* points - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`,`refid`,`points`,`remote_ip`,`timemark`,`completed`,`is_ref`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(), 'N','N')", + SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(), 'N','N')", array( getUserData('userid'), - makeZeroToNull(determineReferalId()), + convertZeroToNull(determineReferralId()), bigintval(postRequestElement('points') * 2), detectRemoteAddr() ), __FILE__, __LINE__); @@ -111,28 +111,28 @@ if (isFormSent()) { subtractPoints('doubler', getUserData('userid'), postRequestElement('points')); // Add points to "total payed" including charge - $points = postRequestElement('points') - postRequestElement('points') * getConfig('doubler_charge') / 100; + $points = postRequestElement('points') - postRequestElement('points') * getDoublerCharge() / 100; updateConfiguration('doubler_points', $points, '+'); incrementConfigEntry('doubler_points', $points); - // Add second line for the referal but only when userid != refid - if ((isValidUserId(determineReferalId())) && (determineReferalId() != getUserData('userid'))) { + // Add second line for the referral but only when userid != refid + if ((isValidId(determineReferralId())) && (determineReferralId() != getUserData('userid'))) { // Okay add a refid line and apply refid percents - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`,`refid`,`points`,`remote_ip`,`timemark`,`completed`,`is_ref`) VALUES (%s,0,%s,'%s',UNIX_TIMESTAMP(),'N','Y')", + SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES (%s,0,%s,'%s',UNIX_TIMESTAMP(),'N','Y')", array( - makeZeroToNull(determineReferalId()), - (postRequestElement('points') * 2 * getConfig('doubler_ref') / 100), + convertZeroToNull(determineReferralId()), + (postRequestElement('points') * 2 * getDoublerRef() / 100), detectRemoteAddr() ), __FILE__, __LINE__); - // And that's why we don't want to you more than one referal level of doubler-points. ^^^ + // And that's why we don't want to you more than one referral level of doubler-points. ^^^ } // END - if // Update usage counter updateConfiguration('doubler_counter', 1, '+'); // Set constant - $content['message'] = loadTemplate('doubler_reflink', true, postRequestElement('userid')); + $content['message'] = loadTemplate('doubler_reflink', TRUE, postRequestElement('userid')); } else { // Not enougth points left $content['message'] = '{--DOUBLER_FORM_NO_POINTS_LEFT--}'; @@ -146,10 +146,10 @@ if (isFormSent()) { } elseif (getUserData('status') == 'LOCKED') { // Account is locked by admin / holiday! $content['message'] = '{--DOUBLER_FORM_STATUS_LOCKED--}'; - } elseif (postRequestElement('points') < getConfig('doubler_min')) { + } elseif (postRequestElement('points') < getDoublerMin()) { // Not enougth points entered $content['message'] = '{--DOUBLER_FORM_POINTS_MIN--}'; - } elseif (postRequestElement('points') > getConfig('doubler_max')) { + } elseif (postRequestElement('points') > getDoublerMax()) { // Too much points entered $content['message'] = '{--DOUBLER_FORM_POINTS_MAX--}'; } elseif (isNicknameUsed(postRequestElement('userid'))) { @@ -172,7 +172,7 @@ if (isFormSent()) { } // END - if (isFormSet()) // Shall I check for points immediately? -if (getConfig('doubler_send_mode') == 'DIRECT') { +if (getDoublerSendMode() == 'DIRECT') { loadInclude('inc/mails/doubler_mails.php'); } // END - if @@ -180,18 +180,18 @@ if (getConfig('doubler_send_mode') == 'DIRECT') { loadIncludeOnce('inc/header.php'); // Banner in text -$content['banner'] = loadTemplate('doubler_banner', true); +$content['banner'] = loadTemplate('doubler_banner', TRUE); // Load header/footer templates -$content['header'] = loadTemplate('doubler_header', true); -$content['footer'] = loadTemplate('doubler_footer', true); +$content['header'] = loadTemplate('doubler_header', TRUE); +$content['footer'] = loadTemplate('doubler_footer', TRUE); if (isUserDataValid()) { // Transfer userid/nickname to constant $content['refid'] = getUserData('userid'); } else { // Transfer userid/nickname to constant - $content['refid'] = determineReferalId(); + $content['refid'] = determineReferralId(); } // Text "Enter login" @@ -204,13 +204,13 @@ if (isExtensionActive('nickname')) { } // Which mail-send-mode did the admin setup? -$content['payout_time'] = '{--DOUBLER_PAYOUT_TIME_' . getConfig('doubler_send_mode') . '--}'; +$content['payout_time'] = '{--DOUBLER_PAYOUT_TIME_' . getDoublerSendMode() . '--}'; // Generate table with already payed out doubles $content['payout_history'] = generateDoublerTable(0, 'Y', 'N', 'DESC'); // Output neccessary form for this -loadTemplate('doubler_index', false, $content); +loadTemplate('doubler_index', FALSE, $content); // Output footer loadIncludeOnce('inc/footer.php');