diff --git a/Templates/Alliance/attack-attacker.tpl b/Templates/Alliance/attack-attacker.tpl index ac4d7515..7bd5e5b8 100644 --- a/Templates/Alliance/attack-attacker.tpl +++ b/Templates/Alliance/attack-attacker.tpl @@ -1,7 +1,5 @@ dblink,"SELECT * FROM $prefix WHERE ally = ".(int) $session->alliance." AND $limit ORDER BY time DESC LIMIT 20"); +$sql = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."ndata WHERE ally = ".(int) $session->alliance." AND (ntype != 0 AND ntype < 4 OR ntype > 17 AND ntype != 20 AND ntype != 21) ORDER BY time DESC LIMIT 20"); $query = mysqli_num_rows($sql); $outputList = ''; $name = 1; @@ -41,8 +39,8 @@ if($ntype==4 || $ntype==5 || $ntype==6 || $ntype==7){ $outputList .= $database->getUserField($dataarray[0], "username", 0); $outputList .= $nn; - $outputList .= $database->getUserField($dataarray[28], "username", 0); - $getUserAlly = $database->getUserField($dataarray[28], "alliance", 0); + $outputList .= $database->getUserField($type != 22 ? $dataarray[28] : $dataarray[2], "username", 0); + $getUserAlly = $database->getUserField($type != 22 ? $dataarray[28] : $dataarray[2], "alliance", 0); $getAllyName = $database->getAllianceName($getUserAlly); if($getUserAlly==$session->alliance || !$getUserAlly){ diff --git a/Templates/Alliance/attack-defender.tpl b/Templates/Alliance/attack-defender.tpl index fc5d53ef..4cb5e1c7 100644 --- a/Templates/Alliance/attack-defender.tpl +++ b/Templates/Alliance/attack-defender.tpl @@ -1,7 +1,5 @@ dblink,"SELECT * FROM $prefix WHERE ally = ".(int) $session->alliance." AND $limit ORDER BY time DESC LIMIT 20"); +$sql = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."ndata WHERE ally = ".(int) $session->alliance." AND (ntype < 1 OR ntype > 3 AND ntype < 8 OR ntype > 19) ORDER BY time DESC LIMIT 20"); $query = mysqli_num_rows($sql); $outputList = ''; $name = 1; @@ -42,8 +40,8 @@ if($ntype==4 || $ntype==5 || $ntype==6 || $ntype==7){ $outputList .= $database->getUserField($dataarray[0], "username", 0); $outputList .= $nn; - $outputList .= $database->getUserField($dataarray[28], "username", 0); - $getUserAlly = $database->getUserField($dataarray[0], "alliance", 0); + $outputList .= $database->getUserField($type != 22 ? $dataarray[28] : $dataarray[2], "username", 0); + $getUserAlly = $database->getUserField($type != 22 ? $dataarray[28] : $dataarray[2], "alliance", 0); $getAllyName = $database->getAllianceName($getUserAlly); if($getUserAlly==$session->alliance || !$getUserAlly){ diff --git a/Templates/Alliance/attacks.tpl b/Templates/Alliance/attacks.tpl index 03d33bfe..81ab7700 100644 --- a/Templates/Alliance/attacks.tpl +++ b/Templates/Alliance/attacks.tpl @@ -9,11 +9,11 @@ include("alli_menu.tpl");

Military events

getUserField($type != 22 ? $dataarray[28] : $dataarray[2], "alliance", 0); }else{ - $getUserAlly = $database->getUserField($dataarray[0], "alliance", 0); + $getUserAlly = $database->getUserField($type != 22 ? $dataarray[28] : $dataarray[2], "alliance", 0); } $getAllyName = $database->getAllianceName($getUserAlly);