-ADD_DESCR('member', __FILE__);
-
-$result_depths = SQL_QUERY("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__);
-$TPTS = 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=%d LIMIT 1",
- array(getUserId(), 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
- $TPTS += $points;
- } // END - if
-
- // Free result
- SQL_FREERESULT($result_points);
-}
-
-// Free memory
-SQL_FREERESULT($result_depths);