Darkshady
Noobie

Posts: 40

I'm a llama!
|
 |
[Beta 1.3.+][Code]Referalls
« on: May 14, 2002, 08:22:13 PM » |
|
<id> User Referall Mod </id>
<version> .1 </version>
<mod info> If you a user refers someone to the board the referer will get a referall point. The referall points don't do anything but i'm sure you could hold contest or something with them.
Features: -A link in your profile which you can refer users with -Displays referalls in members profiles -Referall points goes up when someone has you as a refer
Hopefully in other releases: -Turn off/on in admin -Users cannot pick who refered them (all they have to do now is change the name when they are registering) -Shows referalls in memberlist -Shows who refered them in a users profile -Will show users with most referalls -Show referall in posts -Special titles for people who have certain amount of referalls (like custom titles)
Bugs: I am betting the code that is in your profile will now show correctly (I am running yabb from my computer and still having trouble getting it to stay logged in.
</mod info>
<author> DarkShady </author>
<homepage> None </homepage>
<edit file> Sources/Register.php </edit file>
<search for> global $yytitle,$txt,$color,$cgi,$action,$allow_hide_email,$modSettings,$RegAgree,$emailpassword,$vardir,$db_prefix; </search for>
<replace> global $yytitle,$txt,$color,$cgi,$action,$allow_hide_email,$modSettings,$RegAgree,$emailpassword,$vardir,$db_prefix,$referall,$referingperson; </replace>
<search for> $request = mysql_query("INSERT INTO {$db_prefix}members (memberName,realName,passwd,emailAddress,posts,personalText,avatar,dateRegistered,hideEmail,memberIP) VALUES ('$member[user]','$member[user]','$queryPasswdPart','$member[email]',0,'$txt[209]','blank.gif',$requesttime,'$hideemail','$memIP')"); </search for>
<replace> $request = mysql_query("INSERT INTO {$db_prefix}members (memberName,realName,passwd,emailAddress,posts,personalText,avatar,dateRegistered,hideEmail,memberIP,referer,referalls) VALUES ('$member[user]','$member[user]','$queryPasswdPart','$member[email]',0,'$txt[209]','blank.gif',$requesttime,'$hideemail','$memIP','$member[referer]','0')"); $request = mysql_query("SELECT referalls FROM {$db_prefix}members WHERE memberName='$member[referer]'"); $referallsettings = mysql_fetch_array($request); $newnumberofreferalls = $referallsettings[0]+1; $request = mysql_query("UPDATE {$db_prefix}members SET referalls='$newnumberofreferalls' WHERE memberName='$member[referer]'"); </replace>
<search for> <tr> <td width="40%"><font size=2>* <b>$txt[98]:</b></font> <BR><font size="1">$txt[520]</font></td> <td><input type=text name=user size=20 maxlength=18></td> </tr><tr> </search for>
<replace> <tr> <td width="40%"><font size=2>* <b>$txt[98]:</b></font> <BR><font size="1">$txt[520]</font></td> <td><input type=text name=user size=20 maxlength=18></td> </tr> <tr> <td width="40%"><font size=2><b>$referall[2]:</b></font> <BR><font size="1">$referall[3]</font></td> <td><input type=text name=referer size=20 maxlength=18 value=$referingperson></td> </tr><tr> </replace>
<search for> global $allow_hide_email,$modSettings,$REMOTE_ADDR; </search for>
<replace> global $allow_hide_email,$modSettings,$REMOTE_ADDR,$referallsettings; </replace>
<edit file> Sources/Profile.php </edit file>
<search for> global $username,$password,$pwseed,$action,$cookiepassword,$cookieusername,$db_prefix,$modSettings; </search for>
<replace> global $username,$password,$pwseed,$action,$cookiepassword,$cookieusername,$db_prefix,$modSettings,$referall; </replace>
<search for> global $MaxSigLen,$timeformatstring,$db_prefix,$locale,$modSettings,$language,$timeoffset; </search for>
<replace> global $MaxSigLen,$timeformatstring,$db_prefix,$locale,$modSettings,$language,$timeoffset,$boardurl,$user,$mbname,$referall; </replace>
<search for> </tr><tr> <td width="45%"><font size=2><b>$txt[604]: </b></font><BR> <font size=1>$txt[602]</font></td> <td><font size=2><input type=text name=yim size=20 value="$memsettings[YIM]"></font></td> </tr><tr> </search for>
<replace> </tr><tr> <td width="45%"><font size=2><b>$txt[604]: </b></font><BR> <font size=1>$txt[602]</font></td> <td><font size=2><input type=text name=yim size=20 value="$memsettings[YIM]"></font></td> </tr><tr> <tr> <td width="45%"><font size=2><b>$referall[1]: </b></font><BR></td> <td><font size=2><textarea><a href="$boardurl/index.php?board=;action=register&referingperson=$user">Join $mbname</a></textarea></font></td> </tr><tr> </replace>
<search for> /* */ /* The GNU GPL can be found in gpl.txt in this directory */ /*****************************************************************************/ </search for>
<add after> include("./Settings.php"); </add after>
<search for> </tr><tr> <td><font size=2><b>$txt[227]: </b></font></td> <td><font size=2>$memsettings[15]</font></td> </tr>$usrlng </search for>
<replace> </tr><tr> <td><font size=2><b>$txt[227]: </b></font></td> <td><font size=2>$memsettings[15]</font></td> </tr><tr> <td><font size=2><b>$referall[4]</b></font></td> <td><font size=2>$memsettings[26]</font></td> </tr>$usrlng </replace>
<search for> $request = mysql_query("SELECT passwd,realName,emailAddress,websiteTitle,websiteUrl,signature,posts,memberGroup,ICQ,AIM,YIM,gender,personalText,avatar,dateRegistered,location,birthdate,timeFormat,timeOffset,hideEmail,ID_MEMBER,usertitle,karmaBad,karmaGood,lngfile,MSN FROM {$db_prefix}members WHERE memberName='$user'"); </search for>
<replace> $request = mysql_query("SELECT passwd,realName,emailAddress,websiteTitle,websiteUrl,signature,posts,memberGroup,ICQ,AIM,YIM,gender,personalText,avatar,dateRegistered,location,birthdate,timeFormat,timeOffset,hideEmail,ID_MEMBER,usertitle,karmaBad,karmaGood,lngfile,MSN,referalls FROM {$db_prefix}members WHERE memberName='$user'"); </replace>
<edit file> english.lng </edit file>
<search for> $txt['yse_stats_12'] = "Top 10 Topics (by Views)"; $txt['yse_stats_13'] = "Monthly Summary"; $txt['yse_stats_14'] = "Most Online"; </search for>
<add after> $referall['1'] = "Referall Code"; $referall['2'] = "Referer"; $referall['3'] = "Username of Referer"; $referall['4'] = "Referalls:"; </add after> Put that in a .mod file and use boardmod to install it.
You must also run this mysql query in phpmyadmin:
ALTER TABLE yabbse_members ADD COLUMN referer tinytext;
ALTER TABLE yabbse_members ADD COLUMN referalls tinytext; UPDATE yabbse_members SET referalls= 0; I have no bugs with it but Positronix said that when users registered it wouldn't actually put them in the DB and that the profiles were screwed up. I am not sure if the code when you edit your profile work because I cannot stay logged in on my board.
Can you tell me if the code works in the EDIT profile part (i bet it doesn't and if it doesn't i think i know why) and if you can have users register.
EDIT: I just updated the code. I have everything working now.
|