X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=doubler.php;h=a9b0a2ce5005b0a50cbf72b68a9c267c9a4ce8eb;hp=a9ab0c8ac952287c985acd9c704b3cb9571408de;hb=8729e9b2566751c19f225e86daa86730f25c49b0;hpb=32f930539d6b5cb5e603bece41277f3e5cca8fa9 diff --git a/doubler.php b/doubler.php index a9ab0c8ac9..a9b0a2ce50 100644 --- a/doubler.php +++ b/doubler.php @@ -10,13 +10,8 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Punkteverdoppler * * -------------------------------------------------------------------- * - * $Revision:: $ * - * $Date:: $ * - * $Tag:: 0.2.1-FINAL $ * - * $Author:: $ * - * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -76,7 +71,7 @@ if (isFormSent()) { } // Is the data valid? - if (!isUserDataValid()) { + if (!isValidUserData()) { // Output message that the userid is not okay displayMessage('{--DOUBLER_USERID_INVALID--}'); } // END - if @@ -88,7 +83,7 @@ if (isFormSent()) { $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)) { + if ((isValidUserData()) && (getUserData('password') == generateHash(postRequestElement('password'), substr(getUserData('password'), 0, -40))) && (getUserData('status') == 'CONFIRMED') && ($probe_points)) { // Nickname resolved to a unique userid or direct userid entered by the member $GLOBALS['local_doubler_userid'] = getUserData('userid'); @@ -99,12 +94,12 @@ if (isFormSent()) { 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')", + sqlQueryEscaped("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'), convertZeroToNull(determineReferralId()), bigintval(postRequestElement('points') * 2), - detectRemoteAddr() + determineRealRemoteAddress() ), __FILE__, __LINE__); // Subtract entered points and ignore return status @@ -116,13 +111,13 @@ if (isFormSent()) { incrementConfigEntry('doubler_points', $points); // Add second line for the referral but only when userid != refid - if ((isValidUserId(determineReferralId())) && (determineReferralId() != getUserData('userid'))) { + 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')", + sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES (%s,0,%s,'%s',UNIX_TIMESTAMP(),'N','Y')", array( convertZeroToNull(determineReferralId()), (postRequestElement('points') * 2 * getDoublerRef() / 100), - detectRemoteAddr() + determineRealRemoteAddress() ), __FILE__, __LINE__); // And that's why we don't want to you more than one referral level of doubler-points. ^^^ @@ -177,16 +172,9 @@ if (getDoublerSendMode() == 'DIRECT') { } // END - if // Output header -loadIncludeOnce('inc/header.php'); - -// Banner in text -$content['banner'] = loadTemplate('doubler_banner', TRUE); - -// Load header/footer templates -$content['header'] = loadTemplate('doubler_header', TRUE); -$content['footer'] = loadTemplate('doubler_footer', TRUE); +loadPageHeader(); -if (isUserDataValid()) { +if (isValidUserData()) { // Transfer userid/nickname to constant $content['refid'] = getUserData('userid'); } else { @@ -213,7 +201,7 @@ $content['payout_history'] = generateDoublerTable(0, 'Y', 'N', 'DESC'); loadTemplate('doubler_index', FALSE, $content); // Output footer -loadIncludeOnce('inc/footer.php'); +loadPageFooter(); // [EOF] ?>