From 2d573a915c1ba33cf9db5a3bbdefb29f1b5c0dd0 Mon Sep 17 00:00:00 2001 From: iopietro Date: Mon, 16 Apr 2018 00:02:13 +0200 Subject: [PATCH] Fixed a bug in the alliance +Usernames and alliances of attacked players are now shown in the "attacker" and "defender" filter while peace is active +Some clean-up --- Templates/Alliance/attack-attacker.tpl | 8 +++----- Templates/Alliance/attack-defender.tpl | 8 +++----- Templates/Alliance/attacks.tpl | 6 +++--- 3 files changed, 9 insertions(+), 13 deletions(-) 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);