YaBB Referral System
1.1a
This hack allows you to keep track of how many people each member of your forums refers, who they referred, and who they were referred by. It also creates a memberlist option so you can view a list of the top referrers on your board and how many referrals they've made. To give a referral, the user gives the new registrant the url http://www.yoursite.comYaBB.pl?action=register&refid=username replacing 'username' with their username. You MUST enable referrals in the Forums Preferences before it will become active.
Thanks to DaveB for all his help and LukeA for the testing :)
MADD Hatter
http://www.ghostcdr.com
english.lng
1;
keys(%reftxt) = 16;
$reftxt{'01'} = "(Not Referred)";
$reftxt{'02'} = "Referred By: ";
$reftxt{'03'} = "Number of Refers: ";
$reftxt{'04'} = "Names of Refers: ";
$reftxt{'05'} = "Who have they referred?";
$reftxt{'06'} = "This person has not referred anyone.";
$reftxt{'07'} = "Refer List";
$reftxt{'08'} = "Referrals";
$reftxt{'09'} = "Enable Referring?";
$reftxt{'10'} = "Allow members and guests to view others' referring details?";
$reftxt{'11'} = "Who have they referred?";
$reftxt{'12'} = "Top Referrers";
$reftxt{'13'} = "View list of top referrers.";
$reftxt{'14'} = "Top Referrers";
$reftxt{'15'} = "You are not authorized to view this page.";
$reftxt{'16'} = "Show 'Referred By:' box on register page?";
YaBB.pl
elsif ($action eq 'notify4') { require "$sourcedir/Notify.pl"; &Notify4; }
elsif ($action eq 'namelist') { require "$sourcedir/Profile.pl"; &NameList; }
elsif ($action eq 'rebuildmemlist') { require "$sourcedir/Admin.pl"; &RebuildMemList; }
elsif ($action eq 'reflist') { require "$sourcedir/Memberlist.pl"; &reflist; }
Sources/Register.pl
&header;
if($enable_refers eq "0") {
$INFO{'refid'} = "";
}
unless( $emailpassword ) {
if($enable_showrefer) {
print <<"EOT";
\$enable_ubbc = $enable_ubbc; # Set to 1 if you want to enable UBBC (Uniform Bulletin Board Code)
\$enable_refers = $enable_refers; # Set to 1 if you want to enable referring
\$enable_memrefers = $enable_memrefers; # Set to 1 if you want to allow members to view other members referring details
\$enable_showrefer = $enable_showrefer; # Set to 1 if you want to show the "Referred By:" section on the register page
# If empty fields are submitted, set them to default-values to save yabb from crashing
$enable_refers = $FORM{'enable_refers'} || 0;
$enable_memrefers = $FORM{'enable_memrefers'} || 0;
# Set as 0 or 1 if box was checked or not
push(@onoff, "enable_refers");
push(@onoff, "enable_memrefers");
push(@onoff, "enable_showrefer");