XF 1.3 Referring people by sending them to a thread URL

I want my users to be able to post links to threads and still get credit for their referrals.
So is there a way to add the referral ID to any thread URL so it actually credits the referrer if the user decides to register?