define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "351");
+define('CURR_SVN_REVISION', "352");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
while (list($lvl, $per) = SQL_FETCHROW($result_depths))
{
// Load referral points
- $result_points = SQL_QUERY_ESC("SELECT points FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=%s LIMIT 1",
+ $result_points = SQL_QUERY_ESC("SELECT 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)
{
$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);
* rid = inc/modules/guest/what-confirm.php need this
* locked = Shall I pay it to normal (false) or locked (true) points ammount?
* add_mode = Add points only to $uid or also refs? (WARNING! Changing "ref" to "direct"
- * will cause no referral will get points ever!!!)
+ * for default value will cause no referral will get points ever!!!)
*/
function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $locked=false, $add_mode="ref")
{
$percents = "percents"; if (isset($_CONFIG['db_percents'])) $percents = $_CONFIG['db_percents'];
$table = "refdepths"; if (isset($_CONFIG['db_table'])) $table = $_CONFIG['db_table'];
+ // Default is "normal" points
+ $data = "points";
+
// Which points, locked or normal?
- $data = "points"; if ($locked) $data = "locked_points";
+ if ($locked) $data = "locked_points";
// Check user account
$result_user = SQL_QUERY_ESC("SELECT refid, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
while (list($dep, $locked) = SQL_FETCHROW($result_points))
{
$result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET points=points+%s, locked_points=0.00000
-WHERE userid=%s AND ref_depth=%s LIMIT 1",
+WHERE userid=%s AND ref_depth=%d LIMIT 1",
array($locked, bigintval($uid), $dep), __FILE__, __LINE__);
// Update mediadata as well