mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-03 00:47:19 +00:00
@@ -12,8 +12,8 @@
|
|||||||
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
||||||
include("../GameEngine/config.php");
|
include("../GameEngine/config.php");
|
||||||
$id = $_SESSION['id'];
|
$id = $_SESSION['id'];
|
||||||
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."allimedal");
|
$sql = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."allimedal"), MYSQLI_ASSOC);
|
||||||
$nummedals = mysqli_num_rows($sql);
|
$nummedals = $sql['Total'];
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
@@ -36,8 +36,8 @@ $nummedals = mysqli_num_rows($sql);
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."allimedal");
|
$sql = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."allimedal"), MYSQLI_ASSOC);
|
||||||
$tot = mysqli_num_rows($sql);
|
$tot = $sql['Total'];
|
||||||
$sql = mysqli_query($GLOBALS["link"], "SELECT week FROM ".TB_PREFIX."allimedal ORDER BY week DESC LIMIT 1");
|
$sql = mysqli_query($GLOBALS["link"], "SELECT week FROM ".TB_PREFIX."allimedal ORDER BY week DESC LIMIT 1");
|
||||||
if(mysqli_num_rows($sql) > 0){
|
if(mysqli_num_rows($sql) > 0){
|
||||||
$week = mysqli_result($sql, 0);
|
$week = mysqli_result($sql, 0);
|
||||||
@@ -75,8 +75,8 @@ $nummedals = mysqli_num_rows($sql);
|
|||||||
for($j = 0; $j<$week; $j++)
|
for($j = 0; $j<$week; $j++)
|
||||||
{
|
{
|
||||||
$newweek = $j+1;
|
$newweek = $j+1;
|
||||||
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."allimedal WHERE week = $newweek");
|
$sql = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."allimedal WHERE week = $newweek"), MYSQLI_ASSOC);
|
||||||
$tot = mysqli_num_rows($sql);
|
$tot = $sql['Total'];
|
||||||
echo "<tr>
|
echo "<tr>
|
||||||
<td>$newweek</td>
|
<td>$newweek</td>
|
||||||
<td>$tot</td>
|
<td>$tot</td>
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
|||||||
include("../GameEngine/config.php");
|
include("../GameEngine/config.php");
|
||||||
$id = $_SESSION['id'];
|
$id = $_SESSION['id'];
|
||||||
|
|
||||||
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."medal");
|
$sql = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."medal"), MYSQLI_ASSOC);
|
||||||
$nummedals = mysqli_num_rows($sql);
|
$nummedals = $sql['Total'];
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
@@ -37,8 +37,8 @@ $nummedals = mysqli_num_rows($sql);
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."medal");
|
$sql = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."medal"), MYSQLI_ASSOC);
|
||||||
$tot = mysqli_num_rows($sql);
|
$tot = $sql['Total'];
|
||||||
$sql = mysqli_query($GLOBALS["link"], "SELECT week FROM ".TB_PREFIX."medal ORDER BY week DESC LIMIT 1");
|
$sql = mysqli_query($GLOBALS["link"], "SELECT week FROM ".TB_PREFIX."medal ORDER BY week DESC LIMIT 1");
|
||||||
if(mysqli_num_rows($sql) > 0){
|
if(mysqli_num_rows($sql) > 0){
|
||||||
$week = mysqli_result($sql, 0);
|
$week = mysqli_result($sql, 0);
|
||||||
@@ -77,8 +77,8 @@ $nummedals = mysqli_num_rows($sql);
|
|||||||
{
|
{
|
||||||
$newweek = $j+1;
|
$newweek = $j+1;
|
||||||
|
|
||||||
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."medal WHERE week = $newweek");
|
$sql = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."medal WHERE week = $newweek"), MYSQLI_ASSOC);
|
||||||
$tot = mysqli_num_rows($sql);
|
$tot = $sql['Total'];
|
||||||
|
|
||||||
echo "<tr><td>$newweek</td><td>$tot</td><td><input type=\"image\" name=\"medalweek\" value=\"".$newweek."\" style=\"background-image: url('../gpack/travian_default/img/a/del.gif'); height: 12px; width: 12px;\" src=\"../gpack/travian_default/img/a/x.gif\"></td>";
|
echo "<tr><td>$newweek</td><td>$tot</td><td><input type=\"image\" name=\"medalweek\" value=\"".$newweek."\" style=\"background-image: url('../gpack/travian_default/img/a/del.gif'); height: 12px; width: 12px;\" src=\"../gpack/travian_default/img/a/x.gif\"></td>";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ $sessionaccess = $access['access'];
|
|||||||
|
|
||||||
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
|
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
|
||||||
|
|
||||||
$users = mysqli_num_rows(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users"));
|
$users = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."users"), MYSQLI_ASSOC);
|
||||||
|
$users = $users['Total'];
|
||||||
|
|
||||||
$reason = $_POST['unbanreason'];
|
$reason = $_POST['unbanreason'];
|
||||||
$admin = $session;
|
$admin = $session;
|
||||||
|
|||||||
@@ -318,13 +318,14 @@ class adm_DB {
|
|||||||
function DelVillage($wref, $mode=0){
|
function DelVillage($wref, $mode=0){
|
||||||
global $database;
|
global $database;
|
||||||
$wref = (int) $wref;
|
$wref = (int) $wref;
|
||||||
if($mode==0){
|
if ($mode==0) {
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `wref` = $wref and capital = 0";
|
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."vdata WHERE `wref` = $wref and capital = 0";
|
||||||
}else{
|
} else {
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
|
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
|
||||||
}
|
}
|
||||||
$result = mysqli_query($this->connection, $q);
|
|
||||||
if(mysqli_num_rows($result) > 0){
|
$result = mysqli_fetch_array(mysqli_query($this->connection, $q), MYSQLI_ASSOC);
|
||||||
|
if($result['Total'] > 0){
|
||||||
mysqli_query($this->connection,"Insert into ".TB_PREFIX."admin_log values (0,".(int) $_SESSION['id'].",'Deleted village <b>$wref</b>',".time().")");
|
mysqli_query($this->connection,"Insert into ".TB_PREFIX."admin_log values (0,".(int) $_SESSION['id'].",'Deleted village <b>$wref</b>',".time().")");
|
||||||
|
|
||||||
$database->clearExpansionSlot($wref);
|
$database->clearExpansionSlot($wref);
|
||||||
|
|||||||
@@ -30,14 +30,12 @@ class Automation {
|
|||||||
private $bountyOpop = 1;
|
private $bountyOpop = 1;
|
||||||
|
|
||||||
public function isWinner() {
|
public function isWinner() {
|
||||||
$q = mysqli_query($GLOBALS['link'],"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
|
// check whether someone already built a level 100 Wonder of the World
|
||||||
$isThere = mysqli_num_rows($q);
|
$q = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."fdata WHERE f99 = 100 and f99t = 40"), MYSQLI_ASSOC);
|
||||||
if($isThere > 0)
|
if($q['Total'] > 0)
|
||||||
{
|
{
|
||||||
header('Location: winner.php');
|
header('Location: winner.php');
|
||||||
exit;
|
exit;
|
||||||
}else{
|
|
||||||
## there is no winner
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+61
-60
@@ -652,9 +652,9 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
function checkactiveSession($username, $sessid) {
|
function checkactiveSession($username, $sessid) {
|
||||||
list($username, $sessid) = $this->escape_input($username, $sessid);
|
list($username, $sessid) = $this->escape_input($username, $sessid);
|
||||||
|
|
||||||
$q = "SELECT username FROM " . TB_PREFIX . "users where username = '$username' and sessid = '$sessid' LIMIT 1";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "users where username = '$username' and sessid = '$sessid' LIMIT 1";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows($result) != 0) {
|
if($result['Total'] > 0) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -1208,9 +1208,9 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
function CheckForum($id) {
|
function CheckForum($id) {
|
||||||
list($id) = $this->escape_input((int) $id);
|
list($id) = $this->escape_input((int) $id);
|
||||||
|
|
||||||
$q = "SELECT * from " . TB_PREFIX . "forum_cat where alliance = '$id'";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "forum_cat where alliance = $id";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows($result)) {
|
if ($result['Total']) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -1237,9 +1237,9 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
function CheckLastTopic($id) {
|
function CheckLastTopic($id) {
|
||||||
list($id) = $this->escape_input($id);
|
list($id) = $this->escape_input($id);
|
||||||
|
|
||||||
$q = "SELECT * from " . TB_PREFIX . "forum_topic where cat = '$id'";
|
$q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_topic where cat = $id";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows($result)) {
|
if($result['Total']) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -1249,9 +1249,9 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
function CheckLastPost($id) {
|
function CheckLastPost($id) {
|
||||||
list($id) = $this->escape_input($id);
|
list($id) = $this->escape_input($id);
|
||||||
|
|
||||||
$q = "SELECT * from " . TB_PREFIX . "forum_post where topic = '$id'";
|
$q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_post where topic = $id";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows($result)) {
|
if ($result['Total']) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -1325,9 +1325,9 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
function CheckCatTopic($id) {
|
function CheckCatTopic($id) {
|
||||||
list($id) = $this->escape_input($id);
|
list($id) = $this->escape_input($id);
|
||||||
|
|
||||||
$q = "SELECT * from " . TB_PREFIX . "forum_topic where cat = '$id'";
|
$q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_topic where cat = $id";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows($result)) {
|
if ($result['Total']) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -1337,9 +1337,9 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
function CheckResultEdit($alli) {
|
function CheckResultEdit($alli) {
|
||||||
list($alli) = $this->escape_input($alli);
|
list($alli) = $this->escape_input($alli);
|
||||||
|
|
||||||
$q = "SELECT * from " . TB_PREFIX . "forum_edit where alliance = '$alli'";
|
$q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_edit where alliance = $alli";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows($result)) {
|
if ($result['Total']) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -1409,9 +1409,9 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
function checkVilExist($wref) {
|
function checkVilExist($wref) {
|
||||||
list($wref) = $this->escape_input((int) $wref);
|
list($wref) = $this->escape_input((int) $wref);
|
||||||
|
|
||||||
$q = "SELECT * FROM " . TB_PREFIX . "vdata where wref = '$wref'";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "vdata where wref = '$wref'";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows($result)) {
|
if ($result['Total']) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -1421,9 +1421,9 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
function checkOasisExist($wref) {
|
function checkOasisExist($wref) {
|
||||||
list($wref) = $this->escape_input((int) $wref);
|
list($wref) = $this->escape_input((int) $wref);
|
||||||
|
|
||||||
$q = "SELECT * FROM " . TB_PREFIX . "odata where wref = '$wref'";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "odata where wref = '$wref'";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows($result)) {
|
if($result['Total']) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -1530,9 +1530,9 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
function checkSurvey($topic) {
|
function checkSurvey($topic) {
|
||||||
list($topic) = $this->escape_input((int) $topic);
|
list($topic) = $this->escape_input((int) $topic);
|
||||||
|
|
||||||
$q = "SELECT * FROM " . TB_PREFIX . "forum_survey where topic = $topic";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "forum_survey where topic = $topic";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows($result)) {
|
if ($result['Total']) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -3293,9 +3293,9 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
function getBuildingByField2($wid,$field) {
|
function getBuildingByField2($wid,$field) {
|
||||||
list($wid,$field) = $this->escape_input((int) $wid,(int) $field);
|
list($wid,$field) = $this->escape_input((int) $wid,(int) $field);
|
||||||
|
|
||||||
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and field = $field and master = 0";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "bdata where wid = $wid and field = $field and master = 0";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
return mysqli_num_rows($result);
|
return $result['Total'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBuildingByType($wid,$type) {
|
function getBuildingByType($wid,$type) {
|
||||||
@@ -3309,9 +3309,9 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
function getBuildingByType2($wid,$type) {
|
function getBuildingByType2($wid,$type) {
|
||||||
list($wid,$type) = $this->escape_input((int) $wid,(int) $type);
|
list($wid,$type) = $this->escape_input((int) $wid,(int) $type);
|
||||||
|
|
||||||
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and type = $type and master = 0";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "bdata where wid = $wid and type = $type and master = 0";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
return mysqli_num_rows($result);
|
return $result['Total'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDorf1Building($wid) {
|
function getDorf1Building($wid) {
|
||||||
@@ -4133,9 +4133,9 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
***************************/
|
***************************/
|
||||||
|
|
||||||
function getWW() {
|
function getWW() {
|
||||||
$q = "SELECT * FROM " . TB_PREFIX . "fdata WHERE f99t = 40";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "fdata WHERE f99t = 40";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows($result)) {
|
if($result['Total']) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@@ -5123,9 +5123,9 @@ References:
|
|||||||
function getHeroDead($id) {
|
function getHeroDead($id) {
|
||||||
list($id) = $this->escape_input((int) $id);
|
list($id) = $this->escape_input((int) $id);
|
||||||
|
|
||||||
$q = "SELECT dead FROM " . TB_PREFIX . "hero WHERE `uid` = $id AND dead = 0";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "hero WHERE `uid` = $id AND dead = 0";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if (mysqli_num_rows($result) > 0) {
|
if ($result['Total'] > 0) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return 1;
|
return 1;
|
||||||
@@ -5140,9 +5140,9 @@ References:
|
|||||||
function getHeroInRevive($id) {
|
function getHeroInRevive($id) {
|
||||||
list($id) = $this->escape_input((int) $id);
|
list($id) = $this->escape_input((int) $id);
|
||||||
|
|
||||||
$q = "SELECT inrevive FROM " . TB_PREFIX . "hero WHERE `uid` = $id AND inrevive = 1";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "hero WHERE `uid` = $id AND inrevive = 1";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if (mysqli_num_rows($result) > 0) {
|
if ($result['Total'] > 0) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -5157,9 +5157,9 @@ References:
|
|||||||
function getHeroInTraining($id) {
|
function getHeroInTraining($id) {
|
||||||
list($id) = $this->escape_input((int) $id);
|
list($id) = $this->escape_input((int) $id);
|
||||||
|
|
||||||
$q = "SELECT intraining FROM " . TB_PREFIX . "hero WHERE `uid` = $id AND intraining = 1";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "hero WHERE `uid` = $id AND intraining = 1";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if (mysqli_num_rows($result) > 0) {
|
if ($result['Total'] > 0) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -5300,15 +5300,16 @@ References:
|
|||||||
***************************/
|
***************************/
|
||||||
|
|
||||||
function checkAttack($wref, $toWref) {
|
function checkAttack($wref, $toWref) {
|
||||||
list($wref, $toWref) = $this->escape_input((int) $wref, (int) $toWref);
|
list($wref, $toWref) = $this->escape_input((int) $wref, (int) $toWref);
|
||||||
$q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and (" . TB_PREFIX . "attacks.attack_type = 3 or " . TB_PREFIX . "attacks.attack_type = 4) ORDER BY endtime ASC";
|
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and (" . TB_PREFIX . "attacks.attack_type = 3 or " . TB_PREFIX . "attacks.attack_type = 4) ORDER BY endtime ASC";
|
||||||
if(mysqli_num_rows($result)) {
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
return true;
|
if ($result['Total']) {
|
||||||
} else {
|
return true;
|
||||||
return false;
|
} else {
|
||||||
}
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/***************************
|
/***************************
|
||||||
Function checkEnforce
|
Function checkEnforce
|
||||||
@@ -5318,9 +5319,9 @@ References:
|
|||||||
function checkEnforce($wref, $toWref) {
|
function checkEnforce($wref, $toWref) {
|
||||||
list($wref, $toWref) = $this->escape_input((int) $wref, (int) $toWref);
|
list($wref, $toWref) = $this->escape_input((int) $wref, (int) $toWref);
|
||||||
|
|
||||||
$q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and " . TB_PREFIX . "attacks.attack_type = 2 ORDER BY endtime ASC";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and " . TB_PREFIX . "attacks.attack_type = 2 ORDER BY endtime ASC";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows($result)) {
|
if($result['Total']) {
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
@@ -5335,9 +5336,9 @@ References:
|
|||||||
function checkScout($wref, $toWref) {
|
function checkScout($wref, $toWref) {
|
||||||
list($wref, $toWref) = $this->escape_input((int) $wref, (int) $toWref);
|
list($wref, $toWref) = $this->escape_input((int) $wref, (int) $toWref);
|
||||||
|
|
||||||
$q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and " . TB_PREFIX . "attacks.attack_type = 1 ORDER BY endtime ASC";
|
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and " . TB_PREFIX . "attacks.attack_type = 1 ORDER BY endtime ASC";
|
||||||
$result = mysqli_query($this->dblink,$q);
|
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows($result)) {
|
if($result['Total']) {
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -335,9 +335,9 @@ class Message {
|
|||||||
|
|
||||||
// Vulnerability closed by Shadow
|
// Vulnerability closed by Shadow
|
||||||
|
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".(time() - 60);
|
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".(time() - 60);
|
||||||
$res = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink). " query ".$q);
|
$res = mysqli_fetch_array(mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink). " query ".$q), MYSQLI_ASSOC);
|
||||||
$flood = mysqli_num_rows($res);
|
$flood = $res['Total'];
|
||||||
if($flood > 5)
|
if($flood > 5)
|
||||||
return; //flood
|
return; //flood
|
||||||
|
|
||||||
@@ -425,9 +425,9 @@ class Message {
|
|||||||
// Vulnerability closed by Shadow
|
// Vulnerability closed by Shadow
|
||||||
|
|
||||||
if ($security_check) {
|
if ($security_check) {
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".(time() - 60);
|
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".(time() - 60);
|
||||||
$res = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink). " query ".$q);
|
$res = mysqli_fetch_array(mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink). " query ".$q), MYSQLI_ASSOC);
|
||||||
$flood = mysqli_num_rows($res);
|
$flood = $res['Total'];
|
||||||
if($flood > 5)
|
if($flood > 5)
|
||||||
return; //flood
|
return; //flood
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,9 @@
|
|||||||
|
|
||||||
public function getUserRank($id) {
|
public function getUserRank($id) {
|
||||||
$ranking = $this->getRank();
|
$ranking = $this->getRank();
|
||||||
$users = "SELECT * FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8") . "";
|
$users = "SELECT Count(*) as Total FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8");
|
||||||
$users2 = mysqli_num_rows(mysqli_query($GLOBALS['link'],$users));
|
$users2 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],$users), MYSQLI_ASSOC);
|
||||||
|
$users2 = $users2['Total'];
|
||||||
$users3 = $users2+1;
|
$users3 = $users2+1;
|
||||||
$myrank = 0;
|
$myrank = 0;
|
||||||
if(count($ranking) > 0) {
|
if(count($ranking) > 0) {
|
||||||
|
|||||||
@@ -443,8 +443,8 @@ if($session->access != BANNED){
|
|||||||
// If is a WW village you can target on WW , if is not a WW village catapults will target randomly.
|
// If is a WW village you can target on WW , if is not a WW village catapults will target randomly.
|
||||||
// Like it says : Exceptions are the WW which can always be targeted and the treasure chamber which can always be targeted, except with the unique artifact.
|
// Like it says : Exceptions are the WW which can always be targeted and the treasure chamber which can always be targeted, except with the unique artifact.
|
||||||
// Fixed by Advocaite and Shadow
|
// Fixed by Advocaite and Shadow
|
||||||
$q = mysqli_query($GLOBALS['link'],"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99t = '40' AND vref = ".(int) $data['to_vid']."");
|
$q = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."fdata WHERE f99t = '40' AND vref = ".(int) $data['to_vid']), MYSQLI_ASSOC);
|
||||||
$isThere = mysqli_num_rows($q);
|
$isThere = $q['Total'];
|
||||||
if($isThere > 0)
|
if($isThere > 0)
|
||||||
{
|
{
|
||||||
$iswwvilla = 1;
|
$iswwvilla = 1;
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ TienTN changes:
|
|||||||
1. Change install/templates/config.tpl to deal with deprecated warning from new PHP version.
|
1. Change install/templates/config.tpl to deal with deprecated warning from new PHP version.
|
||||||
2. Fix install/data/sql.sql, to be executable in current MySQL version.
|
2. Fix install/data/sql.sql, to be executable in current MySQL version.
|
||||||
3. Fix db_MYSQL.php
|
3. Fix db_MYSQL.php
|
||||||
with safe_mysql_fetch_all, and safe_mysql_fetch_array wrappers, to avoid
|
with safe_mysql_fetch_all, and safe_mysqli_fetch_array wrappers, to avoid
|
||||||
Warning: mysql_fetch_all/array() expects parameter 1 to be resource, boolean given
|
Warning: mysql_fetch_all/array() expects parameter 1 to be resource, boolean given
|
||||||
4. Fix the db_MYSQLi.php in class object declaration(if anybody want to use db_MYSQLi.php again)
|
4. Fix the db_MYSQLi.php in class object declaration(if anybody want to use db_MYSQLi.php again)
|
||||||
5. Fix the unx.js file for error:
|
5. Fix the unx.js file for error:
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ if($session->access!=BANNED){
|
|||||||
$displayarray = $database->getUserArray($session->uid,1);
|
$displayarray = $database->getUserArray($session->uid,1);
|
||||||
$forumcat = $database->ForumCat(htmlspecialchars($displayarray['alliance']));
|
$forumcat = $database->ForumCat(htmlspecialchars($displayarray['alliance']));
|
||||||
$ally = $session->alliance;
|
$ally = $session->alliance;
|
||||||
$public = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = '$ally' AND forum_area = 1");
|
$public = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 1"), MYSQLI_ASSOC);
|
||||||
$public1 = mysqli_num_rows($public);
|
$public1 = $public['Total'];
|
||||||
$cofederation = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = '$ally' AND forum_area = 2");
|
$cofederation = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 2"), MYSQLI_ASSOC);
|
||||||
$cofederation1 = mysqli_num_rows($cofederation);
|
$cofederation1 = $cofederation['Total'];
|
||||||
$alliance = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = '$ally' AND forum_area = 0");
|
$alliance = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 0"), MYSQLI_ASSOC);
|
||||||
$alliance1 = mysqli_num_rows($alliance);
|
$alliance1 = $alliance['Total'];
|
||||||
$closed = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = '$ally' AND forum_area = 3");
|
$closed = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 3"), MYSQLI_ASSOC);
|
||||||
$closed1 = mysqli_num_rows($closed);
|
$closed1 = $closed['Total'];
|
||||||
if($public1 != 0){
|
if($public1 != 0){
|
||||||
?>
|
?>
|
||||||
<table cellpadding="1" cellspacing="1" id="public"><thead>
|
<table cellpadding="1" cellspacing="1" id="public"><thead>
|
||||||
|
|||||||
@@ -83,8 +83,9 @@ Treasury <b>' . $reqlvl . '</b>, Effect <b>' . $effect . '</b>
|
|||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
|
$count = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM " . TB_PREFIX . "artefacts"), MYSQLI_ASSOC);
|
||||||
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
|
$count = $count['Total'];
|
||||||
|
if($count == 0) {
|
||||||
echo '<td colspan="4" class="none">'.NO_ARTIFACTS_AREA.'</td>';
|
echo '<td colspan="4" class="none">'.NO_ARTIFACTS_AREA.'</td>';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,9 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
|
$count = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM " . TB_PREFIX . "artefacts"), MYSQLI_ASSOC);
|
||||||
|
$count = $count['Total'];
|
||||||
|
if($count == 0) {
|
||||||
echo '<td colspan="4" class="none">'.NO_ARTIFACTS.'</td>';
|
echo '<td colspan="4" class="none">'.NO_ARTIFACTS.'</td>';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,9 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
|
$count = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM " . TB_PREFIX . "artefacts"), MYSQLI_ASSOC);
|
||||||
|
$count = $count['Total'];
|
||||||
|
if($count == 0) {
|
||||||
echo '<td colspan="4" class="none">'.NO_ARTIFACTS.'</td>';
|
echo '<td colspan="4" class="none">'.NO_ARTIFACTS.'</td>';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ include("GameEngine/Config.php");
|
|||||||
$connection = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysqli_error($database->dblink));
|
$connection = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysqli_error($database->dblink));
|
||||||
mysqli_select_db(SQL_DB, $connection) or die(mysqli_error($database->dblink));
|
mysqli_select_db(SQL_DB, $connection) or die(mysqli_error($database->dblink));
|
||||||
|
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."movement where endtime < ".time()." and proc = 0";
|
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."movement where endtime < ".time()." and proc = 0";
|
||||||
$result = mysqli_query($GLOBALS["link"], $q, $connection);
|
$result = mysqli_fetch_array(mysqli_query($GLOBALS["link"], $q, $connection), MYSQLI_ASSOC);
|
||||||
$count=mysqli_num_rows($result);
|
$count=$result['Total'];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ if($session->access != BANNED){
|
|||||||
$totalT = ($T1+$T2+$T3+$T4);
|
$totalT = ($T1+$T2+$T3+$T4);
|
||||||
$totalR = ($uuVilid['6']+$uuVilid['7']+$uuVilid['8']+$uuVilid['10']);
|
$totalR = ($uuVilid['6']+$uuVilid['7']+$uuVilid['8']+$uuVilid['10']);
|
||||||
|
|
||||||
$goldlog = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysqli_error($database->dblink));
|
$goldlog = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."gold_fin_log"), MYSQLI_ASSOC) or die(mysqli_error($database->dblink));
|
||||||
|
|
||||||
if($totalT <= $totalR) {
|
if($totalT <= $totalR) {
|
||||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set wood = '".$T1."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set wood = '".$T1."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||||
@@ -18,11 +18,11 @@ mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set clay = '".$T2."' wh
|
|||||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set iron = '".$T3."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set iron = '".$T3."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set crop = '".$T4."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set crop = '".$T4."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-3)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-3)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||||
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($database->dblink));
|
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".($goldlog['Total']+1)."', '".$village->wid."', 'trade 1:1')") or die(mysqli_error($database->dblink));
|
||||||
echo "done";
|
echo "done";
|
||||||
} else {
|
} else {
|
||||||
echo "failed";
|
echo "failed";
|
||||||
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($database->dblink));
|
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".($goldlog['Total']+1)."', '".$village->wid."', 'Failed trade 1:1')") or die(mysqli_error($database->dblink));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,13 @@
|
|||||||
| Copyright: TravianX Project All rights reserved |
|
| Copyright: TravianX Project All rights reserved |
|
||||||
\** --------------------------------------------------- **/
|
\** --------------------------------------------------- **/
|
||||||
|
|
||||||
$tribe1 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 1");
|
$tribe1 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 1"), MYSQLI_ASSOC);
|
||||||
$tribe2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 2");
|
$tribe2 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 2"), MYSQLI_ASSOC);
|
||||||
$tribe3 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 3");
|
$tribe3 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 3"), MYSQLI_ASSOC);
|
||||||
$tribes = array(mysqli_num_rows($tribe1), mysqli_num_rows($tribe2), mysqli_num_rows($tribe3));
|
$tribes = array($tribe1['Total'], $tribe2['Total'], $tribe3['Total']);
|
||||||
$users = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5")); ?>
|
$users = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5"), MYSQLI_ASSOC);
|
||||||
|
$users = $users['Total'];
|
||||||
|
?>
|
||||||
|
|
||||||
<table cellpadding="1" cellspacing="1" id="world_player" class="world">
|
<table cellpadding="1" cellspacing="1" id="world_player" class="world">
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@@ -260,10 +260,10 @@ $oldmovement=$database->getMovementById($_GET['moveid']);
|
|||||||
$now=time();
|
$now=time();
|
||||||
if(($now-$oldmovement[0]['starttime'])<90 && $oldmovement[0]['from'] == $village->wid){
|
if(($now-$oldmovement[0]['starttime'])<90 && $oldmovement[0]['from'] == $village->wid){
|
||||||
|
|
||||||
$qc="SELECT * FROM " . TB_PREFIX . "movement where proc = 0 and moveid = ".$database->escape((int) $_GET['moveid']);
|
$qc="SELECT Count(*) as Total FROM " . TB_PREFIX . "movement where proc = 0 and moveid = ".$database->escape((int) $_GET['moveid']);
|
||||||
$resultc=$database->query($qc) or die(mysqli_error($database->dblink));
|
$resultc=mysqli_fetch_array(mysqli_query($database->dblink, $qc), MYSQLI_ASSOC);
|
||||||
|
|
||||||
if (mysqli_num_rows($resultc)==1){
|
if ($resultc['Total']==1){
|
||||||
|
|
||||||
$q = "UPDATE " . TB_PREFIX . "movement set proc = 1 where proc = 0 and moveid = ".$database->escape((int) $_GET['moveid']);
|
$q = "UPDATE " . TB_PREFIX . "movement set proc = 1 where proc = 0 and moveid = ".$database->escape((int) $_GET['moveid']);
|
||||||
$database->query($q);
|
$database->query($q);
|
||||||
|
|||||||
Reference in New Issue
Block a user