What Type Of Music Do You Like?
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
'referrals_hits + 1'));
// @ Hidden Easter Eggs @
// Use to give rewards for each referral hit
// Uncomment the line by removing // from the beginning of the line
// Reward with Karma
// updateMemberData($referrer, array('karmaGood' => 'karmaGood + 25'));
// Using SMF Shop? Give them money
// updateMemberData($referrer, array('money' => 'money + 100'));
}
// Set a ReferralCookie (overriding any existing one to extend the 60 days)
setReferralCookie($referrer, $time);
// Setup the information, in case we want to use it for this page
$context['referrals'] = array(
'referred_timestamp' => $time,
'referred_date' => date("jS M Y", $time),
'referred_by_id' => $referrer,
'referred_by_name' => $referrer_name,
);
return;
}
// There is a cookie
if(!empty($_COOKIE['smf_referrals']))
{
// Check the referral cookie
$cookie_info = checkReferralCookie();
// No referrer found
if(empty($cookie_info) || !is_array($cookie_info))
return;
// Set a ReferralCookie (extending any existing one)
setReferralCookie($cookie_info[0], $cookie_info[1]);
// Are we on the register page?
if(!empty($_REQUEST['action']) && in_array(strtolower($_REQUEST['action']), array('register', 'register2')))
{
// Check the user exists
$referrer_name = checkReferrerExists($cookie_info[0], 'id');
// No referrer found by that id
if(empty($referrer_name))
{
killReferralCookie();
return;
}
// Yes, so we want to setup the information
$context['referrals'] = array(
'referred_timestamp' => $cookie_info[1],
'referred_date' => date("jS M Y", $cookie_info[1]),
'referred_by_id' => $cookie_info[0],
'referred_by_name' => $referrer_name,
);
}
// Tidy up
unset($cookie_info);
}
}
?>
|