]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-payout.php
New functions introduced, several rewrites:
[mailer.git] / inc / modules / member / what-payout.php
index 00e3bc455354379624680eb245462575e35646f3..48491080937cda2b89571be3261ba9cf144303f2 100644 (file)
@@ -53,28 +53,8 @@ if ((!isExtensionActive('payout')) && (!isAdmin())) {
        return;
 } // END - if
 
-$result_depths = SQL_QUERY("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY level", __FILE__, __LINE__);
-$totalPoints = '0';
-while ($content = SQL_FETCHARRAY($result_depths)) {
-       // Load referal points
-       $result_points = SQL_QUERY_ESC("SELECT `points` FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid`=%s AND `ref_depth`='%s' LIMIT 1",
-               array(getMemberId(), bigintval($content['level'])), __FILE__, __LINE__);
-
-       // Entry found?
-       if (SQL_NUMROWS($result_points) == 1) {
-               // Load points
-               list($points) = SQL_FETCHROW($result_points);
-
-               // Add them to total
-               $totalPoints += $points;
-       } // END - if
-
-       // Free result
-       SQL_FREERESULT($result_points);
-} // END - while
-
-// Free memory
-SQL_FREERESULT($result_depths);
+// Get total points
+$totalPoints = countSumTotalData(getMemberId(), 'user_points', 'points');
 
 // Get used points
 $usedPoints = countSumTotalData(getMemberId(), 'user_data', 'used_points');
@@ -132,7 +112,7 @@ ORDER BY
                                                // Textlink
                                                $content['target_account'] = $content['alt'];
                                        }
-                                       $content['target_bank'] = "<a href=\"".generateDerefererUrl($content['url'])."\" target=\"_blank\">{--CLICK_HERE--}</a>";
+                                       $content['target_bank'] = '<a href="' . generateDerefererUrl($content['url']) . '" target="_blank">{--CLICK_HERE--}</a>';
                                } else {
                                        // e-currency payout request
                                        if (empty($content['target_account'])) $content['target_account'] = '---';