mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-12 14:21:03 +00:00
General fixes
+Removed almost all "BANNED" controls to template and .php UI files. The control will be done only once and in the Session class
This commit is contained in:
+10
-28
@@ -1,39 +1,25 @@
|
||||
<?php
|
||||
$ty=(isset($_GET['ty']))? $_GET['ty']:"";
|
||||
$ty = (isset($_GET['ty']))? $_GET['ty']:"";
|
||||
if(isset($_REQUEST["cancel"]) && $_REQUEST["cancel"] == "1") {
|
||||
if($session->access != BANNED){
|
||||
$database->delDemolition($village->wid);
|
||||
header("Location: build.php?gid=15&ty=$ty&cancel=0&demolish=0");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($session->alliance) {
|
||||
$memberCount = $database->countAllianceMembers($session->alliance);
|
||||
} else {
|
||||
$memberCount = 0;
|
||||
}
|
||||
if($session->alliance) $memberCount = $database->countAllianceMembers($session->alliance);
|
||||
else $memberCount = 0;
|
||||
|
||||
if(!empty($_REQUEST["demolish"]) && $_REQUEST["c"] == $session->mchecker) {
|
||||
if($session->access != BANNED){
|
||||
if($_REQUEST["type"] != null && ($_REQUEST["type"] >= 19 && $_REQUEST["type"] <= 40 || $_REQUEST["type"] == 99)) {
|
||||
$type = $_REQUEST['type'];
|
||||
$demolish_permitted = $database->addDemolition($village->wid,$type);
|
||||
if ($demolish_permitted === true) {
|
||||
$session->changeChecker();
|
||||
header("Location: build.php?gid=15&ty=$type&cancel=0&demolish=0");
|
||||
} else {
|
||||
header("Location: build.php?gid=15&ty=$type&nodemolish=".$demolish_permitted);
|
||||
}
|
||||
exit;
|
||||
$session->changeChecker();
|
||||
header("Location: build.php?gid=15&ty=$type&cancel=0&demolish=0");
|
||||
}
|
||||
else header("Location: build.php?gid=15&ty=$type&nodemolish=".$demolish_permitted);
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) {
|
||||
@@ -46,13 +32,9 @@ if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) {
|
||||
echo "<a href='build.php?id=".$_GET['id']."&ty=".$ty."&cancel=1'><img src='img/x.gif' class='del' title='".CANCEL."' alt='cancel'></a> ";
|
||||
echo "".DEMOLITION_OF." ".$building->procResType($VillageResourceLevels['f'.$Demolition['buildnumber'].'t']).": <span id=timer1>".$generator->getTimeFormat($Demolition['timetofinish']-time())."</span>";
|
||||
if($session->gold >= 2) {
|
||||
if($session->access!=BANNED){
|
||||
?> <a href="?id=15&buildingFinish=1&ty=<?php echo $ty;?>" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="<?php echo FINISH_GOLD; ?>"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
|
||||
?>
|
||||
<a href="?id=15&buildingFinish=1&ty=<?php echo $ty;?>" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="<?php echo FINISH_GOLD; ?>"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
|
||||
<?php
|
||||
}else{
|
||||
?> <a href="banned.php" title="<?php echo FINISH_GOLD; ?>"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
echo "</b>";
|
||||
} else {
|
||||
|
||||
+10
-53
@@ -38,16 +38,8 @@ if (isset($_POST['name']) && !empty($_POST['name'])) {
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo (2*$hero_info['attack'])+1; ?>px;" alt="<?php echo $hero_info['atk']; ?>" title="<?php echo $hero_info['atk']; ?>" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['points'] > 0 && $hero_info['attack'] < 100){
|
||||
if($session->access != BANNED){
|
||||
echo "<a href=\"build.php?id=".$id."&add=off\">(<b>+</b>)</a>";
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
}
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
if($hero_info['points'] > 0 && $hero_info['attack'] < 100) echo "<a href=\"build.php?id=".$id."&add=off\">(<b>+</b>)</a>";
|
||||
else echo "<span class=\"none\">(+)</span>";
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['attack']; ?></td>
|
||||
@@ -58,16 +50,8 @@ if (isset($_POST['name']) && !empty($_POST['name'])) {
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo (2*$hero_info['defence'])+1; ?>px;" alt="<?php echo ($hero_info['di']) . "/" . ($hero_info['dc']); ?>" title="<?php echo ($hero_info['di']) . "/" . ($hero_info['dc']); ?>" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['points'] > 0 && $hero_info['defence'] < 100){
|
||||
if($session->access != BANNED){
|
||||
echo "<a href=\"build.php?id=".$id."&add=deff\">(<b>+</b>)</a>";
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
}
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
if($hero_info['points'] > 0 && $hero_info['defence'] < 100) echo "<a href=\"build.php?id=".$id."&add=deff\">(<b>+</b>)</a>";
|
||||
else echo "<span class=\"none\">(+)</span>";
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['defence']; ?></td>
|
||||
@@ -78,17 +62,8 @@ if (isset($_POST['name']) && !empty($_POST['name'])) {
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero_info['ob']-1)*1000+1; ?>px;" alt="<?php echo ($hero_info['ob']-1)*100; ?>%" title="<?php echo ($hero_info['ob']-1)*100; ?>%" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['points'] > 0 && $hero_info['attackbonus'] < 100){
|
||||
if($session->access != BANNED){
|
||||
echo "<a href=\"build.php?id=".$id."&add=obonus\">(<b>+</b>)</a>";
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
if($hero_info['points'] > 0 && $hero_info['attackbonus'] < 100) echo "<a href=\"build.php?id=".$id."&add=obonus\">(<b>+</b>)</a>";
|
||||
else echo "<span class=\"none\">(+)</span>";
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['attackbonus']; ?></td>
|
||||
@@ -99,17 +74,8 @@ if (isset($_POST['name']) && !empty($_POST['name'])) {
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero_info['db']-1)*1000+1; ?>px;" alt="<?php echo ($hero_info['db']-1)*100; ?>%" title="<?php echo ($hero_info['db']-1)*100; ?>%" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['points'] > 0 && $hero_info['defencebonus'] < 100){
|
||||
if($session->access != BANNED){
|
||||
echo "<a href=\"build.php?id=".$id."&add=dbonus\">(<b>+</b>)</a>";
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
if($hero_info['points'] > 0 && $hero_info['defencebonus'] < 100) echo "<a href=\"build.php?id=".$id."&add=dbonus\">(<b>+</b>)</a>";
|
||||
else echo "<span class=\"none\">(+)</span>";
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['defencebonus']; ?></td>
|
||||
@@ -120,17 +86,8 @@ if (isset($_POST['name']) && !empty($_POST['name'])) {
|
||||
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero_info['regeneration']*2)+1; ?>px;" alt="<?php echo ($hero_info['regeneration']*5*SPEED); ?>%/Day" title="<?php echo ($hero_info['regeneration']*5*SPEED); ?>%/Day" /></td>
|
||||
<td class="up"><span class="none">
|
||||
<?php
|
||||
if($hero_info['points'] > 0 && $hero_info['regeneration'] < 100){
|
||||
if($session->access != BANNED){
|
||||
echo "<a href=\"build.php?id=".$id."&add=reg\">(<b>+</b>)</a>";
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
}else {
|
||||
echo "<span class=\"none\">(+)</span>";
|
||||
}
|
||||
if($hero_info['points'] > 0 && $hero_info['regeneration'] < 100) echo "<a href=\"build.php?id=".$id."&add=reg\">(<b>+</b>)</a>";
|
||||
else echo "<span class=\"none\">(+)</span>";
|
||||
?>
|
||||
</td>
|
||||
<td class="po"><?php echo $hero_info['regeneration']; ?></td>
|
||||
|
||||
@@ -4,14 +4,9 @@
|
||||
|
||||
$oasisarray = $database->getOasis($village->wid);
|
||||
if(isset($_GET['gid']) && $_GET['gid'] == 37 && isset($_GET['del']) && $database->getOasisField($_GET['del'], 'owner') == $session->uid){
|
||||
if($session->access != BANNED){
|
||||
$database->removeOases($_GET['del']);
|
||||
header("Location: build.php?id=".$id."&land");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<table id="oases" cellpadding="1" cellspacing="1">
|
||||
|
||||
@@ -141,15 +141,10 @@
|
||||
}
|
||||
|
||||
if(isset($_GET['revive']) && $_GET['revive'] == 1 && isset($_GET['hid']) && $_GET['hid'] == $hero_datarow['heroid'] && $hero_datarow['inrevive'] == 0 && $hero_datarow['intraining'] == 0 && $hero_datarow['dead'] == 1){
|
||||
if($session->access != BANNED){
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".(int) $training_time2."', `wref` = '".(int) $village->wid."' WHERE `heroid` = ".(int) $_GET['hid']." AND `uid` = '".(int) $session->uid."'");
|
||||
$database->modifyResource($village->wid, $wood, $clay, $iron, $crop, 0);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
} else {
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
}
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".(int) $training_time2."', `wref` = '".(int) $village->wid."' WHERE `heroid` = ".(int) $_GET['hid']." AND `uid` = '".(int) $session->uid."'");
|
||||
$database->modifyResource($village->wid, $wood, $clay, $iron, $crop, 0);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -647,12 +647,11 @@ $output.="<tr>
|
||||
|
||||
// check for a valid unit value
|
||||
if (in_array($_GET['train'], $validationArray)) {
|
||||
if($session->access != BANNED){
|
||||
if($count_hero < 3){
|
||||
$unitID = $_GET['train'];
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES (".$database->escape($session->uid).", " . (int) $village->wid . ", 0, ".$unitID.", '".$database->escape($session->username)."', 0, 5, 0, 0, 100, 0, 0, 0, 0, ".round((time() + (${'u'.$unitID}['time'] / SPEED)*3)).", 50, 1)");
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET `u$unitID` = `u$unitID` - 1 WHERE `vref` = " . (int) $village->wid);
|
||||
mysqli_query($database->dblink,"
|
||||
if($count_hero < 3){
|
||||
$unitID = $_GET['train'];
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES (".$database->escape($session->uid).", " . (int) $village->wid . ", 0, ".$unitID.", '".$database->escape($session->username)."', 0, 5, 0, 0, 100, 0, 0, 0, 0, ".round((time() + (${'u'.$unitID}['time'] / SPEED)*3)).", 50, 1)");
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET `u$unitID` = `u$unitID` - 1 WHERE `vref` = " . (int) $village->wid);
|
||||
mysqli_query($database->dblink,"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) ${'u'.$unitID}['wood'].",
|
||||
@@ -661,13 +660,9 @@ $output.="<tr>
|
||||
`crop` = `crop` - ".(int) ${'u'.$unitID}['crop']."
|
||||
WHERE
|
||||
`wref` = " . (int) $village->wid);
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user