X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Freferal-functions.php;h=001b7724cdb59807f5aa87029fcf86fb31429605;hb=9d83303b8272d7ea91b0e661609e48894262a432;hp=384f1a8a88d2a4191932da6b01b9bb18f5d48de5;hpb=ed3a88c0334600c7d7246480008c79716aa3f80b;p=mailer.git diff --git a/inc/referal-functions.php b/inc/referal-functions.php index 384f1a8a88..001b7724cd 100644 --- a/inc/referal-functions.php +++ b/inc/referal-functions.php @@ -160,7 +160,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = NUL // No entry updated? if (SQL_HASZEROAFFECTED()) { // First ref in this level! :-) - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`, `ref_depth`, `%s`) VALUES (%s, %s, %s)", + SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`,`ref_depth`,`%s`) VALUES (%s, %s, %s)", array( $pointsColumn, bigintval($userid), @@ -293,7 +293,7 @@ function updateReferalCounter ($userid) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ref=' . $ref . ',level=' . $GLOBALS['cache_array']['ref_level'][$ref] . ',updated=' . SQL_AFFECTEDROWS()); if (SQL_HASZEROAFFECTED()) { // First count! - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_refsystem` (`userid`, `level`, `counter`) VALUES (%s,%s,1)", + SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_refsystem` (`userid`,`level`,`counter`) VALUES (%s,%s,1)", array( bigintval($ref), makeZeroToNull($GLOBALS['cache_array']['ref_level'][$ref]) @@ -373,12 +373,6 @@ ORDER BY if (!SQL_HASZERONUMS($result)) { // Fetch all entries while ($row = SQL_FETCHARRAY($result)) { - // Get total points of this user - $row['points'] = getTotalPoints($row['refid']); - - // Get unconfirmed mails - $row['unconfirmed'] = getTotalUnconfirmedMails($row['refid']); - // Init click rate with zero $row['click_rate'] = '0'; @@ -435,7 +429,7 @@ function getPointsDataArrayFromSubject ($subject) { } // END - if // Now checkout the entry in database table - $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `column_name`, `locked_mode`, `payment_method`, `notify_recipient` FROM `{?_MYSQL_PREFIX?}_points_data` WHERE `subject`='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `id`,`subject`,`column_name`,`locked_mode`,`payment_method`,`notify_recipient` FROM `{?_MYSQL_PREFIX?}_points_data` WHERE `subject`='%s' LIMIT 1", array($subject), __FUNCTION__, __LINE__); // Do we have an entry? @@ -449,7 +443,7 @@ function getPointsDataArrayFromSubject ($subject) { } // END - foreach } else { // Register this automatically - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`, `column_name`, `locked_mode`, `payment_method`, `notify_recipient`) VALUES ('%s','points','LOCKED','REFERAL','N')", + SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`,`column_name`,`locked_mode`,`payment_method`,`notify_recipient`) VALUES ('%s','points','LOCKED','REFERAL','N')", array($subject), __FUNCTION__, __LINE__); // Re-request it