]> git.mxchange.org Git - mailer.git/blobdiff - inc/referal-functions.php
Extension ext-network continued (sorry guys for all these splitted commits):
[mailer.git] / inc / referal-functions.php
index 384f1a8a88d2a4191932da6b01b9bb18f5d48de5..b1e82a13e244e452598fb144e9fe56212d81a967 100644 (file)
@@ -17,7 +17,7 @@
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -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),
@@ -223,7 +223,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $refid = NUL
 
                                // And sent it away
                                sendEmail($userid, '{--DIRECT_PAYMENT_SUBJECT--}', $message);
-                               if (!isGetRequestParameterSet('mid')) {
+                               if (!isGetRequestElementSet('mid')) {
                                        // Output message to admin
                                        displayMessage('{--ADMIN_POINTS_ADDED--}');
                                } // END - if
@@ -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