so moving on to number #2 ,.. the advanced referral system ,.. now as i have an email validation mod installed ,..
ive had to place the code into the validate.php instead of the register.php ,..
so originally the validate part looks like this
if($_POST['ref']) {
$q=$db->query("SELECT * FROM users WHERE userid={$_POST['ref']}");
$r=$db->fetch_row($q);
}
$db->query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP')");
$i=$db->insert_id();
$db->query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10)");
if($_POST['ref']) {
require "global_func.php";
$db->query("UPDATE users SET crystals=crystals+2 WHERE userid={$_POST['ref']}");
event_add($_POST['ref'],"For refering $username to the game, you have earnt 2 valuable crystals!",$c);
$db->query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$IP')");
}
it asks me to place just one section of this with the following
$db->query(
"INSERT INTO `users`
(`username`, `login_name`, `userpass`, `level`,
`money`, `crystals`, `donatordays`, `user_level`,
`energy`, `maxenergy`, `will`, `maxwill`, `brave`,
`maxbrave`, `hp`, `maxhp`, `location`, `gender`,
`signedup`, `email`, `bankmoney`, `lastip`,
`lastip_signup`, `pass_salt`,`referrer_id`)
VALUES('{$e_username}', '{$e_username}', '{$e_encpsw}', 1,
$sm, 0, 0, 1, 12, 12, 100, 100, 5, 5, 100, 100, 1,
'{$e_gender}', " . time()
. ",'{$e_email}', -1, '$IP',
'$IP', '{$e_salt}','{$_POST['ref']}')");
now im woundering is it because i havnt removed the bottom part of the script,.. it hasnt asked me to do this but it might be why
if($_POST['ref']) {
require "global_func.php";
$db->query("UPDATE users SET crystals=crystals+2 WHERE userid={$_POST['ref']}");
event_add($_POST['ref'],"For refering $username to the game, you have earnt 2 valuable crystals!",$c);
$db->query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$IP')");
}
ive tried just adding the , '{$e_salt}','{$_POST['ref']}' instead of replacing the whole script which it requests but it doesnt want to know that either ,.. any suggestions ?