Merge branch 'master' of https://github.com/evader1337/TravianZ into evader1337-master

# Conflicts:
#	GameEngine/Database/db_MYSQL.php
#	Templates/Build/avaliable.tpl
#	Templates/Message/inbox.tpl
This commit is contained in:
Martin Ambrus
2017-08-28 14:18:24 +02:00
93 changed files with 5041 additions and 9207 deletions
+3 -5
View File
@@ -2,10 +2,8 @@
session_start();
include('GameEngine/config.php');
include_once ("GameEngine/Lang/" . LANG . ".php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
mysql_select_db(SQL_DB) or die(mysql_error());
include("GameEngine/Generator.php");
include("GameEngine/Database/db_MYSQL.php");
include("GameEngine/Database.php");
//include("GameEngine/Session.php");
@@ -88,14 +86,14 @@ $query2 = "SELECT
where ".TB_PREFIX."wdata.id IN ($maparray)
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
$result2 = mysql_query($query2) or die(mysql_error());
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error());
$i=0;
//Load coor array
$yrow = 0;
$map_js ='';
while ($donnees = mysql_fetch_assoc($result2)){
while ($donnees = mysqli_fetch_assoc($result2)){
$targetalliance=$donnees["aliance_id"];
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
+3 -5
View File
@@ -2,10 +2,8 @@
session_start();
include('GameEngine/config.php');
include_once ("GameEngine/Lang/" . LANG . ".php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
mysql_select_db(SQL_DB) or die(mysql_error());
include("GameEngine/Generator.php");
include("GameEngine/Database/db_MYSQL.php");
include("GameEngine/Database.php");
header("Content-Type: application/json;");
//include("GameEngine/Session.php");
@@ -103,7 +101,7 @@ $query2 = "SELECT
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
//echo $query2;
$result2 = mysql_query($query2) or die(mysql_error());
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error());
$i=0;
$i2=0;
@@ -112,7 +110,7 @@ $row = 0;
$coorindex = 0;
$map_js ='';
while ($donnees = mysql_fetch_assoc($result2)){
while ($donnees = mysqli_fetch_assoc($result2)){
$targetalliance=$donnees["aliance_id"];
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
+4 -4
View File
@@ -71,7 +71,7 @@ if (isset($qact)){
$_SESSION['qst']= 3;
//Give Reward
if(!$session->plus){
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysql_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
} else {
$plus=$database->getUserField($_SESSION['username'],'plus','username');
$plus+=86400;
@@ -151,7 +151,7 @@ if (isset($qact)){
$_SESSION['qst']= 11;
//Give Reward
if(!$session->plus){
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysql_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
} else {
$plus=$database->getUserField($_SESSION['username'],'plus','username');
$plus+=172800;
@@ -338,7 +338,7 @@ if (isset($qact)){
$_SESSION['qst_time'] = time()+$skipp_time;
//Give Reward
if(!$session->plus){
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysql_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
} else {
$plus=$database->getUserField($_SESSION['username'],'plus','username');
$plus+=86400;
@@ -401,7 +401,7 @@ if (isset($qact)){
$_SESSION['qst']= 97;
//Give Reward 20 gold + 2 days plus
if(!$session->plus){
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysql_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
} else {
$plus=$database->getUserField($_SESSION['username'],'plus','username');
$plus+=172800;
+4 -4
View File
@@ -69,7 +69,7 @@ if (isset($qact)){
$_SESSION['qst']= 3;
//Give Reward
if(!$session->plus){
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysql_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
} else {
$plus=$database->getUserField($_SESSION['username'],'plus','username');
$plus+=86400;
@@ -154,7 +154,7 @@ if (isset($qact)){
$_SESSION['qst']= 11;
//Give Reward
if(!$session->plus){
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysql_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
} else {
$plus=$database->getUserField($_SESSION['username'],'plus','username');
$plus+=172800;
@@ -322,7 +322,7 @@ if (isset($qact)){
$_SESSION['qst_time'] = time()+$skipp_time;
//Give Reward
if(!$session->plus){
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysql_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
} else {
$plus=$database->getUserField($_SESSION['username'],'plus',1);
$plus+=86400;
@@ -385,7 +385,7 @@ if (isset($qact)){
$_SESSION['qst']= 97;
//Give Reward 20 gold + 2 days plus
if(!$session->plus){
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysql_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
} else {
$plus=$database->getUserField($_SESSION['username'],'plus',1);
$plus+=172800;
+8 -8
View File
@@ -9,14 +9,14 @@ if($session->access!=BANNED){
$displayarray = $database->getUserArray($session->uid,1);
$forumcat = $database->ForumCat(htmlspecialchars($displayarray['alliance']));
$ally = $session->alliance;
$public = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 1");
$public1 = mysql_num_rows($public);
$cofederation = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 2");
$cofederation1 = mysql_num_rows($cofederation);
$alliance = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 0");
$alliance1 = mysql_num_rows($alliance);
$closed = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 3");
$closed1 = mysql_num_rows($closed);
$public = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 1");
$public1 = mysqli_num_rows($public);
$cofederation = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 2");
$cofederation1 = mysqli_num_rows($cofederation);
$alliance = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 0");
$alliance1 = mysqli_num_rows($alliance);
$closed = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 3");
$closed1 = mysqli_num_rows($closed);
if($public1 != 0){
?>
<table cellpadding="1" cellspacing="1" id="public"><thead>
+3 -3
View File
@@ -1,14 +1,14 @@
<?php
$prefix = "".TB_PREFIX."ndata";
$limit = "ntype!=0 AND ntype!=4 AND ntype!=5 AND ntype!=6 AND ntype!=7 AND ntype!=8 AND ntype!=9 AND ntype!=10 AND ntype!=11 AND ntype!=12 AND ntype!=13 AND ntype!=14 AND ntype!=15 AND ntype!=16 AND ntype!=17 AND ntype!=20 AND ntype!=21";
$sql = mysql_query("SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
$query = mysql_num_rows($sql);
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
$query = mysqli_num_rows($sql);
$outputList = '';
$name = 1;
if($query == 0) {
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
}else{
while($row = mysql_fetch_array($sql)){
while($row = mysqli_fetch_array($sql)){
$dataarray = explode(",",$row['data']);
$id = $row["id"];
$uid = $row["uid"];
+3 -3
View File
@@ -1,14 +1,14 @@
<?php
$prefix = "".TB_PREFIX."ndata";
$limit = "ntype!=1 AND ntype!=2 AND ntype!=3 AND ntype!=8 AND ntype!=9 AND ntype!=10 AND ntype!=11 AND ntype!=12 AND ntype!=13 AND ntype!=14 AND ntype!=15 AND ntype!=16 AND ntype!=17 AND ntype!=18 AND ntype!=19";
$sql = mysql_query("SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
$query = mysql_num_rows($sql);
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
$query = mysqli_num_rows($sql);
$outputList = '';
$name = 1;
if($query == 0) {
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
}else{
while($row = mysql_fetch_array($sql)){
while($row = mysqli_fetch_array($sql)){
$dataarray = explode(",",$row['data']);
$id = $row["id"];
$uid = $row["uid"];
+3 -3
View File
@@ -28,14 +28,14 @@ include("alli_menu.tpl");
}else{
$prefix = "".TB_PREFIX."ndata";
$limit = "ntype!=8 AND ntype!=9 AND ntype!=10 AND ntype!=11 AND ntype!=12 AND ntype!=13 AND ntype!=14 AND ntype!=15 AND ntype!=16 AND ntype!=17";
$sql = mysql_query("SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
$query = mysql_num_rows($sql);
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
$query = mysqli_num_rows($sql);
$outputList = '';
$name = 1;
if($query == 0) {
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
}else{
while($row = mysql_fetch_array($sql)){
while($row = mysqli_fetch_array($sql)){
$dataarray = explode(",",$row['data']);
$id = $row["id"];
$uid = $row["uid"];
+2 -2
View File
@@ -8,8 +8,8 @@ $total_for2 = count($send);
for($y=0;$y < $total_for;$y++){
for($i=0;$i < $total_for2;$i++){
if($units[$y]['ref'] == $send[$i]['ref2']){
$res1 = mysql_query("SELECT * FROM " . TB_PREFIX . "send where id = ".$send[$i]['ref']."");
$res = mysql_fetch_array($res1);
$res1 = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "send where id = ".$send[$i]['ref']."");
$res = mysqli_fetch_array($res1);
}
}
$timer = $y+1;
+14 -14
View File
@@ -6,33 +6,33 @@ if(time() - $_SESSION['time_p'] > 5) {
}
if($_POST AND $_GET['action'] == 'change_capital') {
$pass = mysql_escape_string($_POST['pass']);
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $session->uid);
$data = mysql_fetch_assoc($query);
$pass = mysqli_escape_string($GLOBALS['link'],$_POST['pass']);
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $session->uid);
$data = mysqli_fetch_assoc($query);
if($data['password'] == md5($pass)) {
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
$data1 = mysql_fetch_assoc($query1);
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'fdata` WHERE `vref` = ' . $data1['wref']);
$data2 = mysql_fetch_assoc($query2);
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
$data1 = mysqli_fetch_assoc($query1);
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'fdata` WHERE `vref` = ' . $data1['wref']);
$data2 = mysqli_fetch_assoc($query2);
if($data2['vref'] != $village->wid) {
for($i = 1; $i<=18; ++$i) {
if($data2['f' . $i] > 10) {
$query2 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . '` = 10 WHERE `vref` = ' . $data2['vref']) or die(mysql_error());
$query2 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . '` = 10 WHERE `vref` = ' . $data2['vref']) or die(mysqli_error());
}
}
for($i=19; $i<=40; ++$i) {
if($data2['f' . $i . 't'] == 34) {
$query3 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . $data2['vref']) or die(mysql_error());
$query3 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . $data2['vref']) or die(mysqli_error());
}
}
for($i=19; $i<=40; ++$i) {
if($data2['f' . $i . 't'] == 29 or $data2['f' . $i . 't'] == 30 or $data2['f' . $i . 't'] == 38 or $data2['f' . $i . 't'] == 39 or $data2['f' . $i . 't'] == 42) {
$query3 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . $village->wid) or die(mysql_error());
$query3 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . $village->wid) or die(mysqli_error());
}
}
$query3 = mysql_query('UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 0 WHERE `wref` = ' . $data1['wref']);
$query4 = mysql_query('UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 1 WHERE `wref` = ' . $village->wid);
$query3 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 0 WHERE `wref` = ' . $data1['wref']);
$query4 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 1 WHERE `wref` = ' . $village->wid);
}
} else {
$error = '<br /><font color="red">'.LOGIN_PW_ERROR.'</font><br />';
@@ -68,8 +68,8 @@ else{
?>
<?php
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
$data = mysql_fetch_assoc($query);
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
$data = mysqli_fetch_assoc($query);
if($data['wref'] == $village->wid) {
?>
<p class="none"><?php echo CAPITAL; ?></p>
+5 -5
View File
@@ -84,7 +84,7 @@ Treasury <b>' . $reqlvl . '</b>, Effect <b>' . $effect . '</b>
<tbody>
<?php
if(mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
echo '<td colspan="4" class="none">'.NO_ARTIFACTS_AREA.'</td>';
} else {
@@ -102,11 +102,11 @@ if(mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts")) == 0)
unset($reqlvl);
unset($effect);
$arts = mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts");
$arts = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "artefacts");
$rows = array();
while($row = mysql_fetch_array($arts)) {
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'wdata` WHERE `id` = ' . $row['vref']);
$coor2 = mysql_fetch_assoc($query);
while($row = mysqli_fetch_array($arts)) {
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'wdata` WHERE `id` = ' . $row['vref']);
$coor2 = mysqli_fetch_assoc($query);
$dist = round(getDistance($coor['x'], $coor['y'], $coor2['x'], $coor2['y']),1);
+19 -19
View File
@@ -31,13 +31,13 @@
<tbody>
<?php
if(mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
echo '<td colspan="4" class="none">'.NO_ARTIFACTS.'</td>';
} else {
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 1");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 1");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -56,8 +56,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 2");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 2");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -76,8 +76,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 3");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 3");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -96,8 +96,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 4");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 4");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -115,8 +115,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 5");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 5");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -134,8 +134,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 6");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 6");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -153,8 +153,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 7");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 7");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -172,8 +172,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 8");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 8");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -186,8 +186,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 8");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 8");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
+31 -31
View File
@@ -31,12 +31,12 @@
<tbody>
<?php
if(mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
echo '<td colspan="4" class="none">'.NO_ARTIFACTS.'</td>';
} else {
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 1");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 1");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -49,8 +49,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 1");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 1");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -69,8 +69,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 2");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 2");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -83,8 +83,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 2");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 2");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -103,8 +103,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 3");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 3");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -117,8 +117,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 3");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 3");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -137,8 +137,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 4");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 4");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -151,8 +151,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 4");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 4");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -170,8 +170,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 5");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 5");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -184,8 +184,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 5");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 5");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -203,8 +203,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 6");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 6");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -217,8 +217,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 6");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 6");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -236,8 +236,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 7");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 7");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -250,8 +250,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 7");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 7");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
@@ -269,8 +269,8 @@
unset($artefact);
unset($row);
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 8");
while($row = mysql_fetch_array($artefact)) {
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 8");
while($row = mysqli_fetch_array($artefact)) {
echo '<tr>';
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
echo '<td class="nam">';
+5 -5
View File
@@ -8,8 +8,8 @@
| Copyright: TravianX Project All rights reserved |
\*-------------------------------------------------------*/
$hero = mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
$hero_info = mysql_fetch_array($hero);
$hero = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
$hero_info = mysqli_fetch_array($hero);
$define['reset_level'] = 3; // Until which level you are able to reset your points
@@ -61,7 +61,7 @@
if(isset($_GET['land'])) {
include("37_land.tpl");
} else {
if(mysql_num_rows($hero) == 0){
if(mysqli_num_rows($hero) == 0){
include("37_train.tpl");
}elseif($hero_info['intraining'] == 1){
$timeleft = $generator->getTimeFormat($hero_info['trainingtime'] - time());
@@ -87,10 +87,10 @@
</table>
<?php
}
if(mysql_num_rows($hero) != 0 AND $hero_info['dead'] == 1 AND $hero_info['intraining'] == 0){
if(mysqli_num_rows($hero) != 0 AND $hero_info['dead'] == 1 AND $hero_info['intraining'] == 0){
include("37_revive.tpl");
}
if(mysql_num_rows($hero) != 0 AND $hero_info['dead'] == 0 AND $hero_info['trainingtime'] <= time() AND $hero_info['inrevive'] == 0 AND $hero_info['intraining'] == 0){
if(mysqli_num_rows($hero) != 0 AND $hero_info['dead'] == 0 AND $hero_info['trainingtime'] <= time() AND $hero_info['inrevive'] == 0 AND $hero_info['intraining'] == 0){
include("37_hero.tpl");
}
}
+19 -19
View File
@@ -13,9 +13,9 @@ include_once("GameEngine/Data/hero_full.php");
if (isset($_POST['name'])) {
$_POST['name'] = stripslashes($_POST['name']);
mysql_query("UPDATE ".TB_PREFIX."hero SET `name`='".($_POST['name'])."' where `uid`='".$session->uid."'") or die("ERROR:".mysql_error());
$hero = mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
$hero_info = mysql_fetch_array($hero);
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `name`='".($_POST['name'])."' where `uid`='".$session->uid."'") or die("ERROR:".mysqli_error());
$hero = mysqli_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
$hero_info = mysqli_fetch_array($hero);
echo "".NAME_CHANGED."";
}
@@ -169,48 +169,48 @@ if (isset($_POST['name'])) {
if($_GET['add'] == "reset") {
if($hero_info['level'] <= 3){
if($hero_info['attack'] != 0 OR $hero_info['defence'] != 0 OR $hero_info['attackbonus'] != 0 OR $hero_info['defencebonus'] != 0 OR $hero_info['regeneration'] != 0){
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = '".(($hero_info['level']*5)+5)."' WHERE `uid` = '" . $session->uid . "'");
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `uid` = '" . $session->uid . "'");
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `uid` = '" . $session->uid . "'");
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `uid` = '" . $session->uid . "'");
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `uid` = '" . $session->uid . "'");
mysql_query("UPDATE " . TB_PREFIX . "hero SET `regeneration` = '0' WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = '".(($hero_info['level']*5)+5)."' WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = '0' WHERE `uid` = '" . $session->uid . "'");
header("Location: build.php?id=".$id."");
}
}
}
if($_GET['add'] == "off" && $hero_info['attack'] < 100) {
if($hero_info['points'] > 0) {
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `uid` = '" . $session->uid . "'");
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
header("Location: build.php?id=".$id."");
}
}
if($_GET['add'] == "deff" && $hero_info['defence'] < 100) {
if($hero_info['points'] > 0) {
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `uid` = '" . $session->uid . "'");
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
header("Location: build.php?id=".$id."");
}
}
if($_GET['add'] == "obonus" && $hero_info['attackbonus'] < 100) {
if($hero_info['points'] > 0) {
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `uid` = '" . $session->uid . "'");
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
header("Location: build.php?id=".$id."");
}
}
if($_GET['add'] == "dbonus" && $hero_info['defencebonus'] < 100) {
if($hero_info['points'] > 0) {
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `uid` = '" . $session->uid . "'");
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
header("Location: build.php?id=".$id."");
}
}
if($_GET['add'] == "reg" && $hero_info['regeneration'] < 100) {
if($hero_info['points'] > 0) {
mysql_query("UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `uid` = '" . $session->uid . "'");
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
header("Location: build.php?id=".$id."");
}
}
+5 -5
View File
@@ -171,11 +171,11 @@
if($_GET['revive'] == 1 && $hero_info['inrevive'] == 0 && $hero_info['intraining'] == 0 && $hero_info['dead'] == 1){
if($session->access != BANNED){
mysql_query("UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".$training_time2."', `wref` = '".$village->wid."' WHERE `uid` = '".$session->uid."'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$wood." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$clay." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$iron." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$crop." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".$training_time2."', `wref` = '".$village->wid."' WHERE `uid` = '".$session->uid."'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$wood." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$clay." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$iron." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$crop." WHERE `wref` = '" . $village->wid . "'");
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
+108 -108
View File
@@ -34,8 +34,8 @@
//check if there is unit needed in the village
$result = mysql_query("SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".$village->wid."");
$units = mysql_fetch_array($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".$village->wid."");
$units = mysqli_fetch_array($result);
$output="<table cellpadding=1 cellspacing=1 class=\"build_details\">
<thead>
@@ -529,18 +529,18 @@ $output.="<tr>
//HERO TRAINING
$count_hero = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . ""));
$count_hero = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . ""));
if($session->tribe == 1){
if($_GET['train'] == 1){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '1', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u1` = `u1` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u1['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u1['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u1['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u1['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '1', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u1` = `u1` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u1['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u1['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u1['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u1['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -549,14 +549,14 @@ $output.="<tr>
}
if($_GET['train'] == 2){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '2', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u2` = `u2` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u2['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u2['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u2['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u2['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '2', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u2` = `u2` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u2['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u2['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u2['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u2['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -565,13 +565,13 @@ $output.="<tr>
}
if($_GET['train'] == 3){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '3', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u3['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u3` = `u3` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u3['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u3['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u3['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u3['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '3', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u3['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u3` = `u3` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u3['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u3['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u3['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u3['crop']." WHERE `wref` = '" . $village->wid . "'");
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
@@ -579,14 +579,14 @@ $output.="<tr>
}
if($_GET['train'] == 5){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '5', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u5['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u5` = `u5` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u5['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u5['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u5['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u5['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '5', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u5['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u5` = `u5` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u5['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u5['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u5['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u5['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -595,14 +595,14 @@ $output.="<tr>
}
if($_GET['train'] == 6){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '6', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u6['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u6` = `u6` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u6['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u6['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u6['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u6['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '6', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u6['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u6` = `u6` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u6['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u6['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u6['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u6['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -613,14 +613,14 @@ $output.="<tr>
if($session->tribe == 2){
if($_GET['train'] == 11){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '11', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u11['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u11` = `u11` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u11['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u11['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u11['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u11['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '11', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u11['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u11` = `u11` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u11['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u11['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u11['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u11['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -629,14 +629,14 @@ $output.="<tr>
}
if($_GET['train'] == 12){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '12', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u12['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u12` = `u12` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u12['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u12['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u12['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u12['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '12', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u12['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u12` = `u12` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u12['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u12['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u12['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u12['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -645,14 +645,14 @@ $output.="<tr>
}
if($_GET['train'] == 13){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '13', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u13['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u13` = `u13` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u13['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u13['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u13['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u13['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '13', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u13['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u13` = `u13` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u13['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u13['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u13['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u13['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -661,14 +661,14 @@ $output.="<tr>
}
if($_GET['train'] == 15){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '15', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u15['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u15` = `u15` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u15['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u15['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u15['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u15['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '15', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u15['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u15` = `u15` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u15['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u15['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u15['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u15['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -677,14 +677,14 @@ $output.="<tr>
}
if($_GET['train'] == 16){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '16', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u16['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u16` = `u16` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u16['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u16['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u16['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u16['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '16', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u16['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u16` = `u16` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u16['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u16['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u16['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u16['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -695,14 +695,14 @@ $output.="<tr>
if($session->tribe == 3){
if($_GET['train'] == 21){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '21', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u21['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u21` = `u21` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u21['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u21['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u21['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u21['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '21', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u21['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u21` = `u21` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u21['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u21['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u21['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u21['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -711,14 +711,14 @@ $output.="<tr>
}
if($_GET['train'] == 22){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '22', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u22['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u22` = `u22` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u22['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u22['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u22['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u22['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '22', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u22['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u22` = `u22` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u22['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u22['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u22['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u22['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -727,14 +727,14 @@ $output.="<tr>
}
if($_GET['train'] == 24){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '24', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u24['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u24` = `u24` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u24['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u24['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u24['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u24['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '24', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u24['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u24` = `u24` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u24['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u24['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u24['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u24['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -743,14 +743,14 @@ $output.="<tr>
}
if($_GET['train'] == 25){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '25', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u25['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u25` = `u25` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u25['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u25['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u25['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u25['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '25', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u25['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u25` = `u25` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u25['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u25['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u25['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u25['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
@@ -759,14 +759,14 @@ $output.="<tr>
}
if($_GET['train'] == 26){
if($session->access != BANNED){
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
if($count_hero == 0){
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '26', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u26['time'] / SPEED)*3))."', '50', '1')");
mysql_query("UPDATE " . TB_PREFIX . "units SET `u26` = `u26` - 1 WHERE `vref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u26['wood']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u26['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u26['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u26['crop']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '26', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u26['time'] / SPEED)*3))."', '50', '1')");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u26` = `u26` - 1 WHERE `vref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u26['wood']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u26['clay']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u26['iron']." WHERE `wref` = '" . $village->wid . "'");
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u26['crop']." WHERE `wref` = '" . $village->wid . "'");
}
header("Location: build.php?id=".$id."");
}else{
+10 -13
View File
@@ -162,17 +162,14 @@ if($palace == 0 && $palace1 == 0 && $village->natar == 0 && $embassy >= 1 && $ma
//id user
$user = $session->uid;
//connect to DB
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
//loop search village user
$query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
while($villaggi_array = mysql_fetch_array($query)){
$query = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
while($villaggi_array = mysqli_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 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
$strutture= mysqli_fetch_array($query1);
if($strutture == false)
$strutture = [];
//search Castle in array structure village
@@ -287,16 +284,16 @@ if($embassy == 0 || $mainbuilding >= 2 && $mainbuilding <= 4 && $village->natar
$user = $session->uid;
//connect to DB
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
//mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
//mysql_select_db(SQL_DB);
//loop search village user
$query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
while($villaggi_array = mysql_fetch_array($query)){
$query = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
while($villaggi_array = mysqli_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 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
$strutture= mysqli_fetch_array($query1);
//search Castle in array structure village
if($strutture !== false)
+2 -2
View File
@@ -111,7 +111,7 @@ $query2 = "SELECT
//$query2;
$result2 = mysql_query($query2) or die(mysql_error());
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error());
$targetalliance = array();
$neutralarray = array();
@@ -129,7 +129,7 @@ $map_js ='';
$map_gen='';
$map_content='';
while ($donnees = mysql_fetch_assoc($result2)){
while ($donnees = mysqli_fetch_assoc($result2)){
$targetalliance=$donnees["aliance_id"];
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
+2 -2
View File
@@ -121,7 +121,7 @@ $query2 = "SELECT
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
//echo $query2;
$result2 = mysql_query($query2) or die(mysql_error());
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error());
$targetalliance = array();
$neutralarray = array();
@@ -307,7 +307,7 @@ $coorarray = array(
,"924, 253, 961, 273, 924, 293, 887, 273"
);
while ($donnees = mysql_fetch_assoc($result2)){
while ($donnees = mysqli_fetch_assoc($result2)){
$targetalliance=$donnees["aliance_id"];
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
+25 -25
View File
@@ -2,8 +2,8 @@
<?php
$basearray = $database->getMInfo($_GET['d']);
$uinfo = $database->getVillage($basearray['id']);
$oasis1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysql_real_escape_string($_GET['d']));
$oasis = mysql_fetch_assoc($oasis1);
$oasis1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysqli_real_escape_string($GLOBALS['link'],$_GET['d']));
$oasis = mysqli_fetch_assoc($oasis1);
$access=$session->access;
?>
<h1><?php if($basearray['fieldtype']!=0){
@@ -159,10 +159,10 @@ if($session->uid == $database->getVillage($_GET['d'])){
}
$toWref = $_GET['d'];
if($session->alliance!=0){
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysqli_num_rows($result);
if($query != 0){
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$dataarray = explode(",",$row['data']);
$type = $row['ntype'];
$topic=$row['topic'];
@@ -183,10 +183,10 @@ if($type==18 or $type==19 or $type==20 or $type==21){
<?php }
}else{
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysqli_num_rows($result);
if($query != 0){
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$dataarray = explode(",",$row['data']);
$type = $row['ntype'];
$topic=$row['topic'];
@@ -258,10 +258,10 @@ if($session->uid == $database->getVillage($_GET['d'])){
}
$toWref = $_GET['d'];
if($session->alliance!=0){
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysqli_num_rows($result);
if($query != 0){
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$dataarray = explode(",",$row['data']);
$type = $row['ntype'];
$topic=$row['topic'];
@@ -282,10 +282,10 @@ if($type==18 or $type==19 or $type==20 or $type==21){
<?php }
}else{
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysqli_num_rows($result);
if($query != 0){
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$dataarray = explode(",",$row['data']);
$type = $row['ntype'];
$topic=$row['topic'];
@@ -384,10 +384,10 @@ if($session->uid == $database->getVillage($_GET['d'])){
}
$toWref = $_GET['d'];
if($session->alliance!=0){
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysqli_num_rows($result);
if($query != 0){
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$dataarray = explode(",",$row['data']);
$type = $row['ntype'];
$topic=$row['topic'];
@@ -408,10 +408,10 @@ if($type==18 or $type==19 or $type==20 or $type==21 or $type==22){
<?php }
}else{
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
$query = mysqli_num_rows($result);
if($query != 0){
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$dataarray = explode(",",$row['data']);
$type = $row['ntype'];
$topic=$row['topic'];
@@ -485,13 +485,13 @@ if($type==18 or $type==19 or $type==20 or $type==21){
<td class="none">
<?php
if($basearray['fieldtype'] == 0){
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysql_escape_string($_GET['d']));
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysqli_escape_string($GLOBALS['link'],$_GET['d']));
}else{
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysql_real_escape_string($_GET['d']));
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysqli_real_escape_string($GLOBALS['link'],$_GET['d']));
}
$data1 = mysql_fetch_assoc($query1);
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
$data2 = mysql_fetch_assoc($query2);
$data1 = mysqli_fetch_assoc($query1);
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
$data2 = mysqli_fetch_assoc($query2);
if($data2['access']=='0' or $data2['access']=='8' or $data2['access']=='9') {
echo "&raquo; ".SENDTROOP." (".BAN.")";
} else if($data2['vac_mode']=='1') {
+5 -5
View File
@@ -1,6 +1,6 @@
x<div id="content" class="messages">
<h1>Messages</h1>
<?php
<?php
include("menu.tpl");
?>
<form method="post" action="nachrichten.php" name="msg" ><table cellpadding="1" cellspacing="1" id="overview">
@@ -11,8 +11,8 @@ x<div id="content" class="messages">
<th class="sent">Sent</th>
</tr></thead><tfoot><tr><th>
<?php
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
$date2=strtotime("NOW");
if ($golds['plus'] <= $date2) { ?>
<?php } else { ?>
@@ -23,7 +23,7 @@ x<div id="content" class="messages">
<input name="delmsg" value="delete" type="image" id="btn_delete" class="dynamic_img" src="img/x.gif" alt="delete" />
<?php if($session->plus) { echo "<input name=\"archive\" value=\"Archive\" type=\"image\" id=\"btn_archiv\" class=\"dynamic_img\" src=\"img/x.gif\" alt=\"Archive\" />"; } ?>
<input name="ft" value="m3" type="hidden" />
</th><th class="navi"><?php
</th><th class="navi"><?php
if(!isset($_GET['s']) && count($message->inbox1) < 10) {
echo "&laquo;&raquo;";
}
@@ -47,7 +47,7 @@ x<div id="content" class="messages">
background-color:orange;
}
</style>
<?php
<?php
if(isset($_GET['s'])) {
$s = $_GET['s'];
}
+2 -2
View File
@@ -22,8 +22,8 @@
<th>Recipient</th>
<th class="sent"><a href="nachrichten.php?t=2&s=0&amp;t=2&amp;o=1">Sent</a></th>
</tr></thead><tfoot><tr><th><?php
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
$date2=strtotime("NOW");
if ($golds['plus'] <= $date2) { ?>
<?php } else { ?>
+2 -2
View File
@@ -1,8 +1,8 @@
<h5><img src="img/en/t2/newsbox1.gif" alt="newsbox 1"></h5>
<?php
$online = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
$top_rank = mysql_fetch_assoc(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access< 8 AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY oldrank ASC Limit 1"));
$online = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
$top_rank = mysqli_fetch_assoc(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access< 8 AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY oldrank ASC Limit 1"));
?>
+1 -1
View File
@@ -1,7 +1,7 @@
<h5><img src="img/en/t2/newsbox2.gif" alt="newsbox 2"></h5>
<?php
$online = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
$online = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
?>
+2 -2
View File
@@ -12,8 +12,8 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
</tr>
</thead><tfoot>
<tr><th><?php
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
$date2=strtotime("NOW");
if ($golds['plus'] <= $date2) { ?>
<?php } else { ?>
+25 -51
View File
@@ -1,55 +1,29 @@
<?php
////////////// made by alq0rsan /////////////////////////
if($session->access != BANNED){
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$uuid = mysql_fetch_array($MyId);
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
$uuVilid = mysql_fetch_array($MyVilId);
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
$today = date("mdHi");
if($session->sit == 0) {
if (mysql_num_rows($MyGold)) {
if($golds['6'] > 2) {
if (mysql_num_rows($MyGold)) {
if($golds['b2'] < time()) {
mysql_query("UPDATE ".TB_PREFIX."users set b2 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
////////////// made by alq0rsan, improved by evader /////////////////////////
if($session->access != BANNED && $session->gold >= 5){
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
if($session->sit == 0) {
if (mysqli_num_rows($MyGold) == 1) {
if($golds['gold'] >= 5) {
if($golds['b2'] < time()) {
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b2 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
} else {
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b2 = '".($golds['b2']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
}
$done1 = "+25% Production: Clay";
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error());
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Clay')") or die(mysqli_error());
} else {
$done1 = "You need more gold";
}
} else {
$done1 = "Failed clay attempt";
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Clay')") or die(mysqli_error());
}
}
header("Location: plus.php?id=3");
} else {
mysql_query("UPDATE ".TB_PREFIX."users set b2 = '".($golds['b2']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
}
$done1 = "+25% Production: Clay";
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysql_error());
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', '+25% Production: Clay')") or die(mysql_error());
} else {
$done1 = "nothing has been done";
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed +25% Production: Clay')") or die(mysql_error());
}
} else {
$done1 = "You need more gold";
}
}
}
header("Location: plus.php?id=3");
}else{
header("Location: banned.php");
header("Location: banned.php");
}
?>
+25 -51
View File
@@ -1,55 +1,29 @@
<?php
////////////// made by alq0rsan /////////////////////////
if($session->access != BANNED){
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$uuid = mysql_fetch_array($MyId);
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
$uuVilid = mysql_fetch_array($MyVilId);
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
$today = date("mdHi");
if($session->sit == 0) {
if (mysql_num_rows($MyGold)) {
if($golds['6'] > 2) {
if (mysql_num_rows($MyGold)) {
if($golds['b3'] < time()) {
mysql_query("UPDATE ".TB_PREFIX."users set b3 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
////////////// made by alq0rsan, improved by evader /////////////////////////
if($session->access != BANNED && $session->gold >= 5){
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
if($session->sit == 0) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] >= 5) {
if($golds['b3'] < time()) {
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b3 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
} else {
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b3 = '".($golds['b3']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
}
$done1 = "+25% Production: Iron";
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error());
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Iron')") or die(mysqli_error());
} else {
$done1 = "You need more gold";
}
} else {
$done1 = "Failed iron attempt";
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Iron')") or die(mysqli_error());
}
}
header("Location: plus.php?id=3");
} else {
mysql_query("UPDATE ".TB_PREFIX."users set b3 = '".($golds['b3']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
}
$done1 = "+25% Production: Iron";
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysql_error());
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', '+25% Production: Iron')") or die(mysql_error());
} else {
$done1 = "nothing has been done";
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed +25% Production: Iron')") or die(mysql_error());
}
} else {
$done1 = "You need more gold";
}
}
}
header("Location: plus.php?id=3");
}else{
header("Location: banned.php");
header("Location: banned.php");
}
?>
+25 -51
View File
@@ -1,55 +1,29 @@
<?php
////////////// made by alq0rsan /////////////////////////
if($session->access != BANNED){
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$uuid = mysql_fetch_array($MyId);
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
$uuVilid = mysql_fetch_array($MyVilId);
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
$today = date("mdHi");
if($session->sit == 0) {
if (mysql_num_rows($MyGold)) {
if($golds['6'] > 2) {
if (mysql_num_rows($MyGold)) {
if($golds['b4'] < time()) {
mysql_query("UPDATE ".TB_PREFIX."users set b4 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
////////////// made by alq0rsan, improved by evader /////////////////////////
if($session->access != BANNED && $session->gold >= 5){
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
if($session->sit == 0) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] >= 5) {
if($golds['b4'] < time()) {
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b4 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
} else {
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b4 = '".($golds['b4']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
}
$done1 = "+25% Production: Crop";
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error());
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Crop')") or die(mysqli_error());
} else {
$done1 = "You need more gold";
}
} else {
$done1 = "Failed crop attempt";
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Crop')") or die(mysqli_error());
}
}
header("Location: plus.php?id=3");
} else {
mysql_query("UPDATE ".TB_PREFIX."users set b4 = '".($golds['b4']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
}
$done1 = "+25% Production: Crop";
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysql_error());
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', '+25% Production: Crop')") or die(mysql_error());
} else {
$done1 = "nothing has been done";
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed +25% Production: Crop')") or die(mysql_error());
}
} else {
$done1 = "You need more gold";
}
}
}
header("Location: plus.php?id=3");
}else{
header("Location: banned.php");
header("Location: banned.php");
}
?>
+7 -7
View File
@@ -1,7 +1,7 @@
<!---<?php
/*include("Templates/Plus/pmenu.tpl");
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysql_error());
$uuVilid = mysql_fetch_array($MyVilId);
$MyVilId = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysqli_error());
$uuVilid = mysqli_fetch_array($MyVilId);
$totalR = ($uuVilid['6']+$uuVilid['7']+$uuVilid['8']+$uuVilid['10']);
$quart = ($totalR / 4);
*/
@@ -21,11 +21,11 @@
<td align="center">
<?php
if($session->sit == 0) {
/* $MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
/* $MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$uuid = mysql_fetch_array($MyId);
$MyId = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$uuid = mysqli_fetch_array($MyId);
echo "<input type='text' name='T1' size='6' value=".$quart."></td>";
echo "<td align='center'>";
@@ -34,7 +34,7 @@ if($session->sit == 0) {
echo "<input type='text' name='T3' size='6' value=".$quart."></td>";
echo "<td align='center'>";
echo "<input type='text' name='T4' size='6' value=".$quart."></td>";
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-1)." where `id`='".$session->uid."'") or die(mysql_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-1)." where `id`='".$session->uid."'") or die(mysqli_error());
*/
}
?>
+12 -12
View File
@@ -1,28 +1,28 @@
<?php
////////////// made by alq0rsan /////////////////////////
if($session->access != BANNED){
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysql_error());
$uuVilid = mysql_fetch_array($MyVilId);
$MyVilId = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysqli_error());
$uuVilid = mysqli_fetch_array($MyVilId);
$totalT = ($T1+$T2+$T3+$T4);
$totalR = ($uuVilid['6']+$uuVilid['7']+$uuVilid['8']+$uuVilid['10']);
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
$goldlog = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysqli_error());
if($totalT <= $totalR) {
mysql_query("UPDATE ".TB_PREFIX."vdata set wood = '".$T1."' where `wref`='".$village->wid."'") or die(mysql_error());
mysql_query("UPDATE ".TB_PREFIX."vdata set clay = '".$T2."' where `wref`='".$village->wid."'") or die(mysql_error());
mysql_query("UPDATE ".TB_PREFIX."vdata set iron = '".$T3."' where `wref`='".$village->wid."'") or die(mysql_error());
mysql_query("UPDATE ".TB_PREFIX."vdata set crop = '".$T4."' where `wref`='".$village->wid."'") or die(mysql_error());
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-3)." where `id`='".$session->uid."'") or die(mysql_error());
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'trade 1:1')") or die(mysql_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set wood = '".$T1."' where `wref`='".$village->wid."'") or die(mysqli_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set clay = '".$T2."' where `wref`='".$village->wid."'") or die(mysqli_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set iron = '".$T3."' where `wref`='".$village->wid."'") or die(mysqli_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set crop = '".$T4."' where `wref`='".$village->wid."'") or die(mysqli_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-3)." where `id`='".$session->uid."'") or die(mysqli_error());
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysqli_num_rows($goldlog)+1)."', '".$village->wid."', 'trade 1:1')") or die(mysqli_error());
echo "done";
} else {
echo "failed";
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed trade 1:1')") or die(mysql_error());
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysqli_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed trade 1:1')") or die(mysqli_error());
}
+1 -1
View File
@@ -2,7 +2,7 @@
////////////// made by alq0rsan /////////////////////////
if($session->access != BANNED){
if($session->gold >= 100 && $session->sit == 0 && $session->goldclub == 0) {
mysql_query("UPDATE ".TB_PREFIX."users set goldclub = 1, gold = gold - 100 where `id`='".$session->uid."'");
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set goldclub = 1, gold = gold - 100 where `id`='".$session->uid."'");
}
header("Location: plus.php?id=3");
+24 -24
View File
@@ -1,17 +1,17 @@
<?php
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
include("Templates/Plus/pmenu.tpl");
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
$today = date("mdHi");
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($session->gold == 0) {
echo "<p>You currently don't own gold.</p>";
} else {
@@ -60,7 +60,7 @@ $date2=strtotime("NOW");
}else
if ($datetimep <= $date2) {
print "Your PLUS advantage has ended.<br>";
mysql_query("UPDATE ".TB_PREFIX."users set plus = '0' where `id`='".$session->uid."'") or die(mysql_error());
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = '0' where `id`='".$session->uid."'") or die(mysqli_error());
} else {
$holdtotmin=(($datetimep-$date2)/60);
@@ -87,10 +87,10 @@ $holdmr=intval($holdtotmin-(($holdhr*60)+($holdtotday*1440)));
<td class="act">
<?php
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 9 && $datetimep < $date2) {
echo '
<a href="plus.php?id=8"><span>Activate';
@@ -151,7 +151,7 @@ echo "<b> ".($holdmr1). "</b> mins</font> ";
<?php
if ($session->access != BANNED){
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 4 && $tl_b1 < $date2) {
echo '<a href="plus.php?id=9"><span>Activate';
}elseif
@@ -161,7 +161,7 @@ if (mysql_num_rows($MyGold)) {
echo '<a href="plus.php?s=1"><span class="none">too little gold';}
}
} else {
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 4 && $tl_b1 < $date2) {
echo '<a href="banned.php"><span>Activate';
}elseif
@@ -217,7 +217,7 @@ echo "<b> ".($holdmr2). "</b> mins<font>";
<?php
if ($session->access != BANNED){
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 4 && $tl_b2 < $date2) {
echo '<a href="plus.php?id=10"><span>Activate';
}elseif
@@ -227,7 +227,7 @@ if (mysql_num_rows($MyGold)) {
echo '<a href="plus.php?s=1"><span class="none">too little gold</span></a></td>';}
}
} else {
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 4 && $tl_b2 < $date2) {
echo '<a href="banned.php"><span>Activate';
}elseif
@@ -281,7 +281,7 @@ echo "<b> ".($holdmr3). "</b> mins</font>";
<?php
if ($session->access != BANNED){
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 4 && $tl_b3 < $date2) {
echo '<a href="plus.php?id=11"><span>Activate';
}elseif
@@ -291,7 +291,7 @@ if (mysql_num_rows($MyGold)) {
echo '<a href="plus.php?s=1"><span class="none">too little gold';}
}
} else {
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 4 && $tl_b3 < $date2) {
echo '<a href="banned.php"><span>Activate';
}elseif
@@ -343,7 +343,7 @@ echo "<b> ".($holdmr4). "</b> mins</font>";
<td <span class="none">
<?php
if ($session->access != BANNED){
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 4 && $tl_b4 < $date2) {
echo '<a href="plus.php?id=12"><span>Activate';
}elseif
@@ -353,7 +353,7 @@ if (mysql_num_rows($MyGold)) {
echo '<a href="plus.php?s=1"><span class="none">too little gold';}
}
} else {
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 4 && $tl_b4 < $date2) {
echo '<a href="banned.php"><span>Activate';
}elseif
@@ -380,7 +380,7 @@ if (mysql_num_rows($MyGold)) {
<?php
if ($session->access != BANNED){
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 1) {
echo '
<a href="plus.php?id=7"><span>On';
@@ -389,7 +389,7 @@ if (mysql_num_rows($MyGold)) {
}
}
} else {
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 1) {
echo '
<a href="banned.php"><span>On';
@@ -412,7 +412,7 @@ if (mysql_num_rows($MyGold)) {
<?php
if ($session->access != BANNED){
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 2) {
echo ' <a href="build.php?gid=17&t=3"><span>NPC';
} else {
@@ -420,7 +420,7 @@ if (mysql_num_rows($MyGold)) {
}
}
} else {
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['gold'] > 2) {
echo ' <a href="banned.php"><span>NPC';
} else {
@@ -464,10 +464,10 @@ if (mysql_num_rows($MyGold)) {
<td class="act">
<?php
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
if (mysql_num_rows($MyGold)) {
if (mysqli_num_rows($MyGold)) {
if($golds['goldclub']==0){
if($golds['gold'] > 99) {
echo '
+24 -51
View File
@@ -1,56 +1,29 @@
<?php
////////////// made by alq0rsan /////////////////////////
////////////// made by alq0rsan, improved by evader /////////////////////////
if($session->access != BANNED && $session->gold >= 10){
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$uuid = mysql_fetch_array($MyId);
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
$uuVilid = mysql_fetch_array($MyVilId);
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
$today = date("mdHi");
if($session->sit == 0) {
if (mysql_num_rows($MyGold)) {
if($golds['6'] > 2) {
if (mysql_num_rows($MyGold)) {
if($golds['12'] == 0) {
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+".PLUS_TIME." where `id`='".$session->uid."'") or die(mysql_error());
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
if($session->sit == 0) {
if (mysqli_num_rows($MyGold) == 1) {
if($golds['gold'] >= 10) {
if($golds['plus'] == 0) {
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+".PLUS_TIME." where `id`='".$session->uid."'") or die(mysqli_error());
} else {
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = '".($golds['plus']+PLUS_TIME)."' where `id`='".$session->uid."'") or die(mysqli_error());
}
$done1 = "&nbsp;&nbsp;Plus Account";
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-10)." where `id`='".$session->uid."'") or die(mysqli_error());
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Plus Account')") or die(mysqli_error());
} else {
$done1 = "&nbsp;&nbsp;You need more gold";
}
} else {
$done1 = "Failed plus attempt";
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed Plus Account')") or die(mysqli_error());
}
}
header("Location: plus.php?id=3");
} else {
mysql_query("UPDATE ".TB_PREFIX."users set plus = '".($golds['12']+PLUS_TIME)."' where `id`='".$session->uid."'") or die(mysql_error());
}
$done1 = "&nbsp;&nbsp;Plus Account";
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-10)." where `id`='".$session->uid."'") or die(mysql_error());
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'Plus Account')") or die(mysql_error());
} else {
$done1 = "nothing has been done";
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed Plus Account')") or die(mysql_error());
}
} else {
$done1 = "&nbsp;&nbsp;You need more gold";
}
}
}
header("Location: plus.php?id=3");
}else{
header("Location: banned.php");
header("Location: banned.php");
}
?>
+26 -52
View File
@@ -1,55 +1,29 @@
<?php
////////////// made by alq0rsan /////////////////////////
if($session->access != BANNED){
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$uuid = mysql_fetch_array($MyId);
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
$uuVilid = mysql_fetch_array($MyVilId);
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
$today = date("mdHi");
if($session->sit == 0) {
if (mysql_num_rows($MyGold)) {
if($golds['6'] > 2) {
if (mysql_num_rows($MyGold)) {
if($golds['b1'] < time()) {
mysql_query("UPDATE ".TB_PREFIX."users set b1 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
////////////// made by alq0rsan, improved by evader /////////////////////////
if($session->access != BANNED && $session->gold >= 5){
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
if($session->sit == 0) {
if (mysqli_num_rows($MyGold) == 1) {
if($golds['gold'] >= 5) {
if($golds['b1'] < time()) {
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b1 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
} else {
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b1 = '".($golds['b1']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
}
$done1 = "+25% Production: Lumber";
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error());
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Lumber')") or die(mysqli_error());
} else {
$done1 = "You need more gold";
}
} else {
$done1 = "Failed lumber attempt";
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Lumber')") or die(mysqli_error());
}
}
header("Location: plus.php?id=3");
} else {
mysql_query("UPDATE ".TB_PREFIX."users set b1 = '".($golds['b1']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
header("Location: banned.php");
}
$done1 = "+25% Production: Lumber";
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysql_error());
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', '+25% Production: Lumber')") or die(mysql_error());
} else {
$done1 = "nothing has been done";
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed +25% Production: Lumber')") or die(mysql_error());
}
} else {
$done1 = "You need more gold";
}
}
}
header("Location: plus.php?id=3");
}else{
header("Location: banned.php");
}
?>
?>
+11 -11
View File
@@ -32,8 +32,8 @@ echo <<<EOT
EOT;
}else{
$account = mysql_real_escape_string($_POST['username']);
$reward = mysql_real_escape_string($_POST['reward']);
$account = mysqli_real_escape_string($GLOBALS['link'],$_POST['username']);
$reward = mysqli_real_escape_string($GLOBALS['link'],$_POST['reward']);
$valid=TRUE;
@@ -50,8 +50,8 @@ EOT;
$plusTime = 604800; // 7 days
$time = time();
$giveplus = ($time + $plustime);
$accountCheck = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
if(mysql_num_rows($accountCheck) <= 0){
$accountCheck = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
if(mysqli_num_rows($accountCheck) <= 0){
echo "<b>ERROR:</b><br />";
echo "The account name you entered does not exist.";
echo "<br /><br /><input type=\"button\" value=\"Back\" onclick=\"history.go(-1)\">";
@@ -59,10 +59,10 @@ EOT;
}
if(!$valid) break;
$valid=TRUE;
$acc = mysql_fetch_array($accountCheck);
$acc = mysqli_fetch_array($accountCheck);
$plusCheck = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$pluss = mysql_fetch_array($plusCheck);
$plusCheck = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$pluss = mysqli_fetch_array($plusCheck);
switch($reward){
case 'p_plus':
@@ -101,19 +101,19 @@ echo' Please select the option you wish to activate or extend.<br>';
if(mysql_num_rows($plusCheck) > 0){
if(mysqli_num_rows($plusCheck) > 0){
if($time > $pluss[$key] ){
$editplus = mysql_query("UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` + ('".$time."'+'".$plusTime."'), `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysql_error());
$editplus = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` + ('".$time."'+'".$plusTime."'), `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysqli_error());
echo "<META HTTP-EQUIV=Refresh CONTENT=\"2; {$url}\" ><br /><br /><div align=center><font color=green size=4><b> Your Status has been updated!</b></font></div>";
}else
if($time < $pluss[$key]){
$editplus = mysql_query("UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` +'".$plusTime."', `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysql_error());
$editplus = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` +'".$plusTime."', `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysqli_error());
echo "<META HTTP-EQUIV=Refresh CONTENT=\"2; {$url}\" ><br /><br /><div align=center><font color=green size=4><b> Your Status has been updated!</b></font></div>";
}
}
else{
$insertplus = mysql_query("INSERT INTO ".TB_PREFIX."users (`username`,`{$key}`, `gold`) VALUES ('".$session->username."', ('".$time."'+'".$plusTime."'),`gold` - {$gldz})") or die(mysql_error());
$insertplus = mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."users (`username`,`{$key}`, `gold`) VALUES ('".$session->username."', ('".$time."'+'".$plusTime."'),`gold` - {$gldz})") or die(mysqli_error());
echo "<META HTTP-EQUIV=Refresh CONTENT=\"3; {$url})\" ><br /><br /><div align=center><font color=green size=4><b> Your Status has been updated!</b></font></div>";
}
}
+13 -13
View File
@@ -25,22 +25,22 @@ if($_POST) {
foreach($_POST as $key => $value) {
if(substr($key, 0, 2) == 'nr') {
$i = substr($key, 2);
$links[$i]['nr'] = mysql_real_escape_string($value);
$links[$i]['nr'] = mysqli_real_escape_string($GLOBALS['link'],$value);
}
if(substr($key, 0, 2) == 'id') {
$i = substr($key, 2);
$links[$i]['id'] = mysql_real_escape_string($value);
$links[$i]['id'] = mysqli_real_escape_string($GLOBALS['link'],$value);
}
if(substr($key, 0, 8) == 'linkname') {
$i = substr($key, 8);
$links[$i]['linkname'] = mysql_real_escape_string($value);
$links[$i]['linkname'] = mysqli_real_escape_string($GLOBALS['link'],$value);
}
if(substr($key, 0, 8) == 'linkziel') {
$i = substr($key, 8);
$links[$i]['linkziel'] = mysql_real_escape_string($value);
$links[$i]['linkziel'] = mysqli_real_escape_string($GLOBALS['link'],$value);
}
}
@@ -52,27 +52,27 @@ if($_POST) {
// Add new link
$userid = $session->uid;
if($session->access!=BANNED){
$query = mysql_query('INSERT INTO `' . TB_PREFIX . 'links` (`userid`, `name`, `url`, `pos`) VALUES (' . $userid . ', \'' . $link['linkname'] . '\', \'' . $link['linkziel'] . '\', ' . $link['nr'] . ')');
$query = mysqli_query($GLOBALS['link'],'INSERT INTO `' . TB_PREFIX . 'links` (`userid`, `name`, `url`, `pos`) VALUES (' . $userid . ', \'' . $link['linkname'] . '\', \'' . $link['linkziel'] . '\', ' . $link['nr'] . ')');
}else{
header("Location: banned.php");
}
} elseif(trim($link['nr']) != '' AND trim($link['linkname']) != '' AND trim($link['linkziel']) != '' AND trim($link['id']) != '') {
// Update link
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
$data = mysql_fetch_assoc($query);
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
$data = mysqli_fetch_assoc($query);
// May the user update this entry?
if($data['userid'] == $session->uid) {
$query2 = mysql_query('UPDATE `' . TB_PREFIX . 'links` SET `name` = \'' . $link['linkname'] . '\', `url` = \'' . $link['linkziel'] . '\', `pos` = ' . $link['nr'] . ' WHERE `id` = ' . $link['id']);
$query2 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'links` SET `name` = \'' . $link['linkname'] . '\', `url` = \'' . $link['linkziel'] . '\', `pos` = ' . $link['nr'] . ' WHERE `id` = ' . $link['id']);
}
} elseif(trim($link['nr']) == '' AND trim($link['linkname']) == '' AND trim($link['linkziel']) == '' AND trim($link['id']) != '') {
// Delete entry
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
$data = mysql_fetch_assoc($query);
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
$data = mysqli_fetch_assoc($query);
// May the user delete this entry?
if($data['userid'] == $session->uid) {
$query2 = mysql_query('DELETE FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
$query2 = mysqli_query($GLOBALS['link'],'DELETE FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
}
}
}
@@ -82,9 +82,9 @@ if($_POST) {
// Fetch all links
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'links` WHERE `userid` = ' . $session->uid . ' ORDER BY `pos` ASC') or die(mysql_error());
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `userid` = ' . $session->uid . ' ORDER BY `pos` ASC') or die(mysqli_error());
$links = array();
while($data = mysql_fetch_assoc($query)) {
while($data = mysqli_fetch_assoc($query)) {
$links[] = $data;
}
?>
+20 -29
View File
@@ -1,21 +1,12 @@
<?php
$place = $place1 = $place2 = $place3 = "?";
$db_host=SQL_SERVER; $db_user=SQL_USER; $db_pass=SQL_PASS; $db_name=SQL_DB;
$place = $place1 = $place2 = $place3 = "?";
$con = mysql_connect($db_host, $db_user, $db_pass);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
for($i=1;$i<=0;$i++) {
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
mysql_select_db($db_name, $con);
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY ap DESC, id DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY ap DESC, id DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1">
<thead>
@@ -39,7 +30,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['id']==$session->alliance) {
$place = $i;
@@ -56,7 +47,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->alliance) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -75,8 +66,8 @@
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY dp DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY dp DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY dp DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY dp DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1" id="top10_defs" class="top10 row_table_data">
<thead>
@@ -93,7 +84,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['id']==$session->alliance) {
$place1 = $i;
@@ -111,7 +102,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->alliance) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -129,8 +120,8 @@
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY clp DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY clp DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY clp DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY clp DESC Limit 1");
?>
<div class="clear"></div>
<table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
@@ -148,7 +139,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['id']==$session->alliance) {
$place2 = $i;
@@ -165,7 +156,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->alliance) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -182,8 +173,8 @@
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY RR DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY RR DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY RR DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY RR DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">
<thead>
@@ -200,7 +191,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['RR'] >= 0) {
if($row['id']==$session->alliance) {
@@ -219,7 +210,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->alliance) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -230,7 +221,7 @@
echo "</tr>";
}
mysql_close($con);
mysqli_close($con);
?>
</tbody>
</table>
+7 -7
View File
@@ -9,11 +9,11 @@
| Copyright: TravianX Project All rights reserved |
\** --------------------------------------------------- **/
$tribe1 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 1");
$tribe2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 2");
$tribe3 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 3");
$tribes = array(mysql_num_rows($tribe1), mysql_num_rows($tribe2), mysql_num_rows($tribe3));
$users = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5")); ?>
$tribe1 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 1");
$tribe2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 2");
$tribe3 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 3");
$tribes = array(mysqli_num_rows($tribe1), mysqli_num_rows($tribe2), mysqli_num_rows($tribe3));
$users = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5")); ?>
<table cellpadding="1" cellspacing="1" id="world_player" class="world">
<thead>
@@ -34,7 +34,7 @@
<th>Active players</th>
<td><?php
$active = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (3600*24) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
$active = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (3600*24) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
echo $active; ?></td>
</tr>
@@ -42,7 +42,7 @@
<th>Players online</th>
<td><?php
$online = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
$online = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
echo $online; ?></td>
</tr>
</tbody>
+17 -25
View File
@@ -1,21 +1,13 @@
<?php
$place = $place1 = $place2 = $place3 = "?";
//$db_host=SQL_SERVER; $db_user=SQL_USER; $db_pass=SQL_PASS; $db_name=SQL_DB;
//$con = mysql_connect($db_host, $db_user, $db_pass);
//if (!$con)
// {
// die('Could not connect: ' . mysql_error());
// }
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
//mysql_select_db($db_name, $con);
$result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY ap DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY ap DESC, id DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY ap DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY ap DESC, id DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1">
<thead>
@@ -39,7 +31,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['id']==$session->uid) {
if($row['id']==$session->uid) {
@@ -56,7 +48,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->uid) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -75,8 +67,8 @@
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY dp DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY dp DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY dp DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY dp DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1" id="top10_defs" class="top10 row_table_data">
<thead>
@@ -93,7 +85,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['id']==$session->uid) {
$place1 = $i;
@@ -111,7 +103,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->uid) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -129,8 +121,8 @@
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY clp DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY clp DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY clp DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY clp DESC Limit 1");
?>
<div class="clear"></div>
<table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
@@ -148,7 +140,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['id']==$session->uid) {
$place2 = $i;
@@ -165,7 +157,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->uid) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -181,8 +173,8 @@
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY RR DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY RR DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY RR DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY RR DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">
<thead>
@@ -199,7 +191,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['RR'] >= 0) {
if($row['id']==$session->uid) {
@@ -218,7 +210,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id']==$session->uid) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -229,7 +221,7 @@
echo "</tr>";
}
// mysql_close($con);
// mysqli_close($con);
?>
</tbody>
</table>
+4 -4
View File
@@ -1,7 +1,7 @@
<?php
if (WW == True)
{
$result = mysql_query("select " . TB_PREFIX . "users.id, " . TB_PREFIX . "users.username," . TB_PREFIX . "users.alliance, " . TB_PREFIX . "fdata.wwname, " . TB_PREFIX . "fdata.f99, " . TB_PREFIX . "vdata.name, " . TB_PREFIX . "fdata.vref
$result = mysqli_query($GLOBALS['link'],"select " . TB_PREFIX . "users.id, " . TB_PREFIX . "users.username," . TB_PREFIX . "users.alliance, " . TB_PREFIX . "fdata.wwname, " . TB_PREFIX . "fdata.f99, " . TB_PREFIX . "vdata.name, " . TB_PREFIX . "fdata.vref
FROM " . TB_PREFIX . "users
INNER JOIN " . TB_PREFIX . "vdata ON " . TB_PREFIX . "users.id = " . TB_PREFIX . "vdata.owner
INNER JOIN " . TB_PREFIX . "fdata ON " . TB_PREFIX . "fdata.vref = " . TB_PREFIX . "vdata.wref
@@ -24,11 +24,11 @@ if (WW == True)
<tbody>
<?php
$cont = 1;
while ($row = mysql_fetch_array($result))
while ($row = mysqli_fetch_array($result))
{
$ally = $database->getAlliance($row[alliance]);
$query = @mysql_query('SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vref'] . ' ORDER BY `attack_time` ASC LIMIT 1');
$row2 = @mysql_fetch_assoc($query);
$query = @mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vref'] . ' ORDER BY `attack_time` ASC LIMIT 1');
$row2 = @mysqli_fetch_assoc($query);
?>
<tr>
<td><?php echo $cont; $cont++; ?>.</td>
+2 -2
View File
@@ -363,8 +363,8 @@ $end = ($tribe*10);
{
//$uid
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = $uid";
$result = mysql_query($q);
$hero_f=mysql_fetch_array($result);
$result = mysqli_query($GLOBALS['link'],$q);
$hero_f=mysqli_fetch_array($result);
$hero_unit=$hero_f['unit'];
$speeds[] = ${'u'.$hero_unit}['speed'];
}
+2 -2
View File
@@ -138,8 +138,8 @@ $tocoor = $database->getCoor($enforce['vref']);
}
if ($enforce['hero']>0){
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
$resulth = mysql_query($qh);
$hero_f=mysql_fetch_array($resulth);
$resulth = mysqli_query($GLOBALS['link'],$qh);
$hero_f=mysqli_fetch_array($resulth);
$hero_unit=$hero_f['unit'];
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
}
+2 -2
View File
@@ -139,8 +139,8 @@ $tocoor = $database->getCoor($enforce['vref']);
}
if ($enforce['hero']>0){
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
$resulth = mysql_query($qh);
$hero_f=mysql_fetch_array($resulth);
$resulth = mysqli_query($GLOBALS['link'],$qh);
$hero_f=mysqli_fetch_array($resulth);
$hero_unit=$hero_f['unit'];
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
}
+2 -2
View File
@@ -138,8 +138,8 @@ $tocoor = $database->getCoor($enforce['vref']);
}
if ($enforce['hero']>0){
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
$resulth = mysql_query($qh);
$hero_f=mysql_fetch_array($resulth);
$resulth = mysqli_query($GLOBALS['link'],$qh);
$hero_f=mysqli_fetch_array($resulth);
$hero_unit=$hero_f['unit'];
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
}
+2 -2
View File
@@ -139,8 +139,8 @@ $tocoor = $database->getCoor($enforce['vref']);
}
if ($enforce['hero']>0){
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
$resulth = mysql_query($qh);
$hero_f=mysql_fetch_array($resulth);
$resulth = mysqli_query($GLOBALS['link'],$qh);
$hero_f=mysqli_fetch_array($resulth);
$hero_unit=$hero_f['unit'];
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
}
+2 -2
View File
@@ -138,8 +138,8 @@ $tocoor = $database->getCoor($enforce['vref']);
}
if ($enforce['hero']>0){
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
$resulth = mysql_query($qh);
$hero_f=mysql_fetch_array($resulth);
$resulth = mysqli_query($GLOBALS['link'],$qh);
$hero_f=mysqli_fetch_array($resulth);
$hero_unit=$hero_f['unit'];
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
}
+1 -1
View File
@@ -7,7 +7,7 @@
$sql = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$lid." order by id asc";
$array = $database->query_return($sql);
foreach($array as $row){
$sql1 = mysql_fetch_array(mysql_query("SELECT * FROM ".TB_PREFIX."units WHERE vref = ".$getFLData['wref']));
$sql1 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."units WHERE vref = ".$getFLData['wref']));
$sid = $row['id'];
$wref = $row['towref'];
$t1 = $row['t1'];$t2 = $row['t2'];$t3 = $row['t3'];$t4 = $row['t4'];$t5 = $row['t5'];
+15 -15
View File
@@ -8,9 +8,9 @@ if(isset($_GET['t'])==99 && isset($_POST['action'])=='addList' && $_POST['did']!
header("Location: build.php?gid=16&t=99&action=addList");
}
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY wref = $village->wid DESC");
$query = mysql_num_rows($sql);
while($row = mysql_fetch_array($sql)){
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY wref = $village->wid DESC");
$query = mysqli_num_rows($sql);
while($row = mysqli_fetch_array($sql)){
$lid = $row["id"];
$lname = $row["name"];
$lowner = $row["owner"];
@@ -50,12 +50,12 @@ while($row = mysql_fetch_array($sql)){
<tbody>
<?php
$sql2 = mysql_query("SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $lid ORDER BY distance ASC");
$query2 = mysql_num_rows($sql2);
$sql2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $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>';
}else{
while($row = mysql_fetch_array($sql2)){
while($row = mysqli_fetch_array($sql2)){
$id= $row['id'];$lid = $row['lid'];$towref = $row['towref'];$x = $row['x'];$y = $row['y'];
if($village->wid == $towref){
$distance = '0';
@@ -192,9 +192,9 @@ $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 = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limits AND toWref = ".$towref." AND uid = ".$session->uid." ORDER BY time DESC Limit 1");
if(mysql_num_rows($getnotice) > 0){
while($row2 = mysql_fetch_array($getnotice)){
$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");
if(mysqli_num_rows($getnotice) > 0){
while($row2 = mysqli_fetch_array($getnotice)){
$dataarray = explode(",",$row2['data']);
$type2 = $row2['ntype'];
echo "<img src=\"img/x.gif\" class=\"iReport iReport".$row2['ntype']."\" title=\"".$noticeClass[$type2]."\"> ";
@@ -313,10 +313,10 @@ if(!$database->getVilFarmlist($village->wid)){
{
Travian.Game.RaidList.setData({
<?php
$result = mysql_query('SELECT * FROM '.TB_PREFIX.'farmlist WHERE wref = '.$village->wid.'');
$query1 = mysql_num_rows($result);
$result = mysqli_query($GLOBALS['link'],'SELECT * FROM '.TB_PREFIX.'farmlist WHERE wref = '.$village->wid.'');
$query1 = mysqli_num_rows($result);
$NUM1 = 1;
while($row = mysql_fetch_array($result)){
while($row = mysqli_fetch_array($result)){
$lid = $row['id'];
?>
@@ -324,10 +324,10 @@ $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 = mysql_query('SELECT * FROM '.TB_PREFIX.'raidlist WHERE lid = '.$lid.'');
$query2 = mysql_num_rows($result3);
$result3 = mysqli_query($GLOBALS['link'],'SELECT * FROM '.TB_PREFIX.'raidlist WHERE lid = '.$lid.'');
$query2 = mysqli_num_rows($result3);
$NUM2 = 1;
while($row3 = mysql_fetch_array($result3)){
while($row3 = mysqli_fetch_array($result3)){
$id = $row3['id'];
$t1 = $row3['t1'];$t2 = $row3['t2'];$t3 = $row3['t3'];$t4 = $row3['t4'];$t5 = $row3['t5'];$t6 = $row3['t6'];$t7 = $row3['t7'];
$t8 = $row3['t8'];$t9 = $row3['t9'];$t10 = $row3['t10'];
+3 -3
View File
@@ -85,8 +85,8 @@ $vdata = $database->getVillage($Wref);
<select name="lid">
<?php
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
while($row = mysql_fetch_array($sql)){
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
while($row = mysqli_fetch_array($sql)){
$lid = $row["id"];
$lname = $row["name"];
$lowner = $row["owner"];
@@ -123,7 +123,7 @@ $lvname = $database->getVillageField($row["wref"], 'name');
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$_GET['lid']."";
$arraywref = $database->query_return($getwref);
echo '<option value="">Select village</option>';
if(mysql_num_rows(mysql_query($getwref)) != 0){
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],$getwref)) != 0){
foreach($arraywref as $row){
$towref = $row["towref"];
$tocoor = $database->getCoor($towref);
+3 -3
View File
@@ -92,8 +92,8 @@ $lid2 = $getlid['lid'];
<td>
<select onchange="getTargetsByLid();" id="lid" name="lid">
<?php
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
while($row = mysql_fetch_array($sql)){
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
while($row = mysqli_fetch_array($sql)){
$lid = $row["id"];
$lname = $row["name"];
$lowner = $row["owner"];
@@ -129,7 +129,7 @@ $lvname = $database->getVillageField($row["wref"], 'name');
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $lid2";
$arraywref = $database->query_return($getwref);
echo '<option value="">Select village</option>';
if(mysql_num_rows(mysql_query($getwref)) != 0){
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],$getwref)) != 0){
foreach($arraywref as $row){
$towref = $row["towref"];
$tocoor = $database->getCoor($towref);
+3 -3
View File
@@ -10,10 +10,10 @@
#################################################################################
// Fetch all links
$query = $database->getLinks($session->uid);
if (mysql_num_rows($query) > 0){
$query = $database->getLinks($session->uid);
if (mysqli_num_rows($query) > 0){
$links = array();
while($data = mysql_fetch_assoc($query)) {
while($data = mysqli_fetch_assoc($query)) {
$links[] = $data;
}
+2 -2
View File
@@ -1,4 +1,4 @@
<?php
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
@@ -10,7 +10,7 @@
#################################################################################
$txt="";
$txt="Testing system message";
//bbcode = html code
$txt = preg_replace("/\[b\]/is",'<b>', $txt);