Tuesday, September 15, 2009

Members as Affiliates

I have been asked (several times) how to make it easier for members of the dolphin site to be considered affiliates. Instead of the member needing to sign up as an affiliate, they are one just by joining the site.

The best way is to automatically create the user's affiliate account when they join the site.

First - you have to remove the `aff`` table 'autoincrement' from the `ID`  field.

Then open join.php and find:::


echo _t( '_Join complete' );
echo '
';
echo _t( $sStatusText );


After it paste:::

$sql = "SELECT * FROM Profiles WHERE ID = '".$iMemID."'";
$theUser = db_res( $sql );
$useInfo = mysql_fetch_assoc( $theUser );
$pr_id = $useInfo['ID'];
$pr_Name = $useInfo['NickName'];
$pr_email = $useInfo['Email'];
$pr_Password = $useInfo['Password'];
$pr_DateReg = $useInfo['DateReg'];
$sql = "
INSERT INTO  `aff` (
`ID` ,
`Name` ,
`email` ,
`Password` ,
`Percent` ,
`seed` ,
`RegDate` ,
`Status` 
)
VALUES (
'".$pr_id."',  '".$pr_Name."',  '".$pr_email."',  '".$pr_Password."',  '50',  '0',  '".$pr_DateReg."',  'Active'
);
";
$addAff = db_res( $sql );




No comments:

Post a Comment