From 18713293e552021d6e21f0f6315331fd19029384 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Jun 2012 15:21:20 +0300 Subject: [PATCH] more fix for farmlist --- Templates/goldClub/farmlist_addraid.tpl | 10 ++++++++-- Templates/goldClub/farmlist_editraid.tpl | 12 +++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Templates/goldClub/farmlist_addraid.tpl b/Templates/goldClub/farmlist_addraid.tpl index 33dd2fa9..3cc29883 100644 --- a/Templates/goldClub/farmlist_addraid.tpl +++ b/Templates/goldClub/farmlist_addraid.tpl @@ -13,6 +13,8 @@ $WrefY = $WrefCoor['y']; $type = $database->getVillageType2($Wref); $oasistype = $type['oasistype']; $vdata = $database->getVillage($Wref); +$villageOwner = $database->getVillageField($Wref,'owner'); +$userAccess = $database->getUserField($villageOwner,'access',0); }elseif($_POST['x']!="" && $_POST['y']!="" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){ $Wref = $database->getVilWref($_POST['x'], $_POST['y']); $WrefX = $_POST['x']; @@ -20,11 +22,15 @@ $WrefY = $_POST['y']; $type = $database->getVillageType2($Wref); $oasistype = $type['oasistype']; $vdata = $database->getVillage($Wref); +$villageOwner = $database->getVillageField($Wref,'owner'); +$userAccess = $database->getUserField($villageOwner,'access',0); } - if(!$_POST['x'] && !$_POST['y'] && $_POST['target_id'] == ""){ + if($_POST['x']=="" && $_POST['y']=="" && $_POST['target_id'] == ""){ $errormsg .= "Enter coordinates."; - }elseif((!$_POST['x'] || !$_POST['y']) && $_POST['target_id'] == ""){ + }elseif(($_POST['x']=="" || $_POST['y']=="") && $_POST['target_id'] == ""){ $errormsg .= "Enter the correct coordinates."; + }elseif($userAccess == '9'){ + $errormsg .= "Player is Admin. You can't attack him."; }elseif($oasistype == 0 && $vdata == 0){ $errormsg .= "There is no village on those coordinates."; }elseif($troops == 0){ diff --git a/Templates/goldClub/farmlist_editraid.tpl b/Templates/goldClub/farmlist_editraid.tpl index 82f6c3da..600b1917 100644 --- a/Templates/goldClub/farmlist_editraid.tpl +++ b/Templates/goldClub/farmlist_editraid.tpl @@ -16,6 +16,8 @@ $WrefY = $WrefCoor['y']; $type = $database->getVillageType2($Wref); $oasistype = $type['oasistype']; $vdata = $database->getVillage($Wref); +$villageOwner = $database->getVillageField($Wref,'owner'); +$userAccess = $database->getUserField($villageOwner,'access',0); }elseif($_POST['x']!="" && $_POST['y']!="" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){{ $Wref = $database->getVilWref($_POST['x'], $_POST['y']); $WrefX = $_POST['x']; @@ -23,13 +25,17 @@ $WrefY = $_POST['y']; $type = $database->getVillageType2($Wref); $oasistype = $type['oasistype']; $vdata = $database->getVillage($Wref); +$villageOwner = $database->getVillageField($Wref,'owner'); +$userAccess = $database->getUserField($villageOwner,'access',0); } $troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+".$_POST['t5']."+".$_POST['t6']."+".$_POST['t7']."+".$_POST['t8']."+".$_POST['t9']."+".$_POST['t10'].""; - if(!$_POST['x'] && !$_POST['y'] && $_POST['target_id'] == ""){ + if($_POST['x']=="" && $_POST['y']=="" && $_POST['target_id'] == ""){ $errormsg .= "Enter coordinates."; - }elseif((!$_POST['x'] || !$_POST['y']) && $_POST['target_id'] == ""){ + }elseif(($_POST['x']=="" || $_POST['y']=="") && $_POST['target_id'] == ""){ $errormsg .= "Enter the correct coordinates."; + }elseif($userAccess == '9'){ + $errormsg .= "Player is Admin. You can't attack him."; }elseif($oasistype == 0 && $vdata == 0){ $errormsg .= "There is no village on those coordinates."; }elseif($troops == 0){ @@ -66,7 +72,7 @@ $troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+" header("Location: build.php?id=39&t=99"); } } - +} if($FLData['owner'] == $session->uid){ ?>