I already have a fully pledged membership system and want to integrate my own user referral system but want some tips, advice really on doing it.
My current registe
Set the referral table as follows:
referrals:
id (primary key)
referrer_id (user who is referring someone else)
referred_email (email of person being referred)
status (referred[default], registered)
created_on
updated_at
Following the policy "do not trust anybody" you should not use name as a field in referrals. Eg. I send a referral: email=>your_email, name=>abuse. It demotes you.
For counting no. of referrals:
select count(*) as referral_count from referrals where referrer_id = 'user_id'
I found one query on that as I am making the same module. If the referral link is sent to another person who was not referred by the user, then what will you suggest:
(1) Either allow that person to register and pay to the user (As that can bring more users to site.) (2) Allow that person to register , but don't pay.