- if (($ref > 0) && ($DOUBLER_UID == $uid) && (!empty($ref)))
- {
- // Referral points found so add them and set line(s) to completed='Y'
- $points += $ref;
- $result_ref = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_doubler SET completed='Y' WHERE refid=%s AND completed='N' AND is_ref='Y'",
- array(bigintval($uid)), __FILE__, __LINE__);
- }
- else
- {
- // No referral points found
+ if (($ref > 0) && ($GLOBALS['doubler_uid'] == $content['userid']) && (!empty($ref))) {
+ // Referal points found so add them and set line(s) to completed='Y'
+ $content['points'] += $ref;
+ SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE refid=%s AND completed='N' AND is_ref='Y'",
+ array(bigintval($content['userid'])), __FILE__, __LINE__);
+ } else {
+ // No referal points found