]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-points.php
Fixes for ref-level 0
[mailer.git] / inc / modules / member / what-points.php
index 6293845d814d2e848ff713b84b7817c2ce1ef256..11a8db0a0e12904f10b9ab8acfa35e66de1fccc7 100644 (file)
@@ -32,7 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 } elseif (!IS_MEMBER()) {
@@ -42,7 +42,6 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
 // Add description as navigation point
 ADD_DESCR("member", basename(__FILE__));
 
-OPEN_TABLE("100%", "member_content member_content_align", "");
 $result_depths = SQL_QUERY("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__);
 $depths = SQL_NUMROWS($result_depths);
 
@@ -55,15 +54,15 @@ if (GET_EXT_VERSION("bonus") >= "0.4.4") $depths += 4;
 define('__ROWS_VALUE', ($depths*2+15));
 
 // Init some vars...
-$TPTS = "0"; $TREF = "0"; $TLOCK = "0"; $OUT = "";
+$TPTS = 0; $TREF = 0; $TLOCK = 0; $OUT = "";
 
 // Load ref levels
 while (list($lvl, $per) = SQL_FETCHROW($result_depths)) {
        // Initialize ref-count
-       $REFS = "0";
+       $REFS = 0;
 
        // Load referral points
-       $result_points = SQL_QUERY_ESC("SELECT points, locked_points FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=%s LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
+       $result_points = SQL_QUERY_ESC("SELECT points, locked_points FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=%d LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
        if (SQL_NUMROWS($result_points) == 1) {
                list($points, $LOCKED) = SQL_FETCHROW($result_points);
                SQL_FREERESULT($result_points);
@@ -80,7 +79,7 @@ while (list($lvl, $per) = SQL_FETCHROW($result_depths)) {
                SQL_FREERESULT($result_refs);
                $TREF += $REFS;
        } else {
-               $REFS = "0";
+               $REFS = 0;
        }
 
        // Transfer data to array for template
@@ -202,6 +201,5 @@ if (EXT_IS_ACTIVE("payout")) {
        PAYOUT_OUTPUT_PAYOUT_LIST(str_replace(",", ".", ($TPTS - $USED)));
 }
 
-CLOSE_TABLE();
 //
 ?>