Tomo Posted December 17, 2006 Posted December 17, 2006 Yes, a user with a dynamic IP keeps referring a user without his permission and he's gaining countless crystals from it and I would like to disable referrals on just his account, is there any way I can do this? Quote
UCC Posted December 17, 2006 Posted December 17, 2006 Re: Disable referrals on a user That doesnt make any sense. How is he referring someone who is already playing? Quote
corruption Posted December 18, 2006 Posted December 18, 2006 Re: Disable referrals on a user That doesnt make any sense. How is he referring someone who is already playing? lol thats someting id like to know as well :| Quote
seanybob Posted December 18, 2006 Posted December 18, 2006 Re: Disable referrals on a user tomo-I would suggest just opening up your register.php go to the line that adds crystals to the referer when the user signs up. add a simple check if($referers userid == 514) blah else add crystals where 514 is the ID # of the person you wish to stop. Quote
Tomo Posted December 18, 2006 Author Posted December 18, 2006 Re: Disable referrals on a user Ok, this didn't work but there's no doubt I'm doing it wrong, could someone tell me exactly what to put and where to put it? $_POST['ref'] = abs((int) $_POST['ref']); $ip = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $q=mysql_query("SELECT * FROM users WHERE lastip='$ip' AND userid={$_POST['ref']}",$c); if(mysql_num_rows($q)) { die("No creating referral multies. Bad dog."); } if($_POST['ref']) { $q=mysql_query("SELECT * FROM users WHERE userid={$_POST['ref']}",$c); $r=mysql_fetch_array($q); } mysql_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) 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')", $c); $i=mysql_insert_id($c); mysql_query("INSERT INTO userstats VALUES($i, 10, 10, 10, 10, 10)", $c); if($_POST['ref']) { require "global_func.php"; mysql_query("UPDATE users SET crystals=crystals+100 WHERE userid={$_POST['ref']}",$c); event_add($_POST['ref'],"For refering $username to the game, you have earnt 100 valuable crystals!",$c); mysql_query("INSERT INTO referals VALUES('', {$_POST['ref']}, $i, unix_timestamp(),'{$r['lastip']}','$ip')", $c); } Quote
seanybob Posted December 18, 2006 Posted December 18, 2006 Re: Disable referrals on a user why not just... Find mysql_query("UPDATE users SET crystals=crystals+100 WHERE userid={$_POST['ref']}",$c); event_add($_POST['ref'],"For refering $username to the game, you have earnt 100 valuable crystals!",$c); replace with if(!$_POST['ref']==IDOFTHEUSERYOURDONTWANTTOBEABLETOREFERGOESHERE) { mysql_query("UPDATE users SET crystals=crystals+100 WHERE userid={$_POST['ref']}",$c); event_add($_POST['ref'],"For refering $username to the game, you have earnt 100 valuable crystals!",$c); } else { event_add($_POST['ref'],"for being a noob and smelling like toast, i hereby banish you from recruiting among the morons you sleep with at night",$c); } something like that i would imagine Quote
Decepti0n Posted December 19, 2006 Posted December 19, 2006 Re: Disable referrals on a user if($_POST['ref']!=IDOFTHEUSERYOURDONTWANTTOBEABLETOREFERGOESHERE) { mysql_query("UPDATE users SET crystals=crystals+100 WHERE userid={$_POST['ref']}",$c); event_add($_POST['ref'],"For refering $username to the game, you have earnt 100 valuable crystals!",$c); } else { event_add($_POST['ref'],"for being a noob and smelling like toast, i hereby banish you from recruiting among the morons you sleep with at night",$c); } Quote
Tomo Posted December 19, 2006 Author Posted December 19, 2006 Re: Disable referrals on a user Works perfectly, thank you. If I want to add more than one, can I just seperate the ID's with commas, like 1, 23, 56, 87, 9 etc Quote
seanybob Posted December 19, 2006 Posted December 19, 2006 Re: Disable referrals on a user nah, instead do something like this if($_POST['ref']!=10 && $_POST['ref']!=11 && $_POST['ref']!=12 && $_POST['ref']!=13) Quote
Tomo Posted December 19, 2006 Author Posted December 19, 2006 Re: Disable referrals on a user Perfect, kudos to you. Quote
Decepti0n Posted December 19, 2006 Posted December 19, 2006 Re: Disable referrals on a user $banned = array(1,2,3,4); if (in_array($_POST['ref'],$banned)) { // pwned } kinda smaller/cleaner :P Quote
seanybob Posted December 20, 2006 Posted December 20, 2006 Re: Disable referrals on a user $banned = array(1,2,3,4); if (in_array($_POST['ref'],$banned)) { // pwned } kinda smaller/cleaner :P psh... whatever ;P hehhee Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.