- array(
- $content['locked_points'],
- bigintval($content['userid']),
- $content['ref_depth']
- ), __FILE__, __LINE__, false));
+ array(
+ $columnName,
+ $columnName,
+ $content['locked_' . $columnName],
+ $columnName,
+ bigintval($content['userid']),
+ $content['ref_depth']
+ ), __FILE__, __LINE__, FALSE)
+ );
+ } else {
+ // Level zero
+ addSql(sqlQueryEscaped("UPDATE
+ `{?_MYSQL_PREFIX?}_user_points`
+SET
+ `%s`=`%s`+%s,
+ `locked_%s`=0.00000
+WHERE
+ `userid`=%s AND
+ `ref_depth` IS NULL
+LIMIT 1",
+ array(
+ $columnName,
+ $columnName,
+ $content['locked_' . $columnName],
+ $columnName,
+ bigintval($content['userid'])
+ ), __FILE__, __LINE__, FALSE)
+ );
+ }