Fix in_array bug in show more buldings in WWV

This commit is contained in:
TPLinux
2017-06-29 15:53:53 +00:00
committed by GitHub
parent 5a6a8d0f5c
commit 444037f7ff
+13 -8
View File
@@ -171,14 +171,16 @@ $query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."")
while($villaggi_array = mysql_fetch_array($query)){
//loop structure village
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
$strutture= mysql_fetch_array($query1);
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
$strutture= mysql_fetch_array($query1);
if($strutture == false)
$strutture = [];
//search Castle in array structure village
$test = in_array(26,$strutture);
$test = in_array(26,$strutture);
if ($test){
break;
}
break;
}
}
@@ -297,7 +299,10 @@ while($villaggi_array = mysql_fetch_array($query)){
$strutture= mysql_fetch_array($query1);
//search Castle in array structure village
$test = in_array(26,$strutture);
if($strutture !== false)
$test = in_array(26,$strutture);
else
$test = in_array(26,[]);
if ($test){
break;
}
@@ -466,4 +471,4 @@ function show_build_list(list) {
<?php
}
?>
</div>
</div>