mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
@@ -12,8 +12,8 @@
|
||||
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
||||
include("../GameEngine/config.php");
|
||||
$id = $_SESSION['id'];
|
||||
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."allimedal");
|
||||
$nummedals = mysqli_num_rows($sql);
|
||||
$sql = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."allimedal"), MYSQLI_ASSOC);
|
||||
$nummedals = $sql['Total'];
|
||||
?>
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ $nummedals = mysqli_num_rows($sql);
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."allimedal");
|
||||
$tot = mysqli_num_rows($sql);
|
||||
$sql = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."allimedal"), MYSQLI_ASSOC);
|
||||
$tot = $sql['Total'];
|
||||
$sql = mysqli_query($GLOBALS["link"], "SELECT week FROM ".TB_PREFIX."allimedal ORDER BY week DESC LIMIT 1");
|
||||
if(mysqli_num_rows($sql) > 0){
|
||||
$week = mysqli_result($sql, 0);
|
||||
@@ -75,8 +75,8 @@ $nummedals = mysqli_num_rows($sql);
|
||||
for($j = 0; $j<$week; $j++)
|
||||
{
|
||||
$newweek = $j+1;
|
||||
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."allimedal WHERE week = $newweek");
|
||||
$tot = mysqli_num_rows($sql);
|
||||
$sql = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."allimedal WHERE week = $newweek"), MYSQLI_ASSOC);
|
||||
$tot = $sql['Total'];
|
||||
echo "<tr>
|
||||
<td>$newweek</td>
|
||||
<td>$tot</td>
|
||||
|
||||
@@ -13,8 +13,8 @@ if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
|
||||
include("../GameEngine/config.php");
|
||||
$id = $_SESSION['id'];
|
||||
|
||||
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."medal");
|
||||
$nummedals = mysqli_num_rows($sql);
|
||||
$sql = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."medal"), MYSQLI_ASSOC);
|
||||
$nummedals = $sql['Total'];
|
||||
?>
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ $nummedals = mysqli_num_rows($sql);
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."medal");
|
||||
$tot = mysqli_num_rows($sql);
|
||||
$sql = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."medal"), MYSQLI_ASSOC);
|
||||
$tot = $sql['Total'];
|
||||
$sql = mysqli_query($GLOBALS["link"], "SELECT week FROM ".TB_PREFIX."medal ORDER BY week DESC LIMIT 1");
|
||||
if(mysqli_num_rows($sql) > 0){
|
||||
$week = mysqli_result($sql, 0);
|
||||
@@ -77,8 +77,8 @@ $nummedals = mysqli_num_rows($sql);
|
||||
{
|
||||
$newweek = $j+1;
|
||||
|
||||
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."medal WHERE week = $newweek");
|
||||
$tot = mysqli_num_rows($sql);
|
||||
$sql = mysqli_fetch_array(mysqli_query($GLOBALS["link"], "SELECT Count(*) as Total FROM ".TB_PREFIX."medal WHERE week = $newweek"), MYSQLI_ASSOC);
|
||||
$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>";
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@ $sessionaccess = $access['access'];
|
||||
|
||||
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'];
|
||||
$admin = $session;
|
||||
|
||||
@@ -318,13 +318,14 @@ class adm_DB {
|
||||
function DelVillage($wref, $mode=0){
|
||||
global $database;
|
||||
$wref = (int) $wref;
|
||||
if($mode==0){
|
||||
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `wref` = $wref and capital = 0";
|
||||
}else{
|
||||
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
|
||||
}
|
||||
$result = mysqli_query($this->connection, $q);
|
||||
if(mysqli_num_rows($result) > 0){
|
||||
if ($mode==0) {
|
||||
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."vdata WHERE `wref` = $wref and capital = 0";
|
||||
} else {
|
||||
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
|
||||
}
|
||||
|
||||
$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().")");
|
||||
|
||||
$database->clearExpansionSlot($wref);
|
||||
|
||||
@@ -30,14 +30,12 @@ class Automation {
|
||||
private $bountyOpop = 1;
|
||||
|
||||
public function isWinner() {
|
||||
$q = mysqli_query($GLOBALS['link'],"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
|
||||
$isThere = mysqli_num_rows($q);
|
||||
if($isThere > 0)
|
||||
// check whether someone already built a level 100 Wonder of the World
|
||||
$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($q['Total'] > 0)
|
||||
{
|
||||
header('Location: winner.php');
|
||||
exit;
|
||||
}else{
|
||||
## there is no winner
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+61
-60
@@ -652,9 +652,9 @@ class MYSQLi_DB implements IDbConnection {
|
||||
function checkactiveSession($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";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if(mysqli_num_rows($result) != 0) {
|
||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "users where username = '$username' and sessid = '$sessid' LIMIT 1";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if($result['Total'] > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -1208,9 +1208,9 @@ class MYSQLi_DB implements IDbConnection {
|
||||
function CheckForum($id) {
|
||||
list($id) = $this->escape_input((int) $id);
|
||||
|
||||
$q = "SELECT * from " . TB_PREFIX . "forum_cat where alliance = '$id'";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "forum_cat where alliance = $id";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if ($result['Total']) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -1237,9 +1237,9 @@ class MYSQLi_DB implements IDbConnection {
|
||||
function CheckLastTopic($id) {
|
||||
list($id) = $this->escape_input($id);
|
||||
|
||||
$q = "SELECT * from " . TB_PREFIX . "forum_topic where cat = '$id'";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_topic where cat = $id";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if($result['Total']) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -1249,9 +1249,9 @@ class MYSQLi_DB implements IDbConnection {
|
||||
function CheckLastPost($id) {
|
||||
list($id) = $this->escape_input($id);
|
||||
|
||||
$q = "SELECT * from " . TB_PREFIX . "forum_post where topic = '$id'";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_post where topic = $id";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if ($result['Total']) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -1325,9 +1325,9 @@ class MYSQLi_DB implements IDbConnection {
|
||||
function CheckCatTopic($id) {
|
||||
list($id) = $this->escape_input($id);
|
||||
|
||||
$q = "SELECT * from " . TB_PREFIX . "forum_topic where cat = '$id'";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_topic where cat = $id";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if ($result['Total']) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -1337,9 +1337,9 @@ class MYSQLi_DB implements IDbConnection {
|
||||
function CheckResultEdit($alli) {
|
||||
list($alli) = $this->escape_input($alli);
|
||||
|
||||
$q = "SELECT * from " . TB_PREFIX . "forum_edit where alliance = '$alli'";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$q = "SELECT Count(*) as Total from " . TB_PREFIX . "forum_edit where alliance = $alli";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if ($result['Total']) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -1409,9 +1409,9 @@ class MYSQLi_DB implements IDbConnection {
|
||||
function checkVilExist($wref) {
|
||||
list($wref) = $this->escape_input((int) $wref);
|
||||
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "vdata where wref = '$wref'";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "vdata where wref = '$wref'";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if ($result['Total']) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -1421,9 +1421,9 @@ class MYSQLi_DB implements IDbConnection {
|
||||
function checkOasisExist($wref) {
|
||||
list($wref) = $this->escape_input((int) $wref);
|
||||
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "odata where wref = '$wref'";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "odata where wref = '$wref'";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if($result['Total']) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -1530,9 +1530,9 @@ class MYSQLi_DB implements IDbConnection {
|
||||
function checkSurvey($topic) {
|
||||
list($topic) = $this->escape_input((int) $topic);
|
||||
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "forum_survey where topic = $topic";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "forum_survey where topic = $topic";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if ($result['Total']) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -3293,9 +3293,9 @@ class MYSQLi_DB implements IDbConnection {
|
||||
function getBuildingByField2($wid,$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";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
return mysqli_num_rows($result);
|
||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "bdata where wid = $wid and field = $field and master = 0";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
return $result['Total'];
|
||||
}
|
||||
|
||||
function getBuildingByType($wid,$type) {
|
||||
@@ -3309,9 +3309,9 @@ class MYSQLi_DB implements IDbConnection {
|
||||
function getBuildingByType2($wid,$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";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
return mysqli_num_rows($result);
|
||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "bdata where wid = $wid and type = $type and master = 0";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
return $result['Total'];
|
||||
}
|
||||
|
||||
function getDorf1Building($wid) {
|
||||
@@ -4133,9 +4133,9 @@ class MYSQLi_DB implements IDbConnection {
|
||||
***************************/
|
||||
|
||||
function getWW() {
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "fdata WHERE f99t = 40";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "fdata WHERE f99t = 40";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if($result['Total']) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -5123,9 +5123,9 @@ References:
|
||||
function getHeroDead($id) {
|
||||
list($id) = $this->escape_input((int) $id);
|
||||
|
||||
$q = "SELECT dead FROM " . TB_PREFIX . "hero WHERE `uid` = $id AND dead = 0";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if (mysqli_num_rows($result) > 0) {
|
||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "hero WHERE `uid` = $id AND dead = 0";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if ($result['Total'] > 0) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
@@ -5140,9 +5140,9 @@ References:
|
||||
function getHeroInRevive($id) {
|
||||
list($id) = $this->escape_input((int) $id);
|
||||
|
||||
$q = "SELECT inrevive FROM " . TB_PREFIX . "hero WHERE `uid` = $id AND inrevive = 1";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if (mysqli_num_rows($result) > 0) {
|
||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "hero WHERE `uid` = $id AND inrevive = 1";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if ($result['Total'] > 0) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
@@ -5157,9 +5157,9 @@ References:
|
||||
function getHeroInTraining($id) {
|
||||
list($id) = $this->escape_input((int) $id);
|
||||
|
||||
$q = "SELECT intraining FROM " . TB_PREFIX . "hero WHERE `uid` = $id AND intraining = 1";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if (mysqli_num_rows($result) > 0) {
|
||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "hero WHERE `uid` = $id AND intraining = 1";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if ($result['Total'] > 0) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
@@ -5300,15 +5300,16 @@ References:
|
||||
***************************/
|
||||
|
||||
function checkAttack($wref, $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);
|
||||
if(mysqli_num_rows($result)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
list($wref, $toWref) = $this->escape_input((int) $wref, (int) $toWref);
|
||||
|
||||
$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";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if ($result['Total']) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/***************************
|
||||
Function checkEnforce
|
||||
@@ -5318,9 +5319,9 @@ References:
|
||||
function checkEnforce($wref, $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";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$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_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if($result['Total']) {
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
@@ -5335,9 +5336,9 @@ References:
|
||||
function checkScout($wref, $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";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$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_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
||||
if($result['Total']) {
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
|
||||
@@ -335,9 +335,9 @@ class Message {
|
||||
|
||||
// Vulnerability closed by Shadow
|
||||
|
||||
$q = "SELECT * 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);
|
||||
$flood = mysqli_num_rows($res);
|
||||
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".(time() - 60);
|
||||
$res = mysqli_fetch_array(mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink). " query ".$q), MYSQLI_ASSOC);
|
||||
$flood = $res['Total'];
|
||||
if($flood > 5)
|
||||
return; //flood
|
||||
|
||||
@@ -425,9 +425,9 @@ class Message {
|
||||
// Vulnerability closed by Shadow
|
||||
|
||||
if ($security_check) {
|
||||
$q = "SELECT * 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);
|
||||
$flood = mysqli_num_rows($res);
|
||||
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".(time() - 60);
|
||||
$res = mysqli_fetch_array(mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink). " query ".$q), MYSQLI_ASSOC);
|
||||
$flood = $res['Total'];
|
||||
if($flood > 5)
|
||||
return; //flood
|
||||
}
|
||||
|
||||
@@ -20,8 +20,9 @@
|
||||
|
||||
public function getUserRank($id) {
|
||||
$ranking = $this->getRank();
|
||||
$users = "SELECT * FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8") . "";
|
||||
$users2 = mysqli_num_rows(mysqli_query($GLOBALS['link'],$users));
|
||||
$users = "SELECT Count(*) as Total FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8");
|
||||
$users2 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],$users), MYSQLI_ASSOC);
|
||||
$users2 = $users2['Total'];
|
||||
$users3 = $users2+1;
|
||||
$myrank = 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.
|
||||
// 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
|
||||
$q = mysqli_query($GLOBALS['link'],"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99t = '40' AND vref = ".(int) $data['to_vid']."");
|
||||
$isThere = mysqli_num_rows($q);
|
||||
$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 = $q['Total'];
|
||||
if($isThere > 0)
|
||||
{
|
||||
$iswwvilla = 1;
|
||||
|
||||
@@ -189,7 +189,7 @@ TienTN changes:
|
||||
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.
|
||||
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
|
||||
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:
|
||||
|
||||
@@ -9,14 +9,14 @@ if($session->access!=BANNED){
|
||||
$displayarray = $database->getUserArray($session->uid,1);
|
||||
$forumcat = $database->ForumCat(htmlspecialchars($displayarray['alliance']));
|
||||
$ally = $session->alliance;
|
||||
$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);
|
||||
$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 = $public['Total'];
|
||||
$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 = $cofederation['Total'];
|
||||
$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 = $alliance['Total'];
|
||||
$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 = $closed['Total'];
|
||||
if($public1 != 0){
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="public"><thead>
|
||||
|
||||
@@ -83,8 +83,9 @@ Treasury <b>' . $reqlvl . '</b>, Effect <b>' . $effect . '</b>
|
||||
|
||||
<tbody>
|
||||
<?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_AREA.'</td>';
|
||||
} else {
|
||||
|
||||
|
||||
@@ -31,7 +31,9 @@
|
||||
<tbody>
|
||||
<?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>';
|
||||
} else {
|
||||
|
||||
|
||||
@@ -31,7 +31,9 @@
|
||||
<tbody>
|
||||
<?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>';
|
||||
} else {
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ include("GameEngine/Config.php");
|
||||
$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));
|
||||
|
||||
$q = "SELECT * FROM ".TB_PREFIX."movement where endtime < ".time()." and proc = 0";
|
||||
$result = mysqli_query($GLOBALS["link"], $q, $connection);
|
||||
$count=mysqli_num_rows($result);
|
||||
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."movement where endtime < ".time()." and proc = 0";
|
||||
$result = mysqli_fetch_array(mysqli_query($GLOBALS["link"], $q, $connection), MYSQLI_ASSOC);
|
||||
$count=$result['Total'];
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ if($session->access != BANNED){
|
||||
$totalT = ($T1+$T2+$T3+$T4);
|
||||
$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) {
|
||||
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 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'],"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";
|
||||
} else {
|
||||
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 |
|
||||
\** --------------------------------------------------- **/
|
||||
|
||||
$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")); ?>
|
||||
$tribe1 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 1"), MYSQLI_ASSOC);
|
||||
$tribe2 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 2"), MYSQLI_ASSOC);
|
||||
$tribe3 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 3"), MYSQLI_ASSOC);
|
||||
$tribes = array($tribe1['Total'], $tribe2['Total'], $tribe3['Total']);
|
||||
$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">
|
||||
<thead>
|
||||
|
||||
@@ -260,10 +260,10 @@ $oldmovement=$database->getMovementById($_GET['moveid']);
|
||||
$now=time();
|
||||
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']);
|
||||
$resultc=$database->query($qc) or die(mysqli_error($database->dblink));
|
||||
$qc="SELECT Count(*) as Total FROM " . TB_PREFIX . "movement where proc = 0 and moveid = ".$database->escape((int) $_GET['moveid']);
|
||||
$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']);
|
||||
$database->query($q);
|
||||
|
||||
Reference in New Issue
Block a user