[COLOR=#000000][COLOR=#0000BB] [/COLOR][COLOR=#FF8000]//deaths list by QuaS~~
//Getting Data - 2 SQL Queries
[/COLOR][COLOR=#0000BB]$idgracza [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$player[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]getCustomField[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"id"[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]$players_deaths [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$SQL[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'SELECT `player_deaths`.`id`, `player_deaths`.`date`, `player_deaths`.`level` FROM `player_deaths` WHERE `player_deaths`.`player_id` = '[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$idgracza[/COLOR][COLOR=#007700].[/COLOR][COLOR=#DD0000]' ORDER BY `date` DESC LIMIT 50'[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]$players_deaths_count [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700];
if(!empty([/COLOR][COLOR=#0000BB]$players_deaths[/COLOR][COLOR=#007700]))
{
foreach([/COLOR][COLOR=#0000BB]$players_deaths [/COLOR][COLOR=#007700]as [/COLOR][COLOR=#0000BB]$death[/COLOR][COLOR=#007700])
{
[/COLOR][COLOR=#0000BB]$players_deaths_count[/COLOR][COLOR=#007700]++;
if([/COLOR][COLOR=#0000BB]is_int[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$players_deaths_count [/COLOR][COLOR=#007700]/ [/COLOR][COLOR=#0000BB]2[/COLOR][COLOR=#007700]))
[/COLOR][COLOR=#0000BB]$bgcolor [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$config[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'site'[/COLOR][COLOR=#007700]][[/COLOR][COLOR=#DD0000]'darkborder'[/COLOR][COLOR=#007700]];
else
[/COLOR][COLOR=#0000BB]$bgcolor [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$config[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'site'[/COLOR][COLOR=#007700]][[/COLOR][COLOR=#DD0000]'lightborder'[/COLOR][COLOR=#007700]];
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]'<TR BGCOLOR="'[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$bgcolor[/COLOR][COLOR=#007700].[/COLOR][COLOR=#DD0000]'"><TD WIDTH="125"><small>'[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]date[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"j M Y, H:i"[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]$death[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'date'[/COLOR][COLOR=#007700]]).[/COLOR][COLOR=#DD0000]' CEST</small></TD><TD><a href="?subtopic=characters&name='[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]urlencode[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$death[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'name'[/COLOR][COLOR=#007700]]).[/COLOR][COLOR=#DD0000]'"><b>'[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$death[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'name'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]'</b></a> '[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000BB]$killers [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$SQL[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"SELECT environment_killers.name AS monster_name, players.name AS player_name, players.deleted AS player_exists, killers.final_hit AS final_hit
FROM killers LEFT JOIN environment_killers ON killers.id = environment_killers.kill_id
LEFT JOIN player_killers ON killers.id = player_killers.kill_id LEFT JOIN players ON players.id = player_killers.player_id
WHERE killers.death_id = '"[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$death[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'id'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]"' ORDER BY player_killers.player_id DESC, killers.id ASC"[/COLOR][COLOR=#007700])->[/COLOR][COLOR=#0000BB]fetchAll[/COLOR][COLOR=#007700]();
[/COLOR][COLOR=#0000BB]$i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#FF8000]//Properly Counting - 4 SQL Queries
[/COLOR][COLOR=#0000BB]$getDeathlist [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$SQL[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"SELECT player_killers.kill_id from killers,player_killers where killers.death_id = "[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$death[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'id'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]" and player_killers.kill_id = killers.id"[/COLOR][COLOR=#007700])->[/COLOR][COLOR=#0000BB]fetchAll[/COLOR][COLOR=#007700]();
[/COLOR][COLOR=#0000BB]$getDeathlist1 [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$SQL[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"SELECT id, death_id from killers where final_hit = 1 and death_id = "[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$death[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'id'[/COLOR][COLOR=#007700]]);
[/COLOR][COLOR=#0000BB]$z [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000BB]$p [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700];
foreach([/COLOR][COLOR=#0000BB]$getDeathlist1 [/COLOR][COLOR=#007700]as [/COLOR][COLOR=#0000BB]$Deathlist[/COLOR][COLOR=#007700])
{
[/COLOR][COLOR=#0000BB]$count_m [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$SQL[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]query[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"SELECT * from environment_killers where kill_id = "[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$Deathlist[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'id'[/COLOR][COLOR=#007700]])->[/COLOR][COLOR=#0000BB]fetchAll[/COLOR][COLOR=#007700]();
}
[/COLOR][COLOR=#0000BB]$z [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]count[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$count_m[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]$p [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]count[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$getDeathlist[/COLOR][COLOR=#007700]);
[/COLOR][COLOR=#0000BB]$count [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]$z [/COLOR][COLOR=#007700]+ [/COLOR][COLOR=#0000BB]$p[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#FF8000]//Displaying
//Killed By Players
[/COLOR][COLOR=#007700]foreach([/COLOR][COLOR=#0000BB]$killers [/COLOR][COLOR=#007700]as [/COLOR][COLOR=#0000BB]$killer[/COLOR][COLOR=#007700])
{
[/COLOR][COLOR=#0000BB]$i[/COLOR][COLOR=#007700]++;
if([/COLOR][COLOR=#0000BB]$killer[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'player_name'[/COLOR][COLOR=#007700]] != [/COLOR][COLOR=#DD0000]""[/COLOR][COLOR=#007700])
{
if([/COLOR][COLOR=#0000BB]$i [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700])
{
if ([/COLOR][COLOR=#0000BB]$count [/COLOR][COLOR=#007700]<= [/COLOR][COLOR=#0000BB]4[/COLOR][COLOR=#007700]){
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]"Killed at level <b>"[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$death[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'level'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]"</b> by "[/COLOR][COLOR=#007700];
}
elseif ([/COLOR][COLOR=#0000BB]$count [/COLOR][COLOR=#007700]> [/COLOR][COLOR=#0000BB]4 [/COLOR][COLOR=#007700]and [/COLOR][COLOR=#0000BB]$count [/COLOR][COLOR=#007700]< [/COLOR][COLOR=#0000BB]10[/COLOR][COLOR=#007700]){
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]"Slain at level <b>"[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$death[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'level'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]"</b> by "[/COLOR][COLOR=#007700];
}
elseif ([/COLOR][COLOR=#0000BB]$count [/COLOR][COLOR=#007700]> [/COLOR][COLOR=#0000BB]9 [/COLOR][COLOR=#007700]and [/COLOR][COLOR=#0000BB]$count [/COLOR][COLOR=#007700]< [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]){
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]"Crushed at level <b>"[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$death[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'level'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]"</b> by "[/COLOR][COLOR=#007700];
}
elseif ([/COLOR][COLOR=#0000BB]$count [/COLOR][COLOR=#007700]> [/COLOR][COLOR=#0000BB]14[/COLOR][COLOR=#007700]){
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]"Eliminated at level <b>"[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$death[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'level'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]"</b> by "[/COLOR][COLOR=#007700];
}
}
elseif([/COLOR][COLOR=#0000BB]$i [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]$count[/COLOR][COLOR=#007700])
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]" and "[/COLOR][COLOR=#007700];
else{
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]", "[/COLOR][COLOR=#007700];
}
if([/COLOR][COLOR=#0000BB]$killer[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'monster_name'[/COLOR][COLOR=#007700]] != [/COLOR][COLOR=#DD0000]""[/COLOR][COLOR=#007700])
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#0000BB]$killer[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'monster_name'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]" summoned by "[/COLOR][COLOR=#007700];
if([/COLOR][COLOR=#0000BB]$killer[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'player_exists'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700])
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]"<a href=\"index.php?subtopic=characters&name="[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]urlencode[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]$killer[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'player_name'[/COLOR][COLOR=#007700]]).[/COLOR][COLOR=#DD0000]"\">"[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#0000BB]$killer[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'player_name'[/COLOR][COLOR=#007700]];
if([/COLOR][COLOR=#0000BB]$killer[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'player_exists'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700])
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]"</a>"[/COLOR][COLOR=#007700];
}
else
[/COLOR][COLOR=#FF8000]//Killed By Monster (only final hit)
[/COLOR][COLOR=#007700]{
if ([/COLOR][COLOR=#0000BB]$killer[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'final_hit'[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700])
{
if ([/COLOR][COLOR=#0000BB]$i [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700])
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]"Died at level <b>"[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$death[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'level'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]"</b> by "[/COLOR][COLOR=#007700];
else
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]" and "[/COLOR][COLOR=#007700];
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#0000BB]$killer[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'monster_name'[/COLOR][COLOR=#007700]];
}
}
}
[/COLOR][COLOR=#0000BB]$players_rows [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]'.</TD></TR>'[/COLOR][COLOR=#007700];
}
}
if(![/COLOR][COLOR=#0000BB]$players_deaths_count [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700])
{
[/COLOR][COLOR=#0000BB]$main_content [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#DD0000]'<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$config[/COLOR][COLOR=#007700][[/COLOR][COLOR=#DD0000]'site'[/COLOR][COLOR=#007700]][[/COLOR][COLOR=#DD0000]'vdarkborder'[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#DD0000]'"><TD CLASS=white><B>Character Deaths</B></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH=100%>'[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]$players_rows[/COLOR][COLOR=#007700].[/COLOR][COLOR=#DD0000]'</TABLE>'[/COLOR][COLOR=#007700];
}
[/COLOR][COLOR=#FF8000]//end