fix: more manual typecastings

This commit is contained in:
Martin Ambrus
2017-10-18 00:59:49 +02:00
parent 51dad48fdb
commit 6f3973748c
35 changed files with 210 additions and 210 deletions
+5 -5
View File
@@ -8,7 +8,7 @@ if(isset($_GET['t'])==99 && isset($_POST['action'])=='addList' && $_POST['did']!
header("Location: build.php?gid=16&t=99&action=addList");
}
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY wref = $village->wid DESC");
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = ".(int) $session->uid." ORDER BY wref = $village->wid DESC");
$query = mysqli_num_rows($sql);
while($row = mysqli_fetch_array($sql)){
$lid = $row["id"];
@@ -50,7 +50,7 @@ while($row = mysqli_fetch_array($sql)){
<tbody>
<?php
$sql2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $lid ORDER BY distance ASC");
$sql2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".(int) $lid." ORDER BY distance ASC");
$query2 = mysqli_num_rows($sql2);
if($query2 == 0) {
echo '<td class="noData" colspan="7">There is not any raid list.</td>';
@@ -192,7 +192,7 @@ $vdata = $database->getVillage($towref);
<?php
$noticeClass = array("Scout Report","Won as attacker without losses","Won as attacker with losses","Lost as attacker with losses","Won as defender without losses","Won as defender with losses","Lost as defender with losses","Lost as defender without losses","Reinforcement arrived","","Wood Delivered","Clay Delivered","Iron Delivered","Crop Delivered","","Won as defender without losses","Won as defender with losses","Lost as defender with losses","Won scouting as attacker","Lost scouting as attacker","Won scouting as defender","Lost scouting as defender");
$limits = "(ntype=1 or ntype=2 or ntype=3 or ntype=18 or ntype=19 or ntype=22)";
$getnotice = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limits AND toWref = ".$towref." AND uid = ".$session->uid." ORDER BY time DESC Limit 1");
$getnotice = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limits AND toWref = ".(int) $towref." AND uid = ".(int) $session->uid." ORDER BY time DESC Limit 1");
if(mysqli_num_rows($getnotice) > 0){
while($row2 = mysqli_fetch_array($getnotice)){
$dataarray = explode(",",$row2['data']);
@@ -313,7 +313,7 @@ if(!$database->getVilFarmlist($village->wid)){
{
Travian.Game.RaidList.setData({
<?php
$result = mysqli_query($GLOBALS['link'],'SELECT * FROM '.TB_PREFIX.'farmlist WHERE wref = '.$village->wid.'');
$result = mysqli_query($GLOBALS['link'],'SELECT * FROM '.TB_PREFIX.'farmlist WHERE wref = '.(int) $village->wid.'');
$query1 = mysqli_num_rows($result);
$NUM1 = 1;
while($row = mysqli_fetch_array($result)){
@@ -324,7 +324,7 @@ $lid = $row['id'];
"troops":{"1":<?php echo $unit1; ?>,"2":<?php echo $unit2; ?>,"3":<?php echo $unit3; ?>,"4":<?php echo $unit4; ?>,"5":<?php echo $unit5; ?>,"6":<?php echo $unit6; ?>,"7":<?php echo $unit7; ?>,"8":<?php echo $unit8; ?>,"9":<?php echo $unit9; ?>,"10":<?php echo $unit10; ?>,"11":<?php echo $getUnit['hero']; ?>},
"directions":{"village":"none","ew":"none","distance":"asc","troops":"none","lastRaid":"none"},
"slots":{<?php
$result3 = mysqli_query($GLOBALS['link'],'SELECT * FROM '.TB_PREFIX.'raidlist WHERE lid = '.$lid.'');
$result3 = mysqli_query($GLOBALS['link'],'SELECT * FROM '.TB_PREFIX.'raidlist WHERE lid = '.(int) $lid.'');
$query2 = mysqli_num_rows($result3);
$NUM2 = 1;
while($row3 = mysqli_fetch_array($result3)){
+2 -2
View File
@@ -85,7 +85,7 @@ $vdata = $database->getVillage($Wref);
<select name="lid">
<?php
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = ".(int) $session->uid." ORDER BY name ASC");
while($row = mysqli_fetch_array($sql)){
$lid = $row["id"];
$lname = $row["name"];
@@ -120,7 +120,7 @@ $lvname = $database->getVillageField($row["wref"], 'name');
<label class="lastTargets">Last targets:</label>
<select name="target_id">
<?php
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$database->escape($_GET['lid'])."";
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$database->escape((int) $_GET['lid'])."";
$arraywref = $database->query_return($getwref);
echo '<option value="">Select village</option>';
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],$getwref)) != 0){
+2 -2
View File
@@ -92,7 +92,7 @@ $lid2 = $getlid['lid'];
<td>
<select onchange="getTargetsByLid();" id="lid" name="lid">
<?php
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = ".(int) $session->uid." ORDER BY name ASC");
while($row = mysqli_fetch_array($sql)){
$lid = $row["id"];
$lname = $row["name"];
@@ -126,7 +126,7 @@ $lvname = $database->getVillageField($row["wref"], 'name');
<label class="lastTargets">Last targets:</label>
<select name="target_id">
<?php
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $lid2";
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".(int) $lid2;
$arraywref = $database->query_return($getwref);
echo '<option value="">Select village</option>';
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],$getwref)) != 0){