Page 1 of 1

Need help with adjusting some codes

Posted: Mon Apr 19, 2010 1:22 pm
by acroy77
I have a game right now that allows for players to get credit for completing one full set of prizes what i'd like to do is make it so that players can get credit for collecting multiple sets but everything I try is messing up could someone tell me how to change this code to make it so players can collect more than one set and get the login bonus for each set collected

Code: Select all

<?
include'config.php';

$logbonus=0;
$gift = 100;
$logbonus=$logbonus+$gift;
$query = mysql_query("SELECT * FROM winonly WHERE userid=$user");
$winonly = mysql_fetch_array($query);
$query = mysql_query("SELECT * FROM buyonly WHERE userid=$user");
$buyonly = mysql_fetch_array($query);


// ACHIEVEMENT BONUSES //////////////////

//Level achievments
if($stats['level1']>0){$logbonus=$logbonus+15;}
if($stats['level2']>0){$logbonus=$logbonus+15;}
if($stats['level3']>0){$logbonus=$logbonus+15;}
if($stats['level4']>0){$logbonus=$logbonus+15;}
if($stats['level5']>0){$logbonus=$logbonus+15;}
if($stats['levelhal09']>0){$logbonus=$logbonus+15;}
if($stats['levchar1']>0){$logbonus=$logbonus+115;}
if($stats['levchar2']>0){$logbonus=$logbonus+115;}
if($stats['levchar3']>0){$logbonus=$logbonus+115;}
if($stats['levturk09']>0){$logbonus=$logbonus+15;}
if($stats['Lim1']>0){$logbonus=$logbonus+100;}
if($stats['levxmas09']>0){$logbonus=$logbonus+15;}
if($stats['jk1']>0){$logbonus=$logbonus+15;}
if($stats['jk2']>0){$logbonus=$logbonus+15;}
if($stats['newyr10']>0){$logbonus=$logbonus+15;}
if($stats['membership1']>0){$logbonus=$logbonus+100;}
if($stats['membership2']>0){$logbonus=$logbonus+100;}
if($stats['membership3']>0){$logbonus=$logbonus+100;}
if($stats['membership4']>0){$logbonus=$logbonus+100;}
if($stats['haiti']>0){$logbonus=$logbonus+115;}
if($stats['levval10']>0){$logbonus=$logbonus+15;}
if($stats['sotm1']>0){$logbonus=$logbonus+100;}
if($stats['east2010']>0){$logbonus=$logbonus+15;}
if($stats['pat2010']>0){$logbonus=$logbonus+15;}
if($stats['levchar5']>0){$logbonus=$logbonus+115;}

// Gold Achievements
if($stats['gold10K']>0){$logbonus=$logbonus+5;}
if($stats['gold100K']>0){$logbonus=$logbonus+5;}
if($stats['gold1Mil']>0){$logbonus=$logbonus+5;}

//Completed Digs Achievements
if($stats['digA3']>0){$logbonus=$logbonus+5;}
if($stats['digA4']>0){$logbonus=$logbonus+5;}
if($stats['digA5']>0){$logbonus=$logbonus+5;}

//Referral Achievements
if($stats['refA2']>0){$logbonus=$logbonus+2;}
if($stats['refA3']>0){$logbonus=$logbonus+3;}
if($stats['refA4']>0){$logbonus=$logbonus+5;}
if($stats['refA5']>0){$logbonus=$logbonus+5;}
//*****************************
//**********LEVEL # 1**********
//*****************************
//    MINI LEVEL 1 WIN ONLY SET 1
if($winonly['gd001_1']>0 and $winonly['gd001_2']>0 and $winonly['gd001_3']>0){
$logbonus=$logbonus+5;$log1=1;
}

//    MINI LEVEL 1 WIN ONLY SET 2
if($winonly['gd001_4']>0 and $winonly['gd001_5']>0 and $winonly['gd001_6']>0){
$logbonus=$logbonus+5;$log2=1;
}

//    MINI LEVEL 1 WIN ONLY SET 3
if($winonly['gd001_7']>0 and $winonly['gd001_8']>0 and $winonly['gd001_9']>0){
$logbonus=$logbonus+5;$log3=1;
}

//    WIN ONLY LEVEL 1 SET 1
if($winonly['gd002_1']>0 and $winonly['gd002_2']>0 and $winonly['gd002_3']>0 and $winonly['gd002_4']>0 and $winonly['gd002_5']>0 and $winonly['gd002_6']>0 and $winonly['gd002_7']>0 and $winonly['gd002_8']>0 and $winonly['gd002_9']>0){
$logbonus=$logbonus+10;$log4=1;
}

//    WIN ONLY LEVEL 1 SET 2
if($winonly['gd003_1']>0 and $winonly['gd003_2']>0 and $winonly['gd003_3']>0 and $winonly['gd003_4']>0 and $winonly['gd003_5']>0 and $winonly['gd003_6']>0 and $winonly['gd003_7']>0 and $winonly['gd003_8']>0 and $winonly['gd003_9']>0){
$logbonus=$logbonus+10;$log5=1;
}

//    WIN ONLY LEVEL 1 SET 3
if($winonly['gd004_1']>0 and $winonly['gd004_2']>0 and $winonly['gd004_3']>0 and $winonly['gd004_4']>0 and $winonly['gd004_5']>0 and $winonly['gd004_6']>0 and $winonly['gd004_7']>0 and $winonly['gd004_8']>0 and $winonly['gd004_9']>0){
$logbonus=$logbonus+10;$log6=1;
}

Re: Need help with adjusting some codes

Posted: Mon Apr 19, 2010 3:40 pm
by requinix
First things first:

Edit your post and put the code in

Code: Select all

 tags. You can use the "PHP Code" button above the message box.

Re: Need help with adjusting some codes

Posted: Tue Apr 20, 2010 9:08 am
by acroy77
i had those tags in there

Re: Need help with adjusting some codes

Posted: Tue Apr 20, 2010 5:18 pm
by requinix
Try again.

Code: Select all

[syntax=php]...
[/syntax]

Re: Need help with adjusting some codes

Posted: Wed Apr 21, 2010 1:48 am
by acroy77
all fixed now