mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-23 02:17:05 +08:00
fix: no more errors when alliance is in no wars
This commit is contained in:
@@ -1789,6 +1789,8 @@ class MYSQLi_DB {
|
|||||||
$q = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli1 = '$aid' AND type = '$type' AND accepted = '1' OR alli2 = '$aid' AND type = '$type' AND accepted = '1'";
|
$q = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli1 = '$aid' AND type = '$type' AND accepted = '1' OR alli2 = '$aid' AND type = '$type' AND accepted = '1'";
|
||||||
$array = $this->query_return($q);
|
$array = $this->query_return($q);
|
||||||
$text = "";
|
$text = "";
|
||||||
|
|
||||||
|
if ($array) {
|
||||||
foreach($array as $row){
|
foreach($array as $row){
|
||||||
if($row['alli1'] == $aid){
|
if($row['alli1'] == $aid){
|
||||||
$alliance = $this->getAlliance($row['alli2']);
|
$alliance = $this->getAlliance($row['alli2']);
|
||||||
@@ -1798,6 +1800,7 @@ class MYSQLi_DB {
|
|||||||
$text .= "";
|
$text .= "";
|
||||||
$text .= "<a href=allianz.php?aid=".$alliance['id'].">".$alliance['tag']."</a><br> ";
|
$text .= "<a href=allianz.php?aid=".$alliance['id'].">".$alliance['tag']."</a><br> ";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(strlen($text) == 0){
|
if(strlen($text) == 0){
|
||||||
$text = "-<br>";
|
$text = "-<br>";
|
||||||
}
|
}
|
||||||
@@ -1809,6 +1812,8 @@ class MYSQLi_DB {
|
|||||||
$q = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli1 = '$aid' AND type = '3' OR alli2 = '$aid' AND type = '3' AND accepted = '1'";
|
$q = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli1 = '$aid' AND type = '3' OR alli2 = '$aid' AND type = '3' AND accepted = '1'";
|
||||||
$array = $this->query_return($q);
|
$array = $this->query_return($q);
|
||||||
$text = "";
|
$text = "";
|
||||||
|
|
||||||
|
if ($array) {
|
||||||
foreach($array as $row){
|
foreach($array as $row){
|
||||||
if($row['alli1'] == $aid){
|
if($row['alli1'] == $aid){
|
||||||
$alliance = $this->getAlliance($row['alli2']);
|
$alliance = $this->getAlliance($row['alli2']);
|
||||||
@@ -1818,6 +1823,7 @@ class MYSQLi_DB {
|
|||||||
$text .= "";
|
$text .= "";
|
||||||
$text .= "<a href=allianz.php?aid=".$alliance['id'].">".$alliance['tag']."</a><br> ";
|
$text .= "<a href=allianz.php?aid=".$alliance['id'].">".$alliance['tag']."</a><br> ";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(strlen($text) == 0){
|
if(strlen($text) == 0){
|
||||||
$text = "-<br>";
|
$text = "-<br>";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user