If you want to add the referral link to the profile, just add this snippet where you want to see the referral link:

print url('referral/' . _referral_uid2ref($user->uid), NULL, NULL, TRUE);

Comments

nikmahajan’s picture

I tried this in D6 and got the fatal error.

Fatal error: Call to undefined function _referral_uid2ref() in /home2/xxxxxxxxxxx/public_html/includes/common.inc(1652) : eval()'d code on line 6.

I tried to put the code in the custom block. Please help

DLZJ’s picture

Hi,

Greetings,

May I know where should I add the above code? which folder or file? In which line?

Is the above code will let me see who is the referring user of the referred user? For example, B signs up based on A's link, so by clicking the referral link on B's profile, I could search for A. Am I correct?

Thanks.

parkour86’s picture

<?php
$referralLink = url('referral/'. _referral_uid2ref($GLOBALS['user']->uid), array('query' => NULL, 'fragment' => NULL, 'absolute' => TRUE));
?>