mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-30 15:17:13 +00:00
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:
@@ -18,6 +18,7 @@
|
|||||||
#################################################################################
|
#################################################################################
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
include_once("../GameEngine/config.php");
|
||||||
include_once("../GameEngine/Database.php");
|
include_once("../GameEngine/Database.php");
|
||||||
include_once ("../GameEngine/Lang/" . LANG . ".php");
|
include_once ("../GameEngine/Lang/" . LANG . ".php");
|
||||||
include_once("../GameEngine/Admin/database.php");
|
include_once("../GameEngine/Admin/database.php");
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ include("Session.php");
|
|||||||
|
|
||||||
class Account {
|
class Account {
|
||||||
|
|
||||||
function Account() {
|
function __construct() {
|
||||||
global $session;
|
global $session;
|
||||||
if(isset($_POST['ft'])) {
|
if(isset($_POST['ft'])) {
|
||||||
switch($_POST['ft']) {
|
switch($_POST['ft']) {
|
||||||
@@ -140,8 +140,8 @@ class Account {
|
|||||||
{
|
{
|
||||||
global $database;
|
global $database;
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."activate where act = '".$_POST['id']."'";
|
$q = "SELECT * FROM ".TB_PREFIX."activate where act = '".$_POST['id']."'";
|
||||||
$result = mysql_query($q, $database->connection);
|
$result = mysqli_query($GLOBALS['link'],$q);
|
||||||
$dbarray = mysql_fetch_array($result);
|
$dbarray = mysqli_fetch_array($result);
|
||||||
if($dbarray['act'] == $_POST['id']) {
|
if($dbarray['act'] == $_POST['id']) {
|
||||||
$uid = $database->register($dbarray['username'],$dbarray['password'],$dbarray['email'],$dbarray['tribe'],"");
|
$uid = $database->register($dbarray['username'],$dbarray['password'],$dbarray['email'],$dbarray['tribe'],"");
|
||||||
if($uid) {
|
if($uid) {
|
||||||
@@ -165,8 +165,8 @@ class Account {
|
|||||||
private function Unreg() {
|
private function Unreg() {
|
||||||
global $database;
|
global $database;
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."activate where id = '".$_POST['id']."'";
|
$q = "SELECT * FROM ".TB_PREFIX."activate where id = '".$_POST['id']."'";
|
||||||
$result = mysql_query($q, $database->connection);
|
$result = mysqli_query($GLOBALS['link'],$q);
|
||||||
$dbarray = mysql_fetch_array($result);
|
$dbarray = mysqli_fetch_array($result);
|
||||||
if(md5($_POST['pw']) == $dbarray['password']) {
|
if(md5($_POST['pw']) == $dbarray['password']) {
|
||||||
$database->unreg($dbarray['username']);
|
$database->unreg($dbarray['username']);
|
||||||
header("Location: anmelden.php");
|
header("Location: anmelden.php");
|
||||||
@@ -178,9 +178,10 @@ class Account {
|
|||||||
|
|
||||||
private function Login() {
|
private function Login() {
|
||||||
global $database,$session,$form;
|
global $database,$session,$form;
|
||||||
$_POST['user'] = mysql_real_escape_string($_POST['user']);
|
$user = $_POST['user'];
|
||||||
|
$user = mysqli_real_escape_string($GLOBALS['link'], $user);
|
||||||
if(!isset($_POST['user']) || $_POST['user'] == "") {
|
if(!isset($_POST['user']) || $_POST['user'] == "") {
|
||||||
$form->addError("user",LOGIN_USR_EMPTY);
|
$form->addError("user",$user);
|
||||||
}
|
}
|
||||||
else if(!$database->checkExist($_POST['user'],0)) {
|
else if(!$database->checkExist($_POST['user'],0)) {
|
||||||
$form->addError("user",USR_NT_FOUND);
|
$form->addError("user",USR_NT_FOUND);
|
||||||
@@ -224,7 +225,7 @@ class Account {
|
|||||||
global $session,$database;
|
global $session,$database;
|
||||||
unset($_SESSION['wid']);
|
unset($_SESSION['wid']);
|
||||||
$database->activeModify(addslashes($session->username),1);
|
$database->activeModify(addslashes($session->username),1);
|
||||||
$database->UpdateOnline("logout") or die(mysql_error());
|
$database->UpdateOnline("logout") or die(mysqli_error());
|
||||||
$session->Logout();
|
$session->Logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,25 +24,26 @@ include_once("../GameEngine/Data/unitdata.php");
|
|||||||
include_once("../GameEngine/Technology.php");
|
include_once("../GameEngine/Technology.php");
|
||||||
include_once("../GameEngine/Data/buidata.php");
|
include_once("../GameEngine/Data/buidata.php");
|
||||||
}
|
}
|
||||||
|
include_once("../../GameEngine/Database.php");
|
||||||
class adm_DB {
|
class adm_DB {
|
||||||
var $connection;
|
|
||||||
|
|
||||||
function adm_DB(){
|
var $connection;
|
||||||
global $database;
|
function adm_DB(){
|
||||||
$this->connection = mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
|
global $database;
|
||||||
mysql_select_db(SQL_DB, $this->connection) or die(mysql_error());
|
$database = new MYSQLi_DB;
|
||||||
|
$this->connection = $database->return_link();
|
||||||
}
|
}
|
||||||
|
|
||||||
function Login($username,$password){
|
function Login($username,$password){
|
||||||
$q = "SELECT password FROM ".TB_PREFIX."users where username = '$username' and access >= ".MULTIHUNTER;
|
$q = "SELECT password FROM ".TB_PREFIX."users where username = '$username' and access >= ".MULTIHUNTER;
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($this->connection,$q);
|
||||||
$dbarray = mysql_fetch_array($result);
|
$dbarray = mysqli_fetch_array($result);
|
||||||
if($dbarray['password'] == md5($password)) {
|
if($dbarray['password'] == md5($password)) {
|
||||||
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,'X','$username logged in (IP: <b>".$_SERVER['REMOTE_ADDR']."</b>)',".time().")");
|
mysqli_query($this->connection,"Insert into ".TB_PREFIX."admin_log values (0,'X','$username logged in (IP: <b>".$_SERVER['REMOTE_ADDR']."</b>)',".time().")");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,'X','<font color=\'red\'><b>IP: ".$_SERVER['REMOTE_ADDR']." tried to log in with username <u> $username</u> but access was denied!</font></b>',".time().")");
|
mysqli_query($this->connection,"Insert into ".TB_PREFIX."admin_log values (0,'X','<font color=\'red\'><b>IP: ".$_SERVER['REMOTE_ADDR']." tried to log in with username <u> $username</u> but access was denied!</font></b>',".time().")");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,7 +71,7 @@ class adm_DB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$q = "UPDATE ".TB_PREFIX."vdata set pop = $popTot where wref = $vid";
|
$q = "UPDATE ".TB_PREFIX."vdata set pop = $popTot where wref = $vid";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
function recountCP($vid){
|
function recountCP($vid){
|
||||||
@@ -85,7 +86,7 @@ class adm_DB {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$q = "UPDATE ".TB_PREFIX."vdata set cp = $popTot where wref = $vid";
|
$q = "UPDATE ".TB_PREFIX."vdata set cp = $popTot where wref = $vid";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($this->connection,$q);
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildingPOP($f,$lvl){
|
function buildingPOP($f,$lvl){
|
||||||
@@ -114,8 +115,8 @@ class adm_DB {
|
|||||||
|
|
||||||
function getWref($x,$y) {
|
function getWref($x,$y) {
|
||||||
$q = "SELECT id FROM ".TB_PREFIX."wdata where x = $x and y = $y";
|
$q = "SELECT id FROM ".TB_PREFIX."wdata where x = $x and y = $y";
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($this->connection,$q);
|
||||||
$r = mysql_fetch_array($result);
|
$r = mysqli_fetch_array($result);
|
||||||
return $r['id'];
|
return $r['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +127,7 @@ class adm_DB {
|
|||||||
$status = $database->getVillageState($wid);
|
$status = $database->getVillageState($wid);
|
||||||
$status = 0;
|
$status = 0;
|
||||||
if($status == 0){
|
if($status == 0){
|
||||||
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Added new village <b><a href=\'admin.php?p=village&did=$wid\'>$wid</a></b> to user <b><a href=\'admin.php?p=player&uid=$uid\'>$uid</a></b>',".time().")");
|
mysqli_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Added new village <b><a href=\'admin.php?p=village&did=$wid\'>$wid</a></b> to user <b><a href=\'admin.php?p=player&uid=$uid\'>$uid</a></b>',".time().")");
|
||||||
$database->setFieldTaken($wid);
|
$database->setFieldTaken($wid);
|
||||||
$database->addVillage($wid,$uid,'new village','0');
|
$database->addVillage($wid,$uid,'new village','0');
|
||||||
$database->addResourceFields($wid,$database->getVillageType($wid));
|
$database->addResourceFields($wid,$database->getVillageType($wid));
|
||||||
@@ -164,23 +165,23 @@ class adm_DB {
|
|||||||
if($post['clean_ware']){
|
if($post['clean_ware']){
|
||||||
$time = time();
|
$time = time();
|
||||||
$q = "UPDATE ".TB_PREFIX."vdata SET `wood` = '0', `clay` = '0', `iron` = '0', `crop` = '0', `lastupdate` = '$time' WHERE wref = $vid;";
|
$q = "UPDATE ".TB_PREFIX."vdata SET `wood` = '0', `clay` = '0', `iron` = '0', `crop` = '0', `lastupdate` = '$time' WHERE wref = $vid;";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($this->connection,$q);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Punished user: <a href=\'admin.php?p=player&uid=".$post['uid']."\'>".$post['uid']."</a> with <b>-".$post['punish']."%</b> population',".time().")");
|
mysqli_query($this->connection,"Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Punished user: <a href=\'admin.php?p=player&uid=".$post['uid']."\'>".$post['uid']."</a> with <b>-".$post['punish']."%</b> population',".time().")");
|
||||||
}
|
}
|
||||||
|
|
||||||
function PunishBuilding($vid,$proc,$pop){
|
function PunishBuilding($vid,$proc,$pop){
|
||||||
global $database;
|
global $database;
|
||||||
$q = "UPDATE ".TB_PREFIX."vdata set pop = $pop where wref = $vid;";
|
$q = "UPDATE ".TB_PREFIX."vdata set pop = $pop where wref = $vid;";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($this->connection,$q);
|
||||||
$fdata = $database->getResourceLevel($vid);
|
$fdata = $database->getResourceLevel($vid);
|
||||||
for ($i = 1; $i <= 40; $i++) {
|
for ($i = 1; $i <= 40; $i++) {
|
||||||
if($fdata['f'.$i]>1){
|
if($fdata['f'.$i]>1){
|
||||||
$zm = ($fdata['f'.$i]/100)*$proc;
|
$zm = ($fdata['f'.$i]/100)*$proc;
|
||||||
if($zm < 1){$zm = 1;}else{$zm = floor($zm);}
|
if($zm < 1){$zm = 1;}else{$zm = floor($zm);}
|
||||||
$q = "UPDATE ".TB_PREFIX."fdata SET `f$i` = '$zm' WHERE `vref` = $vid;";
|
$q = "UPDATE ".TB_PREFIX."fdata SET `f$i` = '$zm' WHERE `vref` = $vid;";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -193,7 +194,7 @@ class adm_DB {
|
|||||||
|
|
||||||
function DelUnits2($vid,$unit){
|
function DelUnits2($vid,$unit){
|
||||||
$q = "UPDATE ".TB_PREFIX."units SET `u$unit` = '0' WHERE `vref` = $vid;";
|
$q = "UPDATE ".TB_PREFIX."units SET `u$unit` = '0' WHERE `vref` = $vid;";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($this->connection,$q);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DelPlayer($uid,$pass){
|
function DelPlayer($uid,$pass){
|
||||||
@@ -205,26 +206,26 @@ class adm_DB {
|
|||||||
$this->DelVillage($villages[$i]['wref'], 1);
|
$this->DelVillage($villages[$i]['wref'], 1);
|
||||||
}
|
}
|
||||||
$q = "DELETE FROM ".TB_PREFIX."hero where uid = $uid";
|
$q = "DELETE FROM ".TB_PREFIX."hero where uid = $uid";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($this->connection,$q);
|
||||||
|
|
||||||
$name = $database->getUserField($uid,"username",0);
|
$name = $database->getUserField($uid,"username",0);
|
||||||
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$ID,'Deleted user <a>$name</a>',".time().")");
|
mysqli_query($this->connection,"Insert into ".TB_PREFIX."admin_log values (0,$ID,'Deleted user <a>$name</a>',".time().")");
|
||||||
$q = "DELETE FROM ".TB_PREFIX."users WHERE `id` = $uid;";
|
$q = "DELETE FROM ".TB_PREFIX."users WHERE `id` = $uid;";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($this->connection,$q);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUserActive() {
|
function getUserActive() {
|
||||||
$time = time() - (60*5);
|
$time = time() - (60*5);
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."users where timestamp > $time and username != 'support'";
|
$q = "SELECT * FROM ".TB_PREFIX."users where timestamp > $time and username != 'support'";
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($q, $this->connection);
|
||||||
return $this->mysql_fetch_all($result);
|
return $this->mysqli_fetch_all($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function CheckPass($password,$uid){
|
function CheckPass($password,$uid){
|
||||||
$q = "SELECT password FROM ".TB_PREFIX."users where id = '$uid' and access = ".ADMIN;
|
$q = "SELECT password FROM ".TB_PREFIX."users where id = '$uid' and access = ".ADMIN;
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($q, $this->connection);
|
||||||
$dbarray = mysql_fetch_array($result);
|
$dbarray = mysqli_fetch_array($result);
|
||||||
if($dbarray['password'] == md5($password)) {
|
if($dbarray['password'] == md5($password)) {
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
@@ -239,37 +240,37 @@ class adm_DB {
|
|||||||
}else{
|
}else{
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
|
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
|
||||||
}
|
}
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($q, $this->connection);
|
||||||
if(mysql_num_rows($result) > 0){
|
if(mysqli_num_rows($result) > 0){
|
||||||
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Deleted village <b>$wref</b>',".time().")");
|
mysqli_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Deleted village <b>$wref</b>',".time().")");
|
||||||
|
|
||||||
$database->clearExpansionSlot($wref);
|
$database->clearExpansionSlot($wref);
|
||||||
|
|
||||||
$q = "DELETE FROM ".TB_PREFIX."abdata where vref = $wref";
|
$q = "DELETE FROM ".TB_PREFIX."abdata where vref = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
$q = "DELETE FROM ".TB_PREFIX."bdata where wid = $wref";
|
$q = "DELETE FROM ".TB_PREFIX."bdata where wid = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
$q = "DELETE FROM ".TB_PREFIX."market where vref = $wref";
|
$q = "DELETE FROM ".TB_PREFIX."market where vref = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
$q = "DELETE FROM ".TB_PREFIX."odata where wref = $wref";
|
$q = "DELETE FROM ".TB_PREFIX."odata where wref = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
$q = "DELETE FROM ".TB_PREFIX."research where vref = $wref";
|
$q = "DELETE FROM ".TB_PREFIX."research where vref = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
$q = "DELETE FROM ".TB_PREFIX."tdata where vref = $wref";
|
$q = "DELETE FROM ".TB_PREFIX."tdata where vref = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
$q = "DELETE FROM ".TB_PREFIX."fdata where vref = $wref";
|
$q = "DELETE FROM ".TB_PREFIX."fdata where vref = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
$q = "DELETE FROM ".TB_PREFIX."training where vref = $wref";
|
$q = "DELETE FROM ".TB_PREFIX."training where vref = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
$q = "DELETE FROM ".TB_PREFIX."units where vref = $wref";
|
$q = "DELETE FROM ".TB_PREFIX."units where vref = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
$q = "DELETE FROM ".TB_PREFIX."farmlist where wref = $wref";
|
$q = "DELETE FROM ".TB_PREFIX."farmlist where wref = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
$q = "DELETE FROM ".TB_PREFIX."raidlist where towref = $wref";
|
$q = "DELETE FROM ".TB_PREFIX."raidlist where towref = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
|
|
||||||
$q = "DELETE FROM ".TB_PREFIX."movement where `from` = $wref and proc=0";
|
$q = "DELETE FROM ".TB_PREFIX."movement where `from` = $wref and proc=0";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
|
|
||||||
$getmovement = $database->getMovement(3,$wref,1);
|
$getmovement = $database->getMovement(3,$wref,1);
|
||||||
foreach($getmovement as $movedata) {
|
foreach($getmovement as $movedata) {
|
||||||
@@ -284,11 +285,11 @@ class adm_DB {
|
|||||||
$this->returnTroops($wref);
|
$this->returnTroops($wref);
|
||||||
|
|
||||||
$q = "DELETE FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
|
$q = "DELETE FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
|
|
||||||
if (mysql_affected_rows()>0) {
|
if (mysqli_affected_rows()>0) {
|
||||||
$q = "UPDATE ".TB_PREFIX."wdata set occupied = 0 where id = $wref";
|
$q = "UPDATE ".TB_PREFIX."wdata set occupied = 0 where id = $wref";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
|
|
||||||
$getprisoners = $database->getPrisoners($wref);
|
$getprisoners = $database->getPrisoners($wref);
|
||||||
foreach($getprisoners as $pris) {
|
foreach($getprisoners as $pris) {
|
||||||
@@ -315,83 +316,83 @@ class adm_DB {
|
|||||||
function DelBan($uid,$id){
|
function DelBan($uid,$id){
|
||||||
global $database;
|
global $database;
|
||||||
$name = addslashes($database->getUserField($uid,"username",0));
|
$name = addslashes($database->getUserField($uid,"username",0));
|
||||||
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Unbanned user <a href=\'admin.php?p=player&uid=$uid\'>$name</a>',".time().")");
|
mysqli_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Unbanned user <a href=\'admin.php?p=player&uid=$uid\'>$name</a>',".time().")");
|
||||||
$q = "UPDATE ".TB_PREFIX."users SET `access` = '".USER."' WHERE `id` = $uid;";
|
$q = "UPDATE ".TB_PREFIX."users SET `access` = '".USER."' WHERE `id` = $uid;";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
$q = "UPDATE ".TB_PREFIX."banlist SET `active` = '0' WHERE `id` = $id;";
|
$q = "UPDATE ".TB_PREFIX."banlist SET `active` = '0' WHERE `id` = $id;";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
function AddBan($uid,$end,$reason){
|
function AddBan($uid,$end,$reason){
|
||||||
global $database;
|
global $database;
|
||||||
$name = addslashes($database->getUserField($uid,"username",0));
|
$name = addslashes($database->getUserField($uid,"username",0));
|
||||||
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Banned user <a href=\'admin.php?p=player&uid=$uid\'>$name</a>',".time().")");
|
mysqli_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Banned user <a href=\'admin.php?p=player&uid=$uid\'>$name</a>',".time().")");
|
||||||
$q = "UPDATE ".TB_PREFIX."users SET `access` = '0' WHERE `id` = $uid;";
|
$q = "UPDATE ".TB_PREFIX."users SET `access` = '0' WHERE `id` = $uid;";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
$time = time();
|
$time = time();
|
||||||
$admin = $_SESSION['id']; //$database->getUserField($_SESSION['username'],'id',1);
|
$admin = $_SESSION['id']; //$database->getUserField($_SESSION['username'],'id',1);
|
||||||
$name = addslashes($database->getUserField($uid,'username',0));
|
$name = addslashes($database->getUserField($uid,'username',0));
|
||||||
$q = "INSERT INTO ".TB_PREFIX."banlist (`uid`, `name`, `reason`, `time`, `end`, `admin`, `active`) VALUES ($uid, '$name' , '$reason', '$time', '$end', '$admin', '1');";
|
$q = "INSERT INTO ".TB_PREFIX."banlist (`uid`, `name`, `reason`, `time`, `end`, `admin`, `active`) VALUES ($uid, '$name' , '$reason', '$time', '$end', '$admin', '1');";
|
||||||
mysql_query($q, $this->connection);
|
mysqli_query($q, $this->connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
function search_player($player){
|
function search_player($player){
|
||||||
$q = "SELECT id,username FROM ".TB_PREFIX."users WHERE `username` LIKE '%$player%' and username != 'support'";
|
$q = "SELECT id,username FROM ".TB_PREFIX."users WHERE `username` LIKE '%$player%' and username != 'support'";
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($q, $this->connection);
|
||||||
return $this->mysql_fetch_all($result);
|
return $this->mysqli_fetch_all($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function search_email($email){
|
function search_email($email){
|
||||||
$q = "SELECT id,email FROM ".TB_PREFIX."users WHERE `email` LIKE '%$email%' and username != 'support'";
|
$q = "SELECT id,email FROM ".TB_PREFIX."users WHERE `email` LIKE '%$email%' and username != 'support'";
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($q, $this->connection);
|
||||||
return $this->mysql_fetch_all($result);
|
return $this->mysqli_fetch_all($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function search_village($village){
|
function search_village($village){
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `name` LIKE '%$village%' or `wref` LIKE '%$village%'";
|
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `name` LIKE '%$village%' or `wref` LIKE '%$village%'";
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($q, $this->connection);
|
||||||
return $this->mysql_fetch_all($result);
|
return $this->mysqli_fetch_all($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function search_alliance($alliance){
|
function search_alliance($alliance){
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."alidata WHERE `name` LIKE '%$alliance%' or `tag` LIKE '%$alliance%' or `id` LIKE '%$alliance%'";
|
$q = "SELECT * FROM ".TB_PREFIX."alidata WHERE `name` LIKE '%$alliance%' or `tag` LIKE '%$alliance%' or `id` LIKE '%$alliance%'";
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($q, $this->connection);
|
||||||
return $this->mysql_fetch_all($result);
|
return $this->mysqli_fetch_all($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function search_ip($ip){
|
function search_ip($ip){
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."login_log WHERE `ip` LIKE '%$ip%'";
|
$q = "SELECT * FROM ".TB_PREFIX."login_log WHERE `ip` LIKE '%$ip%'";
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($q, $this->connection);
|
||||||
return $this->mysql_fetch_all($result);
|
return $this->mysqli_fetch_all($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function search_banned(){
|
function search_banned(){
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."banlist where active = '1'";
|
$q = "SELECT * FROM ".TB_PREFIX."banlist where active = '1'";
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($q, $this->connection);
|
||||||
return $this->mysql_fetch_all($result);
|
return $this->mysqli_fetch_all($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Del_banned(){
|
function Del_banned(){
|
||||||
//$q = "SELECT * FROM ".TB_PREFIX."banlist";
|
//$q = "SELECT * FROM ".TB_PREFIX."banlist";
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($q, $this->connection);
|
||||||
return $this->mysql_fetch_all($result);
|
return $this->mysqli_fetch_all($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************
|
/***************************
|
||||||
Function to process MYSQLi->fetch_all (Only exist in MYSQL)
|
Function to process MYSQLi->fetch_all (Only exist in MYSQL)
|
||||||
References: Result
|
References: Result
|
||||||
***************************/
|
***************************/
|
||||||
function mysql_fetch_all($result) {
|
function mysqli_fetch_all($result) {
|
||||||
$all = array();
|
$all = array();
|
||||||
if($result) {
|
if($result) {
|
||||||
while ($row = mysql_fetch_assoc($result)){ $all[] = $row; }
|
while ($row = mysqli_fetch_assoc($result)){ $all[] = $row; }
|
||||||
return $all;
|
return $all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function query_return($q) {
|
function query_return($q) {
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysqli_query($q, $this->connection);
|
||||||
return $this->mysql_fetch_all($result);
|
return $this->mysqli_fetch_all($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************
|
/***************************
|
||||||
@@ -399,7 +400,7 @@ class adm_DB {
|
|||||||
References: Query
|
References: Query
|
||||||
***************************/
|
***************************/
|
||||||
function query($query) {
|
function query($query) {
|
||||||
return mysql_query($query, $this->connection);
|
return mysqli_query($query, $this->connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTypeLevel($tid,$vid) {
|
public function getTypeLevel($tid,$vid) {
|
||||||
@@ -519,8 +520,8 @@ class adm_DB {
|
|||||||
|
|
||||||
if( intval($enforce['hero']) > 0){
|
if( intval($enforce['hero']) > 0){
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$from['owner']."";
|
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$from['owner']."";
|
||||||
$result = mysql_query($q);
|
$result = mysqli_query($q);
|
||||||
$hero_f=mysql_fetch_array($result);
|
$hero_f=mysqli_fetch_array($result);
|
||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -454,8 +454,8 @@
|
|||||||
|
|
||||||
private function updateMax($leader) {
|
private function updateMax($leader) {
|
||||||
global $bid18, $database;
|
global $bid18, $database;
|
||||||
$q = mysql_query("SELECT * FROM " . TB_PREFIX . "alidata where leader = $leader");
|
$q = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "alidata where leader = $leader");
|
||||||
if(mysql_num_rows($q) > 0){
|
if(mysqli_num_rows($q) > 0){
|
||||||
$villages = $database->getVillagesID2($leader);
|
$villages = $database->getVillagesID2($leader);
|
||||||
$max = 0;
|
$max = 0;
|
||||||
foreach($villages as $village){
|
foreach($villages as $village){
|
||||||
|
|||||||
+212
-212
File diff suppressed because it is too large
Load Diff
+15
-15
@@ -659,8 +659,8 @@ class Battle {
|
|||||||
|
|
||||||
if (isset($units['Att_unit']['hero']) && $units['Att_unit']['hero'] >0){
|
if (isset($units['Att_unit']['hero']) && $units['Att_unit']['hero'] >0){
|
||||||
|
|
||||||
$_result=mysql_query("select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$atkhero['heroid']."'");
|
$_result=mysqli_query($GLOBALS['link'],"select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$atkhero['heroid']."'");
|
||||||
$fdb = mysql_fetch_array($_result);
|
$fdb = mysqli_fetch_array($_result);
|
||||||
$hero_id=$fdb['heroid'];
|
$hero_id=$fdb['heroid'];
|
||||||
$hero_health=$fdb['health'];
|
$hero_health=$fdb['health'];
|
||||||
$damage_health=round(100*$result[1]);
|
$damage_health=round(100*$result[1]);
|
||||||
@@ -668,10 +668,10 @@ class Battle {
|
|||||||
if ($hero_health<=$damage_health or $damage_health>90){
|
if ($hero_health<=$damage_health or $damage_health>90){
|
||||||
//hero die
|
//hero die
|
||||||
$result['casualties_attacker']['11'] = 1;
|
$result['casualties_attacker']['11'] = 1;
|
||||||
mysql_query("update " . TB_PREFIX . "hero set `dead`='1' where `heroid`='".$hero_id."'");
|
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `dead`='1' where `heroid`='".$hero_id."'");
|
||||||
mysql_query("update " . TB_PREFIX . "hero set `health`='0' where `heroid`='".$hero_id."'");
|
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `health`='0' where `heroid`='".$hero_id."'");
|
||||||
}else{
|
}else{
|
||||||
mysql_query("update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'");
|
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($_result,$fdb,$hero_id,$hero_health,$damage_health);
|
unset($_result,$fdb,$hero_id,$hero_health,$damage_health);
|
||||||
@@ -679,19 +679,19 @@ class Battle {
|
|||||||
|
|
||||||
if (isset($units['Def_unit']['hero']) && $units['Def_unit']['hero'] >0){
|
if (isset($units['Def_unit']['hero']) && $units['Def_unit']['hero'] >0){
|
||||||
|
|
||||||
$_result=mysql_query("select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$defenderhero['heroid']."'");
|
$_result=mysqli_query($GLOBALS['link'],"select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$defenderhero['heroid']."'");
|
||||||
$fdb = mysql_fetch_array($_result);
|
$fdb = mysqli_fetch_array($_result);
|
||||||
$hero_id=$fdb['heroid'];
|
$hero_id=$fdb['heroid'];
|
||||||
$hero_health=$fdb['health'];
|
$hero_health=$fdb['health'];
|
||||||
$damage_health=round(100*$result[2]);
|
$damage_health=round(100*$result[2]);
|
||||||
if ($hero_health<=$damage_health or $damage_health>90){
|
if ($hero_health<=$damage_health or $damage_health>90){
|
||||||
//hero die
|
//hero die
|
||||||
$result['deadherodef'] = 1;
|
$result['deadherodef'] = 1;
|
||||||
mysql_query("update " . TB_PREFIX . "hero set `dead`='1' where `heroid`='".$hero_id."'");
|
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `dead`='1' where `heroid`='".$hero_id."'");
|
||||||
mysql_query("update " . TB_PREFIX . "hero set `health`='0' where `heroid`='".$hero_id."'");
|
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `health`='0' where `heroid`='".$hero_id."'");
|
||||||
}else{
|
}else{
|
||||||
$result['deadherodef'] = 0;
|
$result['deadherodef'] = 0;
|
||||||
mysql_query("update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'");
|
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($_result,$fdb,$hero_id,$hero_health,$damage_health);
|
unset($_result,$fdb,$hero_id,$hero_health,$damage_health);
|
||||||
@@ -703,19 +703,19 @@ class Battle {
|
|||||||
if(!empty($heroarray)) { reset($heroarray); }
|
if(!empty($heroarray)) { reset($heroarray); }
|
||||||
$Reinforcer = $database->getVillageField($defenders['from'],"owner");
|
$Reinforcer = $database->getVillageField($defenders['from'],"owner");
|
||||||
$heroarraydefender = $this->getBattleHero($Reinforcer);
|
$heroarraydefender = $this->getBattleHero($Reinforcer);
|
||||||
$_result=mysql_query("select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$heroarraydefender['heroid']."'");
|
$_result=mysqli_query($GLOBALS['link'],"select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$heroarraydefender['heroid']."'");
|
||||||
$fdb = mysql_fetch_array($_result);
|
$fdb = mysqli_fetch_array($_result);
|
||||||
$hero_id=$fdb['heroid'];
|
$hero_id=$fdb['heroid'];
|
||||||
$hero_health=$fdb['health'];
|
$hero_health=$fdb['health'];
|
||||||
$damage_health=round(100*$result[2]);
|
$damage_health=round(100*$result[2]);
|
||||||
if ($hero_health<=$damage_health or $damage_health>90){
|
if ($hero_health<=$damage_health or $damage_health>90){
|
||||||
//hero die
|
//hero die
|
||||||
$result['deadheroref'][$defenders['id']] = 1;
|
$result['deadheroref'][$defenders['id']] = 1;
|
||||||
mysql_query("update " . TB_PREFIX . "hero set `dead`='1' where `heroid`='".$hero_id."'");
|
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `dead`='1' where `heroid`='".$hero_id."'");
|
||||||
mysql_query("update " . TB_PREFIX . "hero set `health`='0' where `heroid`='".$hero_id."'");
|
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `health`='0' where `heroid`='".$hero_id."'");
|
||||||
}else{
|
}else{
|
||||||
$result['deadheroref'][$defenders['id']] = 0;
|
$result['deadheroref'][$defenders['id']] = 0;
|
||||||
mysql_query("update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'");
|
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -362,7 +362,7 @@ if (!isset($SAJAX_INCLUDED)) {
|
|||||||
$alliance = $session->alliance;
|
$alliance = $session->alliance;
|
||||||
$now = time();
|
$now = time();
|
||||||
echo $q = "INSERT into ".TB_PREFIX."chat (id_user,name,alli,date,msg) values ('$id_user','$name','$alliance','$now','$msg')";
|
echo $q = "INSERT into ".TB_PREFIX."chat (id_user,name,alli,date,msg) values ('$id_user','$name','$alliance','$now','$msg')";
|
||||||
mysql_query($q, $database->connection);
|
mysqli_query($GLOBALS['link'],$q);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,8 +370,8 @@ if (!isset($SAJAX_INCLUDED)) {
|
|||||||
global $session,$database;
|
global $session,$database;
|
||||||
|
|
||||||
$alliance = $session->alliance;
|
$alliance = $session->alliance;
|
||||||
$query = mysql_query("select * from ".TB_PREFIX."chat where alli='$alliance' order by id desc limit 0,13");
|
$query = mysqli_query($GLOBALS['link'],"select * from ".TB_PREFIX."chat where alli='$alliance' order by id desc limit 0,13");
|
||||||
while ($r = mysql_fetch_array($query)) {
|
while ($r = mysqli_fetch_array($query)) {
|
||||||
$dates = date("g:i",$r[date]);
|
$dates = date("g:i",$r[date]);
|
||||||
$data .= "[{$dates}] <a href='spieler.php?uid={$r['id_user']}'>{$r['name']}</a>: {$r[msg]} <br>";
|
$data .= "[{$dates}] <a href='spieler.php?uid={$r['id_user']}'>{$r['name']}</a>: {$r[msg]} <br>";
|
||||||
}
|
}
|
||||||
|
|||||||
+3867
-17
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
#################################################################################
|
|
||||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
|
||||||
## --------------------------------------------------------------------------- ##
|
|
||||||
## Filename 404.tpl ##
|
|
||||||
## Developed by: aggenkeech ##
|
|
||||||
## License: TravianX Project ##
|
|
||||||
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
|
|
||||||
## ##
|
|
||||||
#################################################################################
|
|
||||||
?>
|
|
||||||
<div style="margin-top: 50px;">
|
|
||||||
<center>
|
|
||||||
<h1>404 - File not found</h1>
|
|
||||||
<img src="../../gpack/travian_default/img/misc/404.gif" title="Not Found" alt="Not Found"><br />
|
|
||||||
<p>We looked 404 times already but can't find anything, Not even an X marking the spot.</p>
|
|
||||||
<p>This system is not complete yet. So the page probably does not exist.</p><br>
|
|
||||||
</center>
|
|
||||||
</div>
|
|
||||||
@@ -210,8 +210,8 @@ class Message {
|
|||||||
global $database,$session;
|
global $database,$session;
|
||||||
for($i = 1; $i <= 10; $i++) {
|
for($i = 1; $i <= 10; $i++) {
|
||||||
if(isset($post['n' . $i])) {
|
if(isset($post['n' . $i])) {
|
||||||
$message1 = mysql_query("SELECT * FROM " . TB_PREFIX . "mdata where id = ".$post['n' . $i]."");
|
$message1 = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "mdata where id = ".$post['n' . $i]."");
|
||||||
$message = mysql_fetch_array($message1);
|
$message = mysqli_fetch_array($message1);
|
||||||
if($message['target'] == $session->uid && $message['owner'] == $session->uid){
|
if($message['target'] == $session->uid && $message['owner'] == $session->uid){
|
||||||
$database->getMessage($post['n' . $i], 8);
|
$database->getMessage($post['n' . $i], 8);
|
||||||
}else if($message['target'] == $session->uid){
|
}else if($message['target'] == $session->uid){
|
||||||
@@ -321,16 +321,16 @@ 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 * FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".time()." - 60";
|
||||||
$res = mysql_query($q) or die(mysql_error(). " query ".$q);
|
$res = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error(). " query ".$q);
|
||||||
$flood = mysql_num_rows($res);
|
$flood = mysqli_num_rows($res);
|
||||||
if($flood > 5)
|
if($flood > 5)
|
||||||
return; //flood
|
return; //flood
|
||||||
|
|
||||||
// Vulnerability closed by Shadow
|
// Vulnerability closed by Shadow
|
||||||
|
|
||||||
$allmembersQ = mysql_query("SELECT id FROM ".TB_PREFIX."users WHERE alliance='".$session->alliance."'");
|
$allmembersQ = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users WHERE alliance='".$session->alliance."'");
|
||||||
$userally = $database->getUserField($session->uid,"alliance",0);
|
$userally = $database->getUserField($session->uid,"alliance",0);
|
||||||
$permission=mysql_fetch_array(mysql_query("SELECT opt7 FROM ".TB_PREFIX."ali_permission WHERE uid='".$session->uid."'"));
|
$permission=mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT opt7 FROM ".TB_PREFIX."ali_permission WHERE uid='".$session->uid."'"));
|
||||||
if(WORD_CENSOR) {
|
if(WORD_CENSOR) {
|
||||||
$topic = $this->wordCensor($topic);
|
$topic = $this->wordCensor($topic);
|
||||||
$text = $this->wordCensor($text);
|
$text = $this->wordCensor($text);
|
||||||
@@ -395,7 +395,7 @@ class Message {
|
|||||||
}
|
}
|
||||||
if($permission[opt7]==1){
|
if($permission[opt7]==1){
|
||||||
if ($userally != 0) {
|
if ($userally != 0) {
|
||||||
while ($allmembers = mysql_fetch_array($allmembersQ)) {
|
while ($allmembers = mysqli_fetch_array($allmembersQ)) {
|
||||||
$database->sendMessage($allmembers[id],$session->uid,htmlspecialchars(addslashes($topic)),htmlspecialchars(addslashes($text)),0,$alliance,$player,$coor,$report);
|
$database->sendMessage($allmembers[id],$session->uid,htmlspecialchars(addslashes($topic)),htmlspecialchars(addslashes($text)),0,$alliance,$player,$coor,$report);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -410,8 +410,8 @@ 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 * FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".time()." - 60";
|
||||||
$res = mysql_query($q) or die(mysql_error(). " query ".$q);
|
$res = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error(). " query ".$q);
|
||||||
$flood = mysql_num_rows($res);
|
$flood = mysqli_num_rows($res);
|
||||||
if($flood > 5)
|
if($flood > 5)
|
||||||
return; //flood
|
return; //flood
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ class Profile {
|
|||||||
if($set){
|
if($set){
|
||||||
unset($_SESSION['wid']);
|
unset($_SESSION['wid']);
|
||||||
$database->activeModify(addslashes($session->username),1);
|
$database->activeModify(addslashes($session->username),1);
|
||||||
$database->UpdateOnline("logout") or die(mysql_error());
|
$database->UpdateOnline("logout") or die(mysqli_error());
|
||||||
$session->Logout();
|
$session->Logout();
|
||||||
header("Location: login.php");
|
header("Location: login.php");
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -13,14 +13,14 @@
|
|||||||
//heef npc uitzondering omdat die met speciaal $_post werken
|
//heef npc uitzondering omdat die met speciaal $_post werken
|
||||||
if(isset($_POST)){
|
if(isset($_POST)){
|
||||||
if(!isset($_POST['ft'])){
|
if(!isset($_POST['ft'])){
|
||||||
$_POST = @array_map('mysql_real_escape_string', $_POST);
|
//$_POST = @array_map('mysqli_real_escape_string', $_POST);
|
||||||
$_POST = array_map('htmlspecialchars', $_POST);
|
$_POST = array_map('htmlspecialchars', $_POST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$rsargs=$_GET['rsargs'];
|
$rsargs=$_GET['rsargs'];
|
||||||
$_GET = array_map('mysql_real_escape_string', $_GET);
|
//$_GET = array_map('mysqli_real_escape_string', $_GET);
|
||||||
$_GET = array_map('htmlspecialchars', $_GET);
|
$_GET = array_map('htmlspecialchars', $_GET);
|
||||||
$_GET['rsargs']=$rsargs;
|
$_GET['rsargs']=$rsargs;
|
||||||
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
|
//$_COOKIE = array_map('mysqli_real_escape_string', $_COOKIE);
|
||||||
$_COOKIE = array_map('htmlspecialchars', $_COOKIE);
|
$_COOKIE = array_map('htmlspecialchars', $_COOKIE);
|
||||||
?>
|
?>
|
||||||
+90
-91
@@ -19,25 +19,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 * FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8") . "";
|
||||||
$users2 = mysql_num_rows(mysql_query($users));
|
$users2 = mysqli_num_rows(mysqli_query($GLOBALS['link'],$users));
|
||||||
$users3 = $users2+1;
|
$users3 = $users2+1;
|
||||||
if(count($ranking) > 0) {
|
if(count($ranking) > 0) {
|
||||||
for($i=0;$i<($users3);$i++) {
|
for($i=0;$i<($users3);$i++) {
|
||||||
if( isset( $ranking[$i]['userid'] ) )
|
if( isset( $ranking[$i]['userid'] ) ) {
|
||||||
{
|
if($ranking[$i]['userid'] == $id && $ranking[$i] != "pad") {
|
||||||
if($ranking[$i]['userid'] == $id && $ranking[$i] != "pad") {
|
$myrank = $i;
|
||||||
$myrank = $i;
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return $myrank;
|
return $myrank;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function procRankReq($get) {
|
public function procRankReq($get) {
|
||||||
global $village, $session, $database;
|
global $village, $session;
|
||||||
if(isset($get['id'])) {
|
if(isset($get['id'])) {
|
||||||
switch($get['id']) {
|
switch($get['id']) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -219,55 +218,55 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function procRankArray() {
|
public function procRankArray() {
|
||||||
global $database, $multisort;
|
global $multisort;
|
||||||
if($database->countUser() > 0){
|
if($GLOBALS['db']->countUser() > 0){
|
||||||
$holder = array();
|
$holder = array();
|
||||||
if(SHOW_NATARS == True){
|
if(SHOW_NATARS == True){
|
||||||
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.oldrank oldrank, " . TB_PREFIX . "users.alliance alliance, (
|
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.oldrank oldrank, " . TB_PREFIX . "users.alliance alliance, (
|
||||||
|
|
||||||
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
||||||
FROM " . TB_PREFIX . "vdata
|
FROM " . TB_PREFIX . "vdata
|
||||||
WHERE " . TB_PREFIX . "vdata.owner = userid
|
WHERE " . TB_PREFIX . "vdata.owner = userid
|
||||||
)totalpop, (
|
)totalpop, (
|
||||||
|
|
||||||
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
|
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
|
||||||
FROM " . TB_PREFIX . "vdata
|
FROM " . TB_PREFIX . "vdata
|
||||||
WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99
|
WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99
|
||||||
)totalvillages, (
|
)totalvillages, (
|
||||||
|
|
||||||
SELECT " . TB_PREFIX . "alidata.tag
|
SELECT " . TB_PREFIX . "alidata.tag
|
||||||
FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users
|
FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users
|
||||||
WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance
|
WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance
|
||||||
AND " . TB_PREFIX . "users.id = userid
|
AND " . TB_PREFIX . "users.id = userid
|
||||||
)allitag
|
)allitag
|
||||||
FROM " . TB_PREFIX . "users
|
FROM " . TB_PREFIX . "users
|
||||||
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
||||||
AND " . TB_PREFIX . "users.tribe <= 5 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
AND " . TB_PREFIX . "users.tribe <= 5 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
||||||
}else{
|
} else {
|
||||||
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.oldrank oldrank, " . TB_PREFIX . "users.alliance alliance, (
|
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.oldrank oldrank, " . TB_PREFIX . "users.alliance alliance, (
|
||||||
|
|
||||||
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
||||||
FROM " . TB_PREFIX . "vdata
|
FROM " . TB_PREFIX . "vdata
|
||||||
WHERE " . TB_PREFIX . "vdata.owner = userid
|
WHERE " . TB_PREFIX . "vdata.owner = userid
|
||||||
)totalpop, (
|
)totalpop, (
|
||||||
|
|
||||||
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
|
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
|
||||||
FROM " . TB_PREFIX . "vdata
|
FROM " . TB_PREFIX . "vdata
|
||||||
WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99
|
WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99
|
||||||
)totalvillages, (
|
)totalvillages, (
|
||||||
|
|
||||||
SELECT " . TB_PREFIX . "alidata.tag
|
SELECT " . TB_PREFIX . "alidata.tag
|
||||||
FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users
|
FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users
|
||||||
WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance
|
WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance
|
||||||
AND " . TB_PREFIX . "users.id = userid
|
AND " . TB_PREFIX . "users.id = userid
|
||||||
)allitag
|
)allitag
|
||||||
FROM " . TB_PREFIX . "users
|
FROM " . TB_PREFIX . "users
|
||||||
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
||||||
AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = (mysql_query($q));
|
$result = (mysqli_query($GLOBALS['link'],$q));
|
||||||
while($row = mysql_fetch_assoc($result)) {
|
while($row = mysqli_fetch_assoc($result)) {
|
||||||
$datas[] = $row;
|
$datas[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,13 +290,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function procRankRaceArray($race) {
|
public function procRankRaceArray($race) {
|
||||||
global $database, $multisort;
|
global $multisort;
|
||||||
//$array = $database->getRanking();
|
//$array = $GLOBALS['db']->getRanking();
|
||||||
$holder = array();
|
$holder = array();
|
||||||
//$value['totalvillage'] = count($database->getVillagesID($value['id']));
|
//$value['totalvillage'] = count($GLOBALS['db']->getVillagesID($value['id']));
|
||||||
//$value['totalvillage'] = count($database->getVillagesID($value['id']));
|
//$value['totalvillage'] = count($GLOBALS['db']->getVillagesID($value['id']));
|
||||||
//$value['totalpop'] = $database->getVSumField($value['id'],"pop");
|
//$value['totalpop'] = $GLOBALS['db']->getVSumField($value['id'],"pop");
|
||||||
//$value['aname'] = $database->getAllianceName($value['alliance']);
|
//$value['aname'] = $GLOBALS['db']->getAllianceName($value['alliance']);
|
||||||
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.tribe tribe, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, (
|
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.tribe tribe, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, (
|
||||||
|
|
||||||
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
||||||
@@ -320,12 +319,12 @@
|
|||||||
ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
||||||
|
|
||||||
|
|
||||||
$result = (mysql_query($q));
|
$result = (mysqli_query($GLOBALS['link'],$q));
|
||||||
while($row = mysql_fetch_assoc($result)) {
|
while($row = mysqli_fetch_assoc($result)) {
|
||||||
$datas[] = $row;
|
$datas[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mysql_num_rows($result)) {
|
if(mysqli_num_rows($result)) {
|
||||||
|
|
||||||
|
|
||||||
foreach($datas as $result) {
|
foreach($datas as $result) {
|
||||||
@@ -356,12 +355,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function procAttRankArray() {
|
public function procAttRankArray() {
|
||||||
global $database, $multisort;
|
global $multisort;
|
||||||
//$array = $database->getRanking();
|
//$array = $GLOBALS['db']->getRanking();
|
||||||
$holder = array();
|
$holder = array();
|
||||||
|
|
||||||
//$value['totalvillage'] = count($database->getVillagesID($value['id']));
|
//$value['totalvillage'] = count($GLOBALS['db']->getVillagesID($value['id']));
|
||||||
//$value['totalpop'] = $database->getVSumField($value['id'],"pop");
|
//$value['totalpop'] = $GLOBALS['db']->getVSumField($value['id'],"pop");
|
||||||
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.apall, (
|
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.apall, (
|
||||||
|
|
||||||
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
|
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
|
||||||
@@ -376,8 +375,8 @@
|
|||||||
FROM " . TB_PREFIX . "users
|
FROM " . TB_PREFIX . "users
|
||||||
WHERE " . TB_PREFIX . "users.apall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3
|
WHERE " . TB_PREFIX . "users.apall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3
|
||||||
ORDER BY " . TB_PREFIX . "users.apall DESC, pop DESC, userid DESC";
|
ORDER BY " . TB_PREFIX . "users.apall DESC, pop DESC, userid DESC";
|
||||||
$result = mysql_query($q) or die(mysql_error());
|
$result = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error());
|
||||||
while($row = mysql_Fetch_assoc($result)) {
|
while($row = mysqli_Fetch_assoc($result)) {
|
||||||
$datas[] = $row;
|
$datas[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,8 +400,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function procDefRankArray() {
|
public function procDefRankArray() {
|
||||||
//global $database, $multisort;
|
//global $GLOBALS['db'], $multisort;
|
||||||
//$array = $database->getRanking();
|
//$array = $GLOBALS['db']->getRanking();
|
||||||
$holder = array();
|
$holder = array();
|
||||||
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.dpall, (
|
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.dpall, (
|
||||||
|
|
||||||
@@ -418,8 +417,8 @@
|
|||||||
FROM " . TB_PREFIX . "users
|
FROM " . TB_PREFIX . "users
|
||||||
WHERE " . TB_PREFIX . "users.dpall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3
|
WHERE " . TB_PREFIX . "users.dpall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3
|
||||||
ORDER BY " . TB_PREFIX . "users.dpall DESC, pop DESC, userid DESC";
|
ORDER BY " . TB_PREFIX . "users.dpall DESC, pop DESC, userid DESC";
|
||||||
$result = mysql_query($q) or die(mysql_error());
|
$result = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error());
|
||||||
while($row = mysql_Fetch_assoc($result)) {
|
while($row = mysqli_Fetch_assoc($result)) {
|
||||||
$datas[] = $row;
|
$datas[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -443,14 +442,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function procVRankArray() {
|
public function procVRankArray() {
|
||||||
global $database, $multisort;
|
global $multisort;
|
||||||
$array = $database->getVRanking();
|
$array = $GLOBALS['db']->getVRanking();
|
||||||
$holder = array();
|
$holder = array();
|
||||||
foreach($array as $value) {
|
foreach($array as $value) {
|
||||||
$coor = $database->getCoor($value['wref']);
|
$coor = $GLOBALS['db']->getCoor($value['wref']);
|
||||||
$value['x'] = $coor['x'];
|
$value['x'] = $coor['x'];
|
||||||
$value['y'] = $coor['y'];
|
$value['y'] = $coor['y'];
|
||||||
$value['user'] = $database->getUserField($value['owner'], "username", 0);
|
$value['user'] = $GLOBALS['db']->getUserField($value['owner'], "username", 0);
|
||||||
|
|
||||||
array_push($holder, $value);
|
array_push($holder, $value);
|
||||||
}
|
}
|
||||||
@@ -463,15 +462,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function procARankArray() {
|
public function procARankArray() {
|
||||||
global $database, $multisort;
|
global $multisort;
|
||||||
$array = $database->getARanking();
|
$array = $GLOBALS['db']->getARanking();
|
||||||
$holder = array();
|
$holder = array();
|
||||||
|
|
||||||
foreach($array as $value) {
|
foreach($array as $value) {
|
||||||
$memberlist = $database->getAllMember($value['id']);
|
$memberlist = $GLOBALS['db']->getAllMember($value['id']);
|
||||||
$totalpop = 0;
|
$totalpop = 0;
|
||||||
foreach($memberlist as $member) {
|
foreach($memberlist as $member) {
|
||||||
$totalpop += $database->getVSumField($member['id'], "pop");
|
$totalpop += $GLOBALS['db']->getVSumField($member['id'], "pop");
|
||||||
}
|
}
|
||||||
$value['players'] = count($memberlist);
|
$value['players'] = count($memberlist);
|
||||||
$value['totalpop'] = $totalpop;
|
$value['totalpop'] = $totalpop;
|
||||||
@@ -492,11 +491,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function procHeroRankArray() {
|
public function procHeroRankArray() {
|
||||||
global $database, $multisort;
|
global $multisort;
|
||||||
$array = $database->getHeroRanking();
|
$array = $GLOBALS['db']->getHeroRanking();
|
||||||
$holder = array();
|
$holder = array();
|
||||||
foreach($array as $value) {
|
foreach($array as $value) {
|
||||||
$value['owner'] = $database->getUserField($value['uid'], "username", 0);
|
$value['owner'] = $GLOBALS['db']->getUserField($value['uid'], "username", 0);
|
||||||
$value['level'];
|
$value['level'];
|
||||||
$value['name'];
|
$value['name'];
|
||||||
$value['uid'];
|
$value['uid'];
|
||||||
@@ -512,11 +511,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function procAAttRankArray() {
|
public function procAAttRankArray() {
|
||||||
global $database, $multisort;
|
global $multisort;
|
||||||
$array = $database->getARanking();
|
$array = $GLOBALS['db']->getARanking();
|
||||||
$holder = array();
|
$holder = array();
|
||||||
foreach($array as $value) {
|
foreach($array as $value) {
|
||||||
$memberlist = $database->getAllMember($value['id']);
|
$memberlist = $GLOBALS['db']->getAllMember($value['id']);
|
||||||
$totalap = 0;
|
$totalap = 0;
|
||||||
foreach($memberlist as $member) {
|
foreach($memberlist as $member) {
|
||||||
$totalap += $member['ap'];
|
$totalap += $member['ap'];
|
||||||
@@ -540,11 +539,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function procADefRankArray() {
|
public function procADefRankArray() {
|
||||||
global $database, $multisort;
|
global $multisort;
|
||||||
$array = $database->getARanking();
|
$array = $GLOBALS['db']->getARanking();
|
||||||
$holder = array();
|
$holder = array();
|
||||||
foreach($array as $value) {
|
foreach($array as $value) {
|
||||||
$memberlist = $database->getAllMember($value['id']);
|
$memberlist = $GLOBALS['db']->getAllMember($value['id']);
|
||||||
$totaldp = 0;
|
$totaldp = 0;
|
||||||
foreach($memberlist as $member) {
|
foreach($memberlist as $member) {
|
||||||
$totaldp += $member['dp'];
|
$totaldp += $member['dp'];
|
||||||
|
|||||||
+20
-17
@@ -60,7 +60,7 @@ class Session {
|
|||||||
private $userarray = array();
|
private $userarray = array();
|
||||||
var $villages = array();
|
var $villages = array();
|
||||||
|
|
||||||
function Session() {
|
function __construct() {
|
||||||
global $database; //TienTN fix
|
global $database; //TienTN fix
|
||||||
|
|
||||||
$this->time = time();
|
$this->time = time();
|
||||||
@@ -88,25 +88,25 @@ class Session {
|
|||||||
$_SESSION['checker'] = $generator->generateRandStr(3);
|
$_SESSION['checker'] = $generator->generateRandStr(3);
|
||||||
$_SESSION['mchecker'] = $generator->generateRandStr(5);
|
$_SESSION['mchecker'] = $generator->generateRandStr(5);
|
||||||
$_SESSION['qst'] = $database->getUserField($_SESSION['username'], "quest", 1);
|
$_SESSION['qst'] = $database->getUserField($_SESSION['username'], "quest", 1);
|
||||||
$result = mysql_query("SELECT village_select FROM `". TB_PREFIX."users` WHERE `username`='".$_SESSION['username']."'");
|
$result = mysqli_query($GLOBALS['link'],"SELECT village_select FROM `". TB_PREFIX."users` WHERE `username`='".$_SESSION['username']."'");
|
||||||
$dbarray = mysql_fetch_assoc($result);
|
$dbarray = mysqli_fetch_assoc($result);
|
||||||
$selected_village=$dbarray['village_select'];
|
$selected_village=$dbarray['village_select'];
|
||||||
if(!isset($_SESSION['wid'])) {
|
if(!isset($_SESSION['wid'])) {
|
||||||
if($selected_village!='') {
|
if($selected_village!='') {
|
||||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = '.$selected_village);
|
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = '.$selected_village);
|
||||||
}else{
|
}else{
|
||||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $database->getUserField($_SESSION['username'], "id", 1) . ' LIMIT 1');
|
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $database->getUserField($_SESSION['username'], "id", 1) . ' LIMIT 1');
|
||||||
}
|
}
|
||||||
$data = mysql_fetch_assoc($query);
|
$data = mysqli_fetch_assoc($query);
|
||||||
$_SESSION['wid'] = $data['wref'];
|
$_SESSION['wid'] = $data['wref'];
|
||||||
} else
|
} else
|
||||||
if($_SESSION['wid'] == '') {
|
if($_SESSION['wid'] == '') {
|
||||||
if($selected_village!='') {
|
if($selected_village!='') {
|
||||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = '.$selected_village);
|
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = '.$selected_village);
|
||||||
}else{
|
}else{
|
||||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $database->getUserField($_SESSION['username'], "id", 1) . ' LIMIT 1');
|
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $database->getUserField($_SESSION['username'], "id", 1) . ' LIMIT 1');
|
||||||
}
|
}
|
||||||
$data = mysql_fetch_assoc($query);
|
$data = mysqli_fetch_assoc($query);
|
||||||
$_SESSION['wid'] = $data['wref'];
|
$_SESSION['wid'] = $data['wref'];
|
||||||
}
|
}
|
||||||
$this->PopulateVar();
|
$this->PopulateVar();
|
||||||
@@ -157,20 +157,23 @@ class Session {
|
|||||||
***************************/
|
***************************/
|
||||||
|
|
||||||
function CheckHeroReal () {
|
function CheckHeroReal () {
|
||||||
global $database;
|
global $database,$link;
|
||||||
$hero=0;
|
$hero=0;
|
||||||
foreach($this->villages as $myvill){
|
foreach($this->villages as $myvill){
|
||||||
$q1 = "SELECT SUM(hero) from " . TB_PREFIX . "enforcement where `from` = ".$myvill; // check if hero is send as reinforcement
|
$q1 = "SELECT SUM(hero) from " . TB_PREFIX . "enforcement where `from` = ".$myvill; // check if hero is send as reinforcement
|
||||||
$result1 = mysql_query($q1, $database->connection);
|
$result1 = mysqli_query($GLOBALS['link'],$q1);
|
||||||
$he1=mysql_fetch_array($result1);
|
if(mysqli_num_rows($result1) != 0) {
|
||||||
$hero+=$he1[0];
|
$he1=mysqli_fetch_array($result1);
|
||||||
|
$hero+=$he1[0];
|
||||||
|
}
|
||||||
|
|
||||||
$q2 = "SELECT SUM(hero) from " . TB_PREFIX . "units where `vref` = ".$myvill; // check if hero is on my account (all villages)
|
$q2 = "SELECT SUM(hero) from " . TB_PREFIX . "units where `vref` = ".$myvill; // check if hero is on my account (all villages)
|
||||||
$result2 = mysql_query($q2, $database->connection);
|
$result2 = mysqli_query($GLOBALS['link'],$q2);
|
||||||
$he2=mysql_fetch_array($result2);
|
$he2=mysqli_fetch_array($result2);
|
||||||
$hero+=$he2[0];
|
$hero+=$he2[0];
|
||||||
$q3 = "SELECT SUM(t11) from " . TB_PREFIX . "prisoners where `from` = ".$myvill; // check if hero is prisoner
|
$q3 = "SELECT SUM(t11) from " . TB_PREFIX . "prisoners where `from` = ".$myvill; // check if hero is prisoner
|
||||||
$result3 = mysql_query($q3, $database->connection);
|
$result3 = mysqli_query($GLOBALS['link'],$q3);
|
||||||
$he3=mysql_fetch_array($result3);
|
$he3=mysqli_fetch_array($result3);
|
||||||
$hero+=$he3[0];
|
$hero+=$he3[0];
|
||||||
$hero+=$database->HeroNotInVil($myvill); // check if hero is not in village (come back from attack , raid , etc.)
|
$hero+=$database->HeroNotInVil($myvill); // check if hero is not in village (come back from attack , raid , etc.)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,13 +148,13 @@ class Technology {
|
|||||||
$controlloTruppeInRinforzo = $database->getEnforceControllTroops($village->wid);
|
$controlloTruppeInRinforzo = $database->getEnforceControllTroops($village->wid);
|
||||||
for($i=1;$i<=50;$i++) {
|
for($i=1;$i<=50;$i++) {
|
||||||
if($controlloTruppeInRinforzo['u'.$i] >= "30000000")
|
if($controlloTruppeInRinforzo['u'.$i] >= "30000000")
|
||||||
mysql_query("UPDATE ".TB_PREFIX."enforcement set u".$i." = '0' where vref = $village->wid");
|
mysqli_query("UPDATE ".TB_PREFIX."enforcement set u".$i." = '0' where vref = $village->wid");
|
||||||
}
|
}
|
||||||
//FIX BY Shadow and made by NIKO28
|
//FIX BY Shadow and made by NIKO28
|
||||||
$controlloTruppe = $database->getUnit($village->wid);
|
$controlloTruppe = $database->getUnit($village->wid);
|
||||||
for($i=1;$i<=50;$i++) {
|
for($i=1;$i<=50;$i++) {
|
||||||
if($controlloTruppe['u'.$i] >= "10000000")
|
if($controlloTruppe['u'.$i] >= "10000000")
|
||||||
mysql_query("UPDATE ".TB_PREFIX."units set u".$i." = '0' where vref = $village->wid");
|
mysqli_query("UPDATE ".TB_PREFIX."units set u".$i." = '0' where vref = $village->wid");
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// END FIX
|
// END FIX
|
||||||
@@ -182,7 +182,7 @@ class Technology {
|
|||||||
global $village,$$unit;
|
global $village,$$unit;
|
||||||
$unitarray = $$unit;
|
$unitarray = $$unit;
|
||||||
$res = array();
|
$res = array();
|
||||||
$res = mysql_fetch_assoc(mysql_query("SELECT maxstore, maxcrop, wood, clay, iron, crop FROM ".TB_PREFIX."vdata WHERE wref = ".$village->wid)) or die(mysql_error());
|
$res = mysqli_fetch_assoc(mysqli_query($GLOBALS['link'],"SELECT maxstore, maxcrop, wood, clay, iron, crop FROM ".TB_PREFIX."vdata WHERE wref = ".$village->wid)) or die(mysqli_error());
|
||||||
if ($res['wood'] > $res['maxstore']){$res['wood'] = $res['maxstore'];}
|
if ($res['wood'] > $res['maxstore']){$res['wood'] = $res['maxstore'];}
|
||||||
if ($res['clay'] > $res['maxstore']){$res['clay'] = $res['maxstore'];}
|
if ($res['clay'] > $res['maxstore']){$res['clay'] = $res['maxstore'];}
|
||||||
if ($res['iron'] > $res['maxstore']){$res['iron'] = $res['maxstore'];}
|
if ($res['iron'] > $res['maxstore']){$res['iron'] = $res['maxstore'];}
|
||||||
@@ -208,7 +208,7 @@ class Technology {
|
|||||||
global $village,$$unit;
|
global $village,$$unit;
|
||||||
$unitarray = $$unit;
|
$unitarray = $$unit;
|
||||||
$res = array();
|
$res = array();
|
||||||
$res = mysql_fetch_assoc(mysql_query("SELECT maxstore, maxcrop, wood, clay, iron, crop FROM ".TB_PREFIX."vdata WHERE wref = ".$village->wid)) or die(mysql_error());
|
$res = mysqli_fetch_assoc(mysqli_query($GLOBALS['link'],"SELECT maxstore, maxcrop, wood, clay, iron, crop FROM ".TB_PREFIX."vdata WHERE wref = ".$village->wid)) or die(mysqli_error());
|
||||||
$totalres = $res['wood']+$res['clay']+$res['iron']+$res['crop'];
|
$totalres = $res['wood']+$res['clay']+$res['iron']+$res['crop'];
|
||||||
$totalresunit = ($unitarray['wood'] * ($great?3:1))+($unitarray['clay'] * ($great?3:1))+($unitarray['iron'] * ($great?3:1))+($unitarray['crop'] * ($great?3:1));
|
$totalresunit = ($unitarray['wood'] * ($great?3:1))+($unitarray['clay'] * ($great?3:1))+($unitarray['iron'] * ($great?3:1))+($unitarray['crop'] * ($great?3:1));
|
||||||
$max =round($totalres/$totalresunit);
|
$max =round($totalres/$totalresunit);
|
||||||
@@ -724,7 +724,7 @@ private function trainUnit($unit,$amt,$great=false) {
|
|||||||
global $database,$village;
|
global $database,$village;
|
||||||
$q = "UPDATE ".TB_PREFIX."research SET timestamp=".(time()-1)." WHERE vref = ".$village->wid;
|
$q = "UPDATE ".TB_PREFIX."research SET timestamp=".(time()-1)." WHERE vref = ".$village->wid;
|
||||||
$result = $database->query($q);
|
$result = $database->query($q);
|
||||||
return mysql_affected_rows();
|
return mysqli_affected_rows();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function calculateAvaliable($id,$resarray=array()) {
|
public function calculateAvaliable($id,$resarray=array()) {
|
||||||
|
|||||||
+15
-19
@@ -287,8 +287,8 @@ class Units {
|
|||||||
}
|
}
|
||||||
if( intval($enforce['hero']) > 0){
|
if( intval($enforce['hero']) > 0){
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$from['owner']."";
|
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$from['owner']."";
|
||||||
$result = mysql_query($q);
|
$result = mysqli_query($GLOBALS['link'],$q);
|
||||||
$hero_f=mysql_fetch_array($result);
|
$hero_f=mysqli_fetch_array($result);
|
||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
}else{
|
}else{
|
||||||
@@ -354,13 +354,11 @@ class Units {
|
|||||||
if ($data['u11'] > $village->unitarray['hero'])
|
if ($data['u11'] > $village->unitarray['hero'])
|
||||||
{
|
{
|
||||||
$form->addError("error","You can't send more units than you have");
|
$form->addError("error","You can't send more units than you have");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($data['u11']<0)
|
if($data['u11']<0)
|
||||||
{
|
{
|
||||||
$form->addError("error","You can't send negative units.");
|
$form->addError("error","You can't send negative units.");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if($form->returnErrors() > 0) {
|
if($form->returnErrors() > 0) {
|
||||||
$_SESSION['errorarray'] = $form->getErrors();
|
$_SESSION['errorarray'] = $form->getErrors();
|
||||||
@@ -380,14 +378,14 @@ if($session->access != BANNED){
|
|||||||
array(0,0,0,0,0,0,0,0,0,0,0)
|
array(0,0,0,0,0,0,0,0,0,0,0)
|
||||||
);
|
);
|
||||||
|
|
||||||
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysql_escape_string($data['to_vid']));
|
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysqli_escape_string($GLOBALS['link'],$data['to_vid']));
|
||||||
$data1 = mysql_fetch_assoc($query1);
|
$data1 = mysqli_fetch_assoc($query1);
|
||||||
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
|
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
|
||||||
$data2 = mysql_fetch_assoc($query2);
|
$data2 = mysqli_fetch_assoc($query2);
|
||||||
$query11 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysql_escape_string($village->wid));
|
$query11 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysqli_escape_string($GLOBALS['link'],$village->wid));
|
||||||
$data11 = mysql_fetch_assoc($query11);
|
$data11 = mysqli_fetch_assoc($query11);
|
||||||
$query21 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data11['owner']);
|
$query21 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data11['owner']);
|
||||||
$data21 = mysql_fetch_assoc($query21);
|
$data21 = mysqli_fetch_assoc($query21);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -447,8 +445,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 = mysql_query("SELECT vref FROM ".TB_PREFIX."fdata WHERE f99t = '40' AND vref = ".$data['to_vid']."");
|
$q = mysqli_query($GLOBALS['link'],"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99t = '40' AND vref = ".$data['to_vid']."");
|
||||||
$isThere = mysql_num_rows($q);
|
$isThere = mysqli_num_rows($q);
|
||||||
if($isThere > 0)
|
if($isThere > 0)
|
||||||
{
|
{
|
||||||
$iswwvilla = 1;
|
$iswwvilla = 1;
|
||||||
@@ -517,7 +515,7 @@ if($session->access != BANNED){
|
|||||||
if($checkexist or $checkoexist){
|
if($checkexist or $checkoexist){
|
||||||
$database->addMovement(3,$village->wid,$data['to_vid'],$reference,time(),($time+time()));
|
$database->addMovement(3,$village->wid,$data['to_vid'],$reference,time(),($time+time()));
|
||||||
if(($database->hasBeginnerProtection($village->wid)==1)&&($checkexist)){
|
if(($database->hasBeginnerProtection($village->wid)==1)&&($checkexist)){
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users SET protect = 0 WHERE id = $session->uid");
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET protect = 0 WHERE id = $session->uid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -566,13 +564,11 @@ if($session->access != BANNED){
|
|||||||
if ($post['t11'] > $enforce['hero'])
|
if ($post['t11'] > $enforce['hero'])
|
||||||
{
|
{
|
||||||
$form->addError("error","You can't send more units than you have");
|
$form->addError("error","You can't send more units than you have");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($post['t11']<0)
|
if($post['t11']<0)
|
||||||
{
|
{
|
||||||
$form->addError("error","You can't send negative units.");
|
$form->addError("error","You can't send negative units.");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$post['t11']='0';
|
$post['t11']='0';
|
||||||
@@ -619,8 +615,8 @@ if($session->access != BANNED){
|
|||||||
if (isset($post['t11'])){
|
if (isset($post['t11'])){
|
||||||
if( $post['t11'] != '' && $post['t11'] > 0){
|
if( $post['t11'] != '' && $post['t11'] > 0){
|
||||||
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$from['owner']."";
|
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$from['owner']."";
|
||||||
$resulth = mysql_query($qh);
|
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||||
$hero_f=mysql_fetch_array($resulth);
|
$hero_f=mysqli_fetch_array($resulth);
|
||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ class Village {
|
|||||||
global $session, $database;
|
global $session, $database;
|
||||||
if(isset($_SESSION['wid'])) {
|
if(isset($_SESSION['wid'])) {
|
||||||
$this->wid = $_SESSION['wid'];
|
$this->wid = $_SESSION['wid'];
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->wid = $session->villages[0];
|
$this->wid = $session->villages[0];
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
session_start();
|
session_start();
|
||||||
include('GameEngine/config.php');
|
include('GameEngine/config.php');
|
||||||
include_once ("GameEngine/Lang/" . LANG . ".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/Generator.php");
|
||||||
include("GameEngine/Database/db_MYSQL.php");
|
include("GameEngine/Database.php");
|
||||||
|
|
||||||
//include("GameEngine/Session.php");
|
//include("GameEngine/Session.php");
|
||||||
|
|
||||||
@@ -88,14 +86,14 @@ $query2 = "SELECT
|
|||||||
where ".TB_PREFIX."wdata.id IN ($maparray)
|
where ".TB_PREFIX."wdata.id IN ($maparray)
|
||||||
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
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;
|
$i=0;
|
||||||
//Load coor array
|
//Load coor array
|
||||||
$yrow = 0;
|
$yrow = 0;
|
||||||
|
|
||||||
$map_js ='';
|
$map_js ='';
|
||||||
while ($donnees = mysql_fetch_assoc($result2)){
|
while ($donnees = mysqli_fetch_assoc($result2)){
|
||||||
|
|
||||||
$targetalliance=$donnees["aliance_id"];
|
$targetalliance=$donnees["aliance_id"];
|
||||||
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
|
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
session_start();
|
session_start();
|
||||||
include('GameEngine/config.php');
|
include('GameEngine/config.php');
|
||||||
include_once ("GameEngine/Lang/" . LANG . ".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/Generator.php");
|
||||||
include("GameEngine/Database/db_MYSQL.php");
|
include("GameEngine/Database.php");
|
||||||
header("Content-Type: application/json;");
|
header("Content-Type: application/json;");
|
||||||
|
|
||||||
//include("GameEngine/Session.php");
|
//include("GameEngine/Session.php");
|
||||||
@@ -103,7 +101,7 @@ $query2 = "SELECT
|
|||||||
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
||||||
|
|
||||||
//echo $query2;
|
//echo $query2;
|
||||||
$result2 = mysql_query($query2) or die(mysql_error());
|
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error());
|
||||||
|
|
||||||
$i=0;
|
$i=0;
|
||||||
$i2=0;
|
$i2=0;
|
||||||
@@ -112,7 +110,7 @@ $row = 0;
|
|||||||
$coorindex = 0;
|
$coorindex = 0;
|
||||||
$map_js ='';
|
$map_js ='';
|
||||||
|
|
||||||
while ($donnees = mysql_fetch_assoc($result2)){
|
while ($donnees = mysqli_fetch_assoc($result2)){
|
||||||
|
|
||||||
$targetalliance=$donnees["aliance_id"];
|
$targetalliance=$donnees["aliance_id"];
|
||||||
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
|
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ if (isset($qact)){
|
|||||||
$_SESSION['qst']= 3;
|
$_SESSION['qst']= 3;
|
||||||
//Give Reward
|
//Give Reward
|
||||||
if(!$session->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"))."')+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 {
|
} else {
|
||||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||||
$plus+=86400;
|
$plus+=86400;
|
||||||
@@ -151,7 +151,7 @@ if (isset($qact)){
|
|||||||
$_SESSION['qst']= 11;
|
$_SESSION['qst']= 11;
|
||||||
//Give Reward
|
//Give Reward
|
||||||
if(!$session->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 {
|
} else {
|
||||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||||
$plus+=172800;
|
$plus+=172800;
|
||||||
@@ -338,7 +338,7 @@ if (isset($qact)){
|
|||||||
$_SESSION['qst_time'] = time()+$skipp_time;
|
$_SESSION['qst_time'] = time()+$skipp_time;
|
||||||
//Give Reward
|
//Give Reward
|
||||||
if(!$session->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"))."')+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 {
|
} else {
|
||||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||||
$plus+=86400;
|
$plus+=86400;
|
||||||
@@ -401,7 +401,7 @@ if (isset($qact)){
|
|||||||
$_SESSION['qst']= 97;
|
$_SESSION['qst']= 97;
|
||||||
//Give Reward 20 gold + 2 days plus
|
//Give Reward 20 gold + 2 days plus
|
||||||
if(!$session->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 {
|
} else {
|
||||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||||
$plus+=172800;
|
$plus+=172800;
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ if (isset($qact)){
|
|||||||
$_SESSION['qst']= 3;
|
$_SESSION['qst']= 3;
|
||||||
//Give Reward
|
//Give Reward
|
||||||
if(!$session->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"))."')+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 {
|
} else {
|
||||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||||
$plus+=86400;
|
$plus+=86400;
|
||||||
@@ -154,7 +154,7 @@ if (isset($qact)){
|
|||||||
$_SESSION['qst']= 11;
|
$_SESSION['qst']= 11;
|
||||||
//Give Reward
|
//Give Reward
|
||||||
if(!$session->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 {
|
} else {
|
||||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||||
$plus+=172800;
|
$plus+=172800;
|
||||||
@@ -322,7 +322,7 @@ if (isset($qact)){
|
|||||||
$_SESSION['qst_time'] = time()+$skipp_time;
|
$_SESSION['qst_time'] = time()+$skipp_time;
|
||||||
//Give Reward
|
//Give Reward
|
||||||
if(!$session->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"))."')+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 {
|
} else {
|
||||||
$plus=$database->getUserField($_SESSION['username'],'plus',1);
|
$plus=$database->getUserField($_SESSION['username'],'plus',1);
|
||||||
$plus+=86400;
|
$plus+=86400;
|
||||||
@@ -385,7 +385,7 @@ if (isset($qact)){
|
|||||||
$_SESSION['qst']= 97;
|
$_SESSION['qst']= 97;
|
||||||
//Give Reward 20 gold + 2 days plus
|
//Give Reward 20 gold + 2 days plus
|
||||||
if(!$session->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 {
|
} else {
|
||||||
$plus=$database->getUserField($_SESSION['username'],'plus',1);
|
$plus=$database->getUserField($_SESSION['username'],'plus',1);
|
||||||
$plus+=172800;
|
$plus+=172800;
|
||||||
|
|||||||
@@ -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 = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 1");
|
$public = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 1");
|
||||||
$public1 = mysql_num_rows($public);
|
$public1 = mysqli_num_rows($public);
|
||||||
$cofederation = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 2");
|
$cofederation = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 2");
|
||||||
$cofederation1 = mysql_num_rows($cofederation);
|
$cofederation1 = mysqli_num_rows($cofederation);
|
||||||
$alliance = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 0");
|
$alliance = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 0");
|
||||||
$alliance1 = mysql_num_rows($alliance);
|
$alliance1 = mysqli_num_rows($alliance);
|
||||||
$closed = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 3");
|
$closed = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 3");
|
||||||
$closed1 = mysql_num_rows($closed);
|
$closed1 = mysqli_num_rows($closed);
|
||||||
if($public1 != 0){
|
if($public1 != 0){
|
||||||
?>
|
?>
|
||||||
<table cellpadding="1" cellspacing="1" id="public"><thead>
|
<table cellpadding="1" cellspacing="1" id="public"><thead>
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
$prefix = "".TB_PREFIX."ndata";
|
$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";
|
$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");
|
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
|
||||||
$query = mysql_num_rows($sql);
|
$query = mysqli_num_rows($sql);
|
||||||
$outputList = '';
|
$outputList = '';
|
||||||
$name = 1;
|
$name = 1;
|
||||||
if($query == 0) {
|
if($query == 0) {
|
||||||
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
|
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
|
||||||
}else{
|
}else{
|
||||||
while($row = mysql_fetch_array($sql)){
|
while($row = mysqli_fetch_array($sql)){
|
||||||
$dataarray = explode(",",$row['data']);
|
$dataarray = explode(",",$row['data']);
|
||||||
$id = $row["id"];
|
$id = $row["id"];
|
||||||
$uid = $row["uid"];
|
$uid = $row["uid"];
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
$prefix = "".TB_PREFIX."ndata";
|
$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";
|
$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");
|
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
|
||||||
$query = mysql_num_rows($sql);
|
$query = mysqli_num_rows($sql);
|
||||||
$outputList = '';
|
$outputList = '';
|
||||||
$name = 1;
|
$name = 1;
|
||||||
if($query == 0) {
|
if($query == 0) {
|
||||||
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
|
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
|
||||||
}else{
|
}else{
|
||||||
while($row = mysql_fetch_array($sql)){
|
while($row = mysqli_fetch_array($sql)){
|
||||||
$dataarray = explode(",",$row['data']);
|
$dataarray = explode(",",$row['data']);
|
||||||
$id = $row["id"];
|
$id = $row["id"];
|
||||||
$uid = $row["uid"];
|
$uid = $row["uid"];
|
||||||
|
|||||||
@@ -28,14 +28,14 @@ include("alli_menu.tpl");
|
|||||||
}else{
|
}else{
|
||||||
$prefix = "".TB_PREFIX."ndata";
|
$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";
|
$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");
|
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
|
||||||
$query = mysql_num_rows($sql);
|
$query = mysqli_num_rows($sql);
|
||||||
$outputList = '';
|
$outputList = '';
|
||||||
$name = 1;
|
$name = 1;
|
||||||
if($query == 0) {
|
if($query == 0) {
|
||||||
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
|
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
|
||||||
}else{
|
}else{
|
||||||
while($row = mysql_fetch_array($sql)){
|
while($row = mysqli_fetch_array($sql)){
|
||||||
$dataarray = explode(",",$row['data']);
|
$dataarray = explode(",",$row['data']);
|
||||||
$id = $row["id"];
|
$id = $row["id"];
|
||||||
$uid = $row["uid"];
|
$uid = $row["uid"];
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ $total_for2 = count($send);
|
|||||||
for($y=0;$y < $total_for;$y++){
|
for($y=0;$y < $total_for;$y++){
|
||||||
for($i=0;$i < $total_for2;$i++){
|
for($i=0;$i < $total_for2;$i++){
|
||||||
if($units[$y]['ref'] == $send[$i]['ref2']){
|
if($units[$y]['ref'] == $send[$i]['ref2']){
|
||||||
$res1 = mysql_query("SELECT * FROM " . TB_PREFIX . "send where id = ".$send[$i]['ref']."");
|
$res1 = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "send where id = ".$send[$i]['ref']."");
|
||||||
$res = mysql_fetch_array($res1);
|
$res = mysqli_fetch_array($res1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$timer = $y+1;
|
$timer = $y+1;
|
||||||
|
|||||||
+14
-14
@@ -6,33 +6,33 @@ if(time() - $_SESSION['time_p'] > 5) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($_POST AND $_GET['action'] == 'change_capital') {
|
if($_POST AND $_GET['action'] == 'change_capital') {
|
||||||
$pass = mysql_escape_string($_POST['pass']);
|
$pass = mysqli_escape_string($GLOBALS['link'],$_POST['pass']);
|
||||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $session->uid);
|
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $session->uid);
|
||||||
$data = mysql_fetch_assoc($query);
|
$data = mysqli_fetch_assoc($query);
|
||||||
if($data['password'] == md5($pass)) {
|
if($data['password'] == md5($pass)) {
|
||||||
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
|
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
|
||||||
$data1 = mysql_fetch_assoc($query1);
|
$data1 = mysqli_fetch_assoc($query1);
|
||||||
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'fdata` WHERE `vref` = ' . $data1['wref']);
|
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'fdata` WHERE `vref` = ' . $data1['wref']);
|
||||||
$data2 = mysql_fetch_assoc($query2);
|
$data2 = mysqli_fetch_assoc($query2);
|
||||||
if($data2['vref'] != $village->wid) {
|
if($data2['vref'] != $village->wid) {
|
||||||
for($i = 1; $i<=18; ++$i) {
|
for($i = 1; $i<=18; ++$i) {
|
||||||
if($data2['f' . $i] > 10) {
|
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) {
|
for($i=19; $i<=40; ++$i) {
|
||||||
if($data2['f' . $i . 't'] == 34) {
|
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) {
|
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) {
|
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']);
|
$query3 = mysqli_query($GLOBALS['link'],'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);
|
$query4 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 1 WHERE `wref` = ' . $village->wid);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$error = '<br /><font color="red">'.LOGIN_PW_ERROR.'</font><br />';
|
$error = '<br /><font color="red">'.LOGIN_PW_ERROR.'</font><br />';
|
||||||
@@ -68,8 +68,8 @@ else{
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
|
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
|
||||||
$data = mysql_fetch_assoc($query);
|
$data = mysqli_fetch_assoc($query);
|
||||||
if($data['wref'] == $village->wid) {
|
if($data['wref'] == $village->wid) {
|
||||||
?>
|
?>
|
||||||
<p class="none"><?php echo CAPITAL; ?></p>
|
<p class="none"><?php echo CAPITAL; ?></p>
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ Treasury <b>' . $reqlvl . '</b>, Effect <b>' . $effect . '</b>
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?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>';
|
echo '<td colspan="4" class="none">'.NO_ARTIFACTS_AREA.'</td>';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -102,11 +102,11 @@ if(mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts")) == 0)
|
|||||||
|
|
||||||
unset($reqlvl);
|
unset($reqlvl);
|
||||||
unset($effect);
|
unset($effect);
|
||||||
$arts = mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts");
|
$arts = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "artefacts");
|
||||||
$rows = array();
|
$rows = array();
|
||||||
while($row = mysql_fetch_array($arts)) {
|
while($row = mysqli_fetch_array($arts)) {
|
||||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'wdata` WHERE `id` = ' . $row['vref']);
|
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'wdata` WHERE `id` = ' . $row['vref']);
|
||||||
$coor2 = mysql_fetch_assoc($query);
|
$coor2 = mysqli_fetch_assoc($query);
|
||||||
|
|
||||||
|
|
||||||
$dist = round(getDistance($coor['x'], $coor['y'], $coor2['x'], $coor2['y']),1);
|
$dist = round(getDistance($coor['x'], $coor['y'], $coor2['x'], $coor2['y']),1);
|
||||||
|
|||||||
+19
-19
@@ -31,13 +31,13 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?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>';
|
echo '<td colspan="4" class="none">'.NO_ARTIFACTS.'</td>';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 1");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 1");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 2");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 2");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -76,8 +76,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 3");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 3");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -96,8 +96,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 4");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 4");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -115,8 +115,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 5");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 5");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -134,8 +134,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 6");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 6");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -153,8 +153,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 7");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 7");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -172,8 +172,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 8");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 8");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -186,8 +186,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 8");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 8");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
|
|||||||
+31
-31
@@ -31,12 +31,12 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?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>';
|
echo '<td colspan="4" class="none">'.NO_ARTIFACTS.'</td>';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 1");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 1");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -49,8 +49,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 1");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 1");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -69,8 +69,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 2");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 2");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -83,8 +83,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 2");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 2");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -103,8 +103,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 3");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 3");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -117,8 +117,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 3");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 3");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -137,8 +137,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 4");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 4");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -151,8 +151,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 4");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 4");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -170,8 +170,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 5");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 5");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -184,8 +184,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 5");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 5");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -203,8 +203,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 6");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 6");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -217,8 +217,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 6");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 6");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -236,8 +236,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 7");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 7");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -250,8 +250,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 7");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 7");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
@@ -269,8 +269,8 @@
|
|||||||
|
|
||||||
unset($artefact);
|
unset($artefact);
|
||||||
unset($row);
|
unset($row);
|
||||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 8");
|
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 8");
|
||||||
while($row = mysql_fetch_array($artefact)) {
|
while($row = mysqli_fetch_array($artefact)) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||||
echo '<td class="nam">';
|
echo '<td class="nam">';
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
| Copyright: TravianX Project All rights reserved |
|
| Copyright: TravianX Project All rights reserved |
|
||||||
\*-------------------------------------------------------*/
|
\*-------------------------------------------------------*/
|
||||||
|
|
||||||
$hero = mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
|
$hero = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
|
||||||
$hero_info = mysql_fetch_array($hero);
|
$hero_info = mysqli_fetch_array($hero);
|
||||||
|
|
||||||
$define['reset_level'] = 3; // Until which level you are able to reset your points
|
$define['reset_level'] = 3; // Until which level you are able to reset your points
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
if(isset($_GET['land'])) {
|
if(isset($_GET['land'])) {
|
||||||
include("37_land.tpl");
|
include("37_land.tpl");
|
||||||
} else {
|
} else {
|
||||||
if(mysql_num_rows($hero) == 0){
|
if(mysqli_num_rows($hero) == 0){
|
||||||
include("37_train.tpl");
|
include("37_train.tpl");
|
||||||
}elseif($hero_info['intraining'] == 1){
|
}elseif($hero_info['intraining'] == 1){
|
||||||
$timeleft = $generator->getTimeFormat($hero_info['trainingtime'] - time());
|
$timeleft = $generator->getTimeFormat($hero_info['trainingtime'] - time());
|
||||||
@@ -87,10 +87,10 @@
|
|||||||
</table>
|
</table>
|
||||||
<?php
|
<?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");
|
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");
|
include("37_hero.tpl");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-19
@@ -13,9 +13,9 @@ include_once("GameEngine/Data/hero_full.php");
|
|||||||
|
|
||||||
if (isset($_POST['name'])) {
|
if (isset($_POST['name'])) {
|
||||||
$_POST['name'] = stripslashes($_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());
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `name`='".($_POST['name'])."' where `uid`='".$session->uid."'") or die("ERROR:".mysqli_error());
|
||||||
$hero = mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
|
$hero = mysqli_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
|
||||||
$hero_info = mysql_fetch_array($hero);
|
$hero_info = mysqli_fetch_array($hero);
|
||||||
echo "".NAME_CHANGED."";
|
echo "".NAME_CHANGED."";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,48 +169,48 @@ if (isset($_POST['name'])) {
|
|||||||
if($_GET['add'] == "reset") {
|
if($_GET['add'] == "reset") {
|
||||||
if($hero_info['level'] <= 3){
|
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){
|
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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `uid` = '" . $session->uid . "'");
|
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `uid` = '" . $session->uid . "'");
|
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `uid` = '" . $session->uid . "'");
|
mysqli_query($GLOBALS['link'],"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 `regeneration` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($_GET['add'] == "off" && $hero_info['attack'] < 100) {
|
if($_GET['add'] == "off" && $hero_info['attack'] < 100) {
|
||||||
if($hero_info['points'] > 0) {
|
if($hero_info['points'] > 0) {
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `uid` = '" . $session->uid . "'");
|
mysqli_query($GLOBALS['link'],"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 `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($_GET['add'] == "deff" && $hero_info['defence'] < 100) {
|
if($_GET['add'] == "deff" && $hero_info['defence'] < 100) {
|
||||||
if($hero_info['points'] > 0) {
|
if($hero_info['points'] > 0) {
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `uid` = '" . $session->uid . "'");
|
mysqli_query($GLOBALS['link'],"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 `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($_GET['add'] == "obonus" && $hero_info['attackbonus'] < 100) {
|
if($_GET['add'] == "obonus" && $hero_info['attackbonus'] < 100) {
|
||||||
if($hero_info['points'] > 0) {
|
if($hero_info['points'] > 0) {
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `uid` = '" . $session->uid . "'");
|
mysqli_query($GLOBALS['link'],"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 `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($_GET['add'] == "dbonus" && $hero_info['defencebonus'] < 100) {
|
if($_GET['add'] == "dbonus" && $hero_info['defencebonus'] < 100) {
|
||||||
if($hero_info['points'] > 0) {
|
if($hero_info['points'] > 0) {
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `uid` = '" . $session->uid . "'");
|
mysqli_query($GLOBALS['link'],"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 `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($_GET['add'] == "reg" && $hero_info['regeneration'] < 100) {
|
if($_GET['add'] == "reg" && $hero_info['regeneration'] < 100) {
|
||||||
if($hero_info['points'] > 0) {
|
if($hero_info['points'] > 0) {
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `uid` = '" . $session->uid . "'");
|
mysqli_query($GLOBALS['link'],"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 `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,11 +171,11 @@
|
|||||||
|
|
||||||
if($_GET['revive'] == 1 && $hero_info['inrevive'] == 0 && $hero_info['intraining'] == 0 && $hero_info['dead'] == 1){
|
if($_GET['revive'] == 1 && $hero_info['inrevive'] == 0 && $hero_info['intraining'] == 0 && $hero_info['dead'] == 1){
|
||||||
if($session->access != BANNED){
|
if($session->access != BANNED){
|
||||||
mysql_query("UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".$training_time2."', `wref` = '".$village->wid."' WHERE `uid` = '".$session->uid."'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "vdata SET `crop` = `crop` - ".$crop." WHERE `wref` = '" . $village->wid . "'");
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
header("Location: banned.php");
|
header("Location: banned.php");
|
||||||
|
|||||||
+108
-108
@@ -34,8 +34,8 @@
|
|||||||
|
|
||||||
//check if there is unit needed in the village
|
//check if there is unit needed in the village
|
||||||
|
|
||||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".$village->wid."");
|
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".$village->wid."");
|
||||||
$units = mysql_fetch_array($result);
|
$units = mysqli_fetch_array($result);
|
||||||
|
|
||||||
$output="<table cellpadding=1 cellspacing=1 class=\"build_details\">
|
$output="<table cellpadding=1 cellspacing=1 class=\"build_details\">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -529,18 +529,18 @@ $output.="<tr>
|
|||||||
|
|
||||||
|
|
||||||
//HERO TRAINING
|
//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($session->tribe == 1){
|
||||||
if($_GET['train'] == 1){
|
if($_GET['train'] == 1){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u1` = `u1` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u1['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -549,14 +549,14 @@ $output.="<tr>
|
|||||||
}
|
}
|
||||||
if($_GET['train'] == 2){
|
if($_GET['train'] == 2){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u2` = `u2` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u2['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -565,13 +565,13 @@ $output.="<tr>
|
|||||||
}
|
}
|
||||||
if($_GET['train'] == 3){
|
if($_GET['train'] == 3){
|
||||||
if($session->access != BANNED){
|
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 . "'");
|
||||||
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u3` = `u3` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u3['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
header("Location: banned.php");
|
header("Location: banned.php");
|
||||||
@@ -579,14 +579,14 @@ $output.="<tr>
|
|||||||
}
|
}
|
||||||
if($_GET['train'] == 5){
|
if($_GET['train'] == 5){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u5` = `u5` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u5['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -595,14 +595,14 @@ $output.="<tr>
|
|||||||
}
|
}
|
||||||
if($_GET['train'] == 6){
|
if($_GET['train'] == 6){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u6` = `u6` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u6['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -613,14 +613,14 @@ $output.="<tr>
|
|||||||
if($session->tribe == 2){
|
if($session->tribe == 2){
|
||||||
if($_GET['train'] == 11){
|
if($_GET['train'] == 11){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u11` = `u11` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u11['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -629,14 +629,14 @@ $output.="<tr>
|
|||||||
}
|
}
|
||||||
if($_GET['train'] == 12){
|
if($_GET['train'] == 12){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u12` = `u12` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u12['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -645,14 +645,14 @@ $output.="<tr>
|
|||||||
}
|
}
|
||||||
if($_GET['train'] == 13){
|
if($_GET['train'] == 13){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u13` = `u13` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u13['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -661,14 +661,14 @@ $output.="<tr>
|
|||||||
}
|
}
|
||||||
if($_GET['train'] == 15){
|
if($_GET['train'] == 15){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u15` = `u15` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u15['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -677,14 +677,14 @@ $output.="<tr>
|
|||||||
}
|
}
|
||||||
if($_GET['train'] == 16){
|
if($_GET['train'] == 16){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u16` = `u16` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u16['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -695,14 +695,14 @@ $output.="<tr>
|
|||||||
if($session->tribe == 3){
|
if($session->tribe == 3){
|
||||||
if($_GET['train'] == 21){
|
if($_GET['train'] == 21){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u21` = `u21` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u21['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -711,14 +711,14 @@ $output.="<tr>
|
|||||||
}
|
}
|
||||||
if($_GET['train'] == 22){
|
if($_GET['train'] == 22){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u22` = `u22` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u22['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -727,14 +727,14 @@ $output.="<tr>
|
|||||||
}
|
}
|
||||||
if($_GET['train'] == 24){
|
if($_GET['train'] == 24){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u24` = `u24` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u24['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -743,14 +743,14 @@ $output.="<tr>
|
|||||||
}
|
}
|
||||||
if($_GET['train'] == 25){
|
if($_GET['train'] == 25){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u25` = `u25` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u25['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
@@ -759,14 +759,14 @@ $output.="<tr>
|
|||||||
}
|
}
|
||||||
if($_GET['train'] == 26){
|
if($_GET['train'] == 26){
|
||||||
if($session->access != BANNED){
|
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){
|
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')");
|
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')");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u26` = `u26` - 1 WHERE `vref` = '" . $village->wid . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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 . "'");
|
mysqli_query($GLOBALS['link'],"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'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u26['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$id."");
|
header("Location: build.php?id=".$id."");
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -162,17 +162,14 @@ if($palace == 0 && $palace1 == 0 && $village->natar == 0 && $embassy >= 1 && $ma
|
|||||||
//id user
|
//id user
|
||||||
$user = $session->uid;
|
$user = $session->uid;
|
||||||
|
|
||||||
//connect to DB
|
|
||||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
|
||||||
mysql_select_db(SQL_DB);
|
|
||||||
|
|
||||||
//loop search village user
|
//loop search village user
|
||||||
$query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
|
$query = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
|
||||||
while($villaggi_array = mysql_fetch_array($query)){
|
while($villaggi_array = mysqli_fetch_array($query)){
|
||||||
|
|
||||||
//loop structure village
|
//loop structure village
|
||||||
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
|
$query1 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
|
||||||
$strutture= mysql_fetch_array($query1);
|
$strutture= mysqli_fetch_array($query1);
|
||||||
if($strutture == false)
|
if($strutture == false)
|
||||||
$strutture = [];
|
$strutture = [];
|
||||||
//search Castle in array structure village
|
//search Castle in array structure village
|
||||||
@@ -287,16 +284,16 @@ if($embassy == 0 || $mainbuilding >= 2 && $mainbuilding <= 4 && $village->natar
|
|||||||
$user = $session->uid;
|
$user = $session->uid;
|
||||||
|
|
||||||
//connect to DB
|
//connect to DB
|
||||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
//mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||||
mysql_select_db(SQL_DB);
|
//mysql_select_db(SQL_DB);
|
||||||
|
|
||||||
//loop search village user
|
//loop search village user
|
||||||
$query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
|
$query = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
|
||||||
while($villaggi_array = mysql_fetch_array($query)){
|
while($villaggi_array = mysqli_fetch_array($query)){
|
||||||
|
|
||||||
//loop structure village
|
//loop structure village
|
||||||
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
|
$query1 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
|
||||||
$strutture= mysql_fetch_array($query1);
|
$strutture= mysqli_fetch_array($query1);
|
||||||
|
|
||||||
//search Castle in array structure village
|
//search Castle in array structure village
|
||||||
if($strutture !== false)
|
if($strutture !== false)
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ $query2 = "SELECT
|
|||||||
|
|
||||||
//$query2;
|
//$query2;
|
||||||
|
|
||||||
$result2 = mysql_query($query2) or die(mysql_error());
|
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error());
|
||||||
|
|
||||||
$targetalliance = array();
|
$targetalliance = array();
|
||||||
$neutralarray = array();
|
$neutralarray = array();
|
||||||
@@ -129,7 +129,7 @@ $map_js ='';
|
|||||||
$map_gen='';
|
$map_gen='';
|
||||||
$map_content='';
|
$map_content='';
|
||||||
|
|
||||||
while ($donnees = mysql_fetch_assoc($result2)){
|
while ($donnees = mysqli_fetch_assoc($result2)){
|
||||||
|
|
||||||
$targetalliance=$donnees["aliance_id"];
|
$targetalliance=$donnees["aliance_id"];
|
||||||
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
|
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ $query2 = "SELECT
|
|||||||
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
||||||
|
|
||||||
//echo $query2;
|
//echo $query2;
|
||||||
$result2 = mysql_query($query2) or die(mysql_error());
|
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error());
|
||||||
|
|
||||||
$targetalliance = array();
|
$targetalliance = array();
|
||||||
$neutralarray = array();
|
$neutralarray = array();
|
||||||
@@ -307,7 +307,7 @@ $coorarray = array(
|
|||||||
,"924, 253, 961, 273, 924, 293, 887, 273"
|
,"924, 253, 961, 273, 924, 293, 887, 273"
|
||||||
);
|
);
|
||||||
|
|
||||||
while ($donnees = mysql_fetch_assoc($result2)){
|
while ($donnees = mysqli_fetch_assoc($result2)){
|
||||||
|
|
||||||
$targetalliance=$donnees["aliance_id"];
|
$targetalliance=$donnees["aliance_id"];
|
||||||
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
|
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
|
||||||
|
|||||||
+25
-25
@@ -2,8 +2,8 @@
|
|||||||
<?php
|
<?php
|
||||||
$basearray = $database->getMInfo($_GET['d']);
|
$basearray = $database->getMInfo($_GET['d']);
|
||||||
$uinfo = $database->getVillage($basearray['id']);
|
$uinfo = $database->getVillage($basearray['id']);
|
||||||
$oasis1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysql_real_escape_string($_GET['d']));
|
$oasis1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysqli_real_escape_string($GLOBALS['link'],$_GET['d']));
|
||||||
$oasis = mysql_fetch_assoc($oasis1);
|
$oasis = mysqli_fetch_assoc($oasis1);
|
||||||
$access=$session->access;
|
$access=$session->access;
|
||||||
?>
|
?>
|
||||||
<h1><?php if($basearray['fieldtype']!=0){
|
<h1><?php if($basearray['fieldtype']!=0){
|
||||||
@@ -159,10 +159,10 @@ if($session->uid == $database->getVillage($_GET['d'])){
|
|||||||
}
|
}
|
||||||
$toWref = $_GET['d'];
|
$toWref = $_GET['d'];
|
||||||
if($session->alliance!=0){
|
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");
|
$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 = mysql_num_rows($result);
|
$query = mysqli_num_rows($result);
|
||||||
if($query != 0){
|
if($query != 0){
|
||||||
while($row = mysql_fetch_array($result)){
|
while($row = mysqli_fetch_array($result)){
|
||||||
$dataarray = explode(",",$row['data']);
|
$dataarray = explode(",",$row['data']);
|
||||||
$type = $row['ntype'];
|
$type = $row['ntype'];
|
||||||
$topic=$row['topic'];
|
$topic=$row['topic'];
|
||||||
@@ -183,10 +183,10 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
|||||||
|
|
||||||
<?php }
|
<?php }
|
||||||
}else{
|
}else{
|
||||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||||
$query = mysql_num_rows($result);
|
$query = mysqli_num_rows($result);
|
||||||
if($query != 0){
|
if($query != 0){
|
||||||
while($row = mysql_fetch_array($result)){
|
while($row = mysqli_fetch_array($result)){
|
||||||
$dataarray = explode(",",$row['data']);
|
$dataarray = explode(",",$row['data']);
|
||||||
$type = $row['ntype'];
|
$type = $row['ntype'];
|
||||||
$topic=$row['topic'];
|
$topic=$row['topic'];
|
||||||
@@ -258,10 +258,10 @@ if($session->uid == $database->getVillage($_GET['d'])){
|
|||||||
}
|
}
|
||||||
$toWref = $_GET['d'];
|
$toWref = $_GET['d'];
|
||||||
if($session->alliance!=0){
|
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");
|
$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 = mysql_num_rows($result);
|
$query = mysqli_num_rows($result);
|
||||||
if($query != 0){
|
if($query != 0){
|
||||||
while($row = mysql_fetch_array($result)){
|
while($row = mysqli_fetch_array($result)){
|
||||||
$dataarray = explode(",",$row['data']);
|
$dataarray = explode(",",$row['data']);
|
||||||
$type = $row['ntype'];
|
$type = $row['ntype'];
|
||||||
$topic=$row['topic'];
|
$topic=$row['topic'];
|
||||||
@@ -282,10 +282,10 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
|||||||
|
|
||||||
<?php }
|
<?php }
|
||||||
}else{
|
}else{
|
||||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||||
$query = mysql_num_rows($result);
|
$query = mysqli_num_rows($result);
|
||||||
if($query != 0){
|
if($query != 0){
|
||||||
while($row = mysql_fetch_array($result)){
|
while($row = mysqli_fetch_array($result)){
|
||||||
$dataarray = explode(",",$row['data']);
|
$dataarray = explode(",",$row['data']);
|
||||||
$type = $row['ntype'];
|
$type = $row['ntype'];
|
||||||
$topic=$row['topic'];
|
$topic=$row['topic'];
|
||||||
@@ -384,10 +384,10 @@ if($session->uid == $database->getVillage($_GET['d'])){
|
|||||||
}
|
}
|
||||||
$toWref = $_GET['d'];
|
$toWref = $_GET['d'];
|
||||||
if($session->alliance!=0){
|
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");
|
$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 = mysql_num_rows($result);
|
$query = mysqli_num_rows($result);
|
||||||
if($query != 0){
|
if($query != 0){
|
||||||
while($row = mysql_fetch_array($result)){
|
while($row = mysqli_fetch_array($result)){
|
||||||
$dataarray = explode(",",$row['data']);
|
$dataarray = explode(",",$row['data']);
|
||||||
$type = $row['ntype'];
|
$type = $row['ntype'];
|
||||||
$topic=$row['topic'];
|
$topic=$row['topic'];
|
||||||
@@ -408,10 +408,10 @@ if($type==18 or $type==19 or $type==20 or $type==21 or $type==22){
|
|||||||
|
|
||||||
<?php }
|
<?php }
|
||||||
}else{
|
}else{
|
||||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
$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 = mysql_num_rows($result);
|
$query = mysqli_num_rows($result);
|
||||||
if($query != 0){
|
if($query != 0){
|
||||||
while($row = mysql_fetch_array($result)){
|
while($row = mysqli_fetch_array($result)){
|
||||||
$dataarray = explode(",",$row['data']);
|
$dataarray = explode(",",$row['data']);
|
||||||
$type = $row['ntype'];
|
$type = $row['ntype'];
|
||||||
$topic=$row['topic'];
|
$topic=$row['topic'];
|
||||||
@@ -485,13 +485,13 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
|||||||
<td class="none">
|
<td class="none">
|
||||||
<?php
|
<?php
|
||||||
if($basearray['fieldtype'] == 0){
|
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{
|
}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);
|
$data1 = mysqli_fetch_assoc($query1);
|
||||||
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
|
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
|
||||||
$data2 = mysql_fetch_assoc($query2);
|
$data2 = mysqli_fetch_assoc($query2);
|
||||||
if($data2['access']=='0' or $data2['access']=='8' or $data2['access']=='9') {
|
if($data2['access']=='0' or $data2['access']=='8' or $data2['access']=='9') {
|
||||||
echo "» ".SENDTROOP." (".BAN.")";
|
echo "» ".SENDTROOP." (".BAN.")";
|
||||||
} else if($data2['vac_mode']=='1') {
|
} else if($data2['vac_mode']=='1') {
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ x<div id="content" class="messages">
|
|||||||
<th class="sent">Sent</th>
|
<th class="sent">Sent</th>
|
||||||
</tr></thead><tfoot><tr><th>
|
</tr></thead><tfoot><tr><th>
|
||||||
<?php
|
<?php
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
$date2=strtotime("NOW");
|
$date2=strtotime("NOW");
|
||||||
if ($golds['plus'] <= $date2) { ?>
|
if ($golds['plus'] <= $date2) { ?>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
<th>Recipient</th>
|
<th>Recipient</th>
|
||||||
<th class="sent"><a href="nachrichten.php?t=2&s=0&t=2&o=1">Sent</a></th>
|
<th class="sent"><a href="nachrichten.php?t=2&s=0&t=2&o=1">Sent</a></th>
|
||||||
</tr></thead><tfoot><tr><th><?php
|
</tr></thead><tfoot><tr><th><?php
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
$date2=strtotime("NOW");
|
$date2=strtotime("NOW");
|
||||||
if ($golds['plus'] <= $date2) { ?>
|
if ($golds['plus'] <= $date2) { ?>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<h5><img src="img/en/t2/newsbox1.gif" alt="newsbox 1"></h5>
|
<h5><img src="img/en/t2/newsbox1.gif" alt="newsbox 1"></h5>
|
||||||
<?php
|
<?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"));
|
||||||
$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"));
|
$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,7 +1,7 @@
|
|||||||
<h5><img src="img/en/t2/newsbox2.gif" alt="newsbox 2"></h5>
|
<h5><img src="img/en/t2/newsbox2.gif" alt="newsbox 2"></h5>
|
||||||
<?php
|
<?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"));
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
|
|||||||
</tr>
|
</tr>
|
||||||
</thead><tfoot>
|
</thead><tfoot>
|
||||||
<tr><th><?php
|
<tr><th><?php
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
$date2=strtotime("NOW");
|
$date2=strtotime("NOW");
|
||||||
if ($golds['plus'] <= $date2) { ?>
|
if ($golds['plus'] <= $date2) { ?>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|||||||
+25
-51
@@ -1,55 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
////////////// made by alq0rsan /////////////////////////
|
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||||
if($session->access != BANNED){
|
if($session->access != BANNED && $session->gold >= 5){
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
|
if($session->sit == 0) {
|
||||||
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
if (mysqli_num_rows($MyGold) == 1) {
|
||||||
$uuid = mysql_fetch_array($MyId);
|
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());
|
||||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
|
} else {
|
||||||
$uuVilid = mysql_fetch_array($MyVilId);
|
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";
|
||||||
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
|
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());
|
||||||
$today = date("mdHi");
|
} else {
|
||||||
if($session->sit == 0) {
|
$done1 = "You need more gold";
|
||||||
if (mysql_num_rows($MyGold)) {
|
}
|
||||||
if($golds['6'] > 2) {
|
} else {
|
||||||
|
$done1 = "Failed clay attempt";
|
||||||
if (mysql_num_rows($MyGold)) {
|
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Clay')") or die(mysqli_error());
|
||||||
|
}
|
||||||
if($golds['b2'] < time()) {
|
}
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set b2 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
header("Location: plus.php?id=3");
|
||||||
} else {
|
} else {
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set b2 = '".($golds['b2']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
header("Location: banned.php");
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$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");
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
+25
-51
@@ -1,55 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
////////////// made by alq0rsan /////////////////////////
|
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||||
if($session->access != BANNED){
|
if($session->access != BANNED && $session->gold >= 5){
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
|
if($session->sit == 0) {
|
||||||
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
if (mysqli_num_rows($MyGold)) {
|
||||||
$uuid = mysql_fetch_array($MyId);
|
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());
|
||||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
|
} else {
|
||||||
$uuVilid = mysql_fetch_array($MyVilId);
|
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";
|
||||||
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
|
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());
|
||||||
$today = date("mdHi");
|
} else {
|
||||||
if($session->sit == 0) {
|
$done1 = "You need more gold";
|
||||||
if (mysql_num_rows($MyGold)) {
|
}
|
||||||
if($golds['6'] > 2) {
|
} else {
|
||||||
|
$done1 = "Failed iron attempt";
|
||||||
if (mysql_num_rows($MyGold)) {
|
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Iron')") or die(mysqli_error());
|
||||||
|
}
|
||||||
if($golds['b3'] < time()) {
|
}
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set b3 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
header("Location: plus.php?id=3");
|
||||||
} else {
|
} else {
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set b3 = '".($golds['b3']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
header("Location: banned.php");
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$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");
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
+25
-51
@@ -1,55 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
////////////// made by alq0rsan /////////////////////////
|
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||||
if($session->access != BANNED){
|
if($session->access != BANNED && $session->gold >= 5){
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
|
if($session->sit == 0) {
|
||||||
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
if (mysqli_num_rows($MyGold)) {
|
||||||
$uuid = mysql_fetch_array($MyId);
|
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());
|
||||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
|
} else {
|
||||||
$uuVilid = mysql_fetch_array($MyVilId);
|
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";
|
||||||
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
|
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());
|
||||||
$today = date("mdHi");
|
} else {
|
||||||
if($session->sit == 0) {
|
$done1 = "You need more gold";
|
||||||
if (mysql_num_rows($MyGold)) {
|
}
|
||||||
if($golds['6'] > 2) {
|
} else {
|
||||||
|
$done1 = "Failed crop attempt";
|
||||||
if (mysql_num_rows($MyGold)) {
|
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Crop')") or die(mysqli_error());
|
||||||
|
}
|
||||||
if($golds['b4'] < time()) {
|
}
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set b4 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
header("Location: plus.php?id=3");
|
||||||
} else {
|
} else {
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set b4 = '".($golds['b4']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
header("Location: banned.php");
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$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");
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<!---<?php
|
<!---<?php
|
||||||
/*include("Templates/Plus/pmenu.tpl");
|
/*include("Templates/Plus/pmenu.tpl");
|
||||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysql_error());
|
$MyVilId = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysqli_error());
|
||||||
$uuVilid = mysql_fetch_array($MyVilId);
|
$uuVilid = mysqli_fetch_array($MyVilId);
|
||||||
$totalR = ($uuVilid['6']+$uuVilid['7']+$uuVilid['8']+$uuVilid['10']);
|
$totalR = ($uuVilid['6']+$uuVilid['7']+$uuVilid['8']+$uuVilid['10']);
|
||||||
$quart = ($totalR / 4);
|
$quart = ($totalR / 4);
|
||||||
*/
|
*/
|
||||||
@@ -21,11 +21,11 @@
|
|||||||
<td align="center">
|
<td align="center">
|
||||||
<?php
|
<?php
|
||||||
if($session->sit == 0) {
|
if($session->sit == 0) {
|
||||||
/* $MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
|
|
||||||
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
$MyId = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||||
$uuid = mysql_fetch_array($MyId);
|
$uuid = mysqli_fetch_array($MyId);
|
||||||
|
|
||||||
echo "<input type='text' name='T1' size='6' value=".$quart."></td>";
|
echo "<input type='text' name='T1' size='6' value=".$quart."></td>";
|
||||||
echo "<td align='center'>";
|
echo "<td align='center'>";
|
||||||
@@ -34,7 +34,7 @@ if($session->sit == 0) {
|
|||||||
echo "<input type='text' name='T3' size='6' value=".$quart."></td>";
|
echo "<input type='text' name='T3' size='6' value=".$quart."></td>";
|
||||||
echo "<td align='center'>";
|
echo "<td align='center'>";
|
||||||
echo "<input type='text' name='T4' size='6' value=".$quart."></td>";
|
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
@@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
////////////// made by alq0rsan /////////////////////////
|
////////////// made by alq0rsan /////////////////////////
|
||||||
if($session->access != BANNED){
|
if($session->access != BANNED){
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
|
|
||||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysql_error());
|
$MyVilId = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysqli_error());
|
||||||
$uuVilid = mysql_fetch_array($MyVilId);
|
$uuVilid = mysqli_fetch_array($MyVilId);
|
||||||
|
|
||||||
$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 = 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) {
|
if($totalT <= $totalR) {
|
||||||
mysql_query("UPDATE ".TB_PREFIX."vdata set wood = '".$T1."' where `wref`='".$village->wid."'") or die(mysql_error());
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set wood = '".$T1."' where `wref`='".$village->wid."'") or die(mysqli_error());
|
||||||
mysql_query("UPDATE ".TB_PREFIX."vdata set clay = '".$T2."' where `wref`='".$village->wid."'") or die(mysql_error());
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set clay = '".$T2."' where `wref`='".$village->wid."'") or die(mysqli_error());
|
||||||
mysql_query("UPDATE ".TB_PREFIX."vdata set iron = '".$T3."' where `wref`='".$village->wid."'") or die(mysql_error());
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set iron = '".$T3."' where `wref`='".$village->wid."'") or die(mysqli_error());
|
||||||
mysql_query("UPDATE ".TB_PREFIX."vdata set crop = '".$T4."' where `wref`='".$village->wid."'") or die(mysql_error());
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set crop = '".$T4."' where `wref`='".$village->wid."'") or die(mysqli_error());
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-3)." where `id`='".$session->uid."'") or die(mysql_error());
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-3)." where `id`='".$session->uid."'") or die(mysqli_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'],"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysqli_num_rows($goldlog)+1)."', '".$village->wid."', 'trade 1:1')") or die(mysqli_error());
|
||||||
echo "done";
|
echo "done";
|
||||||
} else {
|
} else {
|
||||||
echo "failed";
|
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());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
////////////// made by alq0rsan /////////////////////////
|
////////////// made by alq0rsan /////////////////////////
|
||||||
if($session->access != BANNED){
|
if($session->access != BANNED){
|
||||||
if($session->gold >= 100 && $session->sit == 0 && $session->goldclub == 0) {
|
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");
|
header("Location: plus.php?id=3");
|
||||||
|
|
||||||
|
|||||||
+24
-24
@@ -1,17 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
|
|
||||||
include("Templates/Plus/pmenu.tpl");
|
include("Templates/Plus/pmenu.tpl");
|
||||||
|
|
||||||
|
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
|
|
||||||
$today = date("mdHi");
|
$today = date("mdHi");
|
||||||
|
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($session->gold == 0) {
|
if($session->gold == 0) {
|
||||||
echo "<p>You currently don't own gold.</p>";
|
echo "<p>You currently don't own gold.</p>";
|
||||||
} else {
|
} else {
|
||||||
@@ -60,7 +60,7 @@ $date2=strtotime("NOW");
|
|||||||
}else
|
}else
|
||||||
if ($datetimep <= $date2) {
|
if ($datetimep <= $date2) {
|
||||||
print "Your PLUS advantage has ended.<br>";
|
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 {
|
} else {
|
||||||
|
|
||||||
$holdtotmin=(($datetimep-$date2)/60);
|
$holdtotmin=(($datetimep-$date2)/60);
|
||||||
@@ -87,10 +87,10 @@ $holdmr=intval($holdtotmin-(($holdhr*60)+($holdtotday*1440)));
|
|||||||
<td class="act">
|
<td class="act">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
|
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 9 && $datetimep < $date2) {
|
if($golds['gold'] > 9 && $datetimep < $date2) {
|
||||||
echo '
|
echo '
|
||||||
<a href="plus.php?id=8"><span>Activate';
|
<a href="plus.php?id=8"><span>Activate';
|
||||||
@@ -151,7 +151,7 @@ echo "<b> ".($holdmr1). "</b> mins</font> ";
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($session->access != BANNED){
|
if ($session->access != BANNED){
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 4 && $tl_b1 < $date2) {
|
if($golds['gold'] > 4 && $tl_b1 < $date2) {
|
||||||
echo '<a href="plus.php?id=9"><span>Activate';
|
echo '<a href="plus.php?id=9"><span>Activate';
|
||||||
}elseif
|
}elseif
|
||||||
@@ -161,7 +161,7 @@ if (mysql_num_rows($MyGold)) {
|
|||||||
echo '<a href="plus.php?s=1"><span class="none">too little gold';}
|
echo '<a href="plus.php?s=1"><span class="none">too little gold';}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 4 && $tl_b1 < $date2) {
|
if($golds['gold'] > 4 && $tl_b1 < $date2) {
|
||||||
echo '<a href="banned.php"><span>Activate';
|
echo '<a href="banned.php"><span>Activate';
|
||||||
}elseif
|
}elseif
|
||||||
@@ -217,7 +217,7 @@ echo "<b> ".($holdmr2). "</b> mins<font>";
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($session->access != BANNED){
|
if ($session->access != BANNED){
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 4 && $tl_b2 < $date2) {
|
if($golds['gold'] > 4 && $tl_b2 < $date2) {
|
||||||
echo '<a href="plus.php?id=10"><span>Activate';
|
echo '<a href="plus.php?id=10"><span>Activate';
|
||||||
}elseif
|
}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>';}
|
echo '<a href="plus.php?s=1"><span class="none">too little gold</span></a></td>';}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 4 && $tl_b2 < $date2) {
|
if($golds['gold'] > 4 && $tl_b2 < $date2) {
|
||||||
echo '<a href="banned.php"><span>Activate';
|
echo '<a href="banned.php"><span>Activate';
|
||||||
}elseif
|
}elseif
|
||||||
@@ -281,7 +281,7 @@ echo "<b> ".($holdmr3). "</b> mins</font>";
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($session->access != BANNED){
|
if ($session->access != BANNED){
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 4 && $tl_b3 < $date2) {
|
if($golds['gold'] > 4 && $tl_b3 < $date2) {
|
||||||
echo '<a href="plus.php?id=11"><span>Activate';
|
echo '<a href="plus.php?id=11"><span>Activate';
|
||||||
}elseif
|
}elseif
|
||||||
@@ -291,7 +291,7 @@ if (mysql_num_rows($MyGold)) {
|
|||||||
echo '<a href="plus.php?s=1"><span class="none">too little gold';}
|
echo '<a href="plus.php?s=1"><span class="none">too little gold';}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 4 && $tl_b3 < $date2) {
|
if($golds['gold'] > 4 && $tl_b3 < $date2) {
|
||||||
echo '<a href="banned.php"><span>Activate';
|
echo '<a href="banned.php"><span>Activate';
|
||||||
}elseif
|
}elseif
|
||||||
@@ -343,7 +343,7 @@ echo "<b> ".($holdmr4). "</b> mins</font>";
|
|||||||
<td <span class="none">
|
<td <span class="none">
|
||||||
<?php
|
<?php
|
||||||
if ($session->access != BANNED){
|
if ($session->access != BANNED){
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 4 && $tl_b4 < $date2) {
|
if($golds['gold'] > 4 && $tl_b4 < $date2) {
|
||||||
echo '<a href="plus.php?id=12"><span>Activate';
|
echo '<a href="plus.php?id=12"><span>Activate';
|
||||||
}elseif
|
}elseif
|
||||||
@@ -353,7 +353,7 @@ if (mysql_num_rows($MyGold)) {
|
|||||||
echo '<a href="plus.php?s=1"><span class="none">too little gold';}
|
echo '<a href="plus.php?s=1"><span class="none">too little gold';}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 4 && $tl_b4 < $date2) {
|
if($golds['gold'] > 4 && $tl_b4 < $date2) {
|
||||||
echo '<a href="banned.php"><span>Activate';
|
echo '<a href="banned.php"><span>Activate';
|
||||||
}elseif
|
}elseif
|
||||||
@@ -380,7 +380,7 @@ if (mysql_num_rows($MyGold)) {
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($session->access != BANNED){
|
if ($session->access != BANNED){
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 1) {
|
if($golds['gold'] > 1) {
|
||||||
echo '
|
echo '
|
||||||
<a href="plus.php?id=7"><span>On';
|
<a href="plus.php?id=7"><span>On';
|
||||||
@@ -389,7 +389,7 @@ if (mysql_num_rows($MyGold)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 1) {
|
if($golds['gold'] > 1) {
|
||||||
echo '
|
echo '
|
||||||
<a href="banned.php"><span>On';
|
<a href="banned.php"><span>On';
|
||||||
@@ -412,7 +412,7 @@ if (mysql_num_rows($MyGold)) {
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($session->access != BANNED){
|
if ($session->access != BANNED){
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 2) {
|
if($golds['gold'] > 2) {
|
||||||
echo ' <a href="build.php?gid=17&t=3"><span>NPC';
|
echo ' <a href="build.php?gid=17&t=3"><span>NPC';
|
||||||
} else {
|
} else {
|
||||||
@@ -420,7 +420,7 @@ if (mysql_num_rows($MyGold)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['gold'] > 2) {
|
if($golds['gold'] > 2) {
|
||||||
echo ' <a href="banned.php"><span>NPC';
|
echo ' <a href="banned.php"><span>NPC';
|
||||||
} else {
|
} else {
|
||||||
@@ -464,10 +464,10 @@ if (mysql_num_rows($MyGold)) {
|
|||||||
<td class="act">
|
<td class="act">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
|
|
||||||
if (mysql_num_rows($MyGold)) {
|
if (mysqli_num_rows($MyGold)) {
|
||||||
if($golds['goldclub']==0){
|
if($golds['goldclub']==0){
|
||||||
if($golds['gold'] > 99) {
|
if($golds['gold'] > 99) {
|
||||||
echo '
|
echo '
|
||||||
|
|||||||
+24
-51
@@ -1,56 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
////////////// made by alq0rsan /////////////////////////
|
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||||
if($session->access != BANNED && $session->gold >= 10){
|
if($session->access != BANNED && $session->gold >= 10){
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
|
if($session->sit == 0) {
|
||||||
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
if (mysqli_num_rows($MyGold) == 1) {
|
||||||
$uuid = mysql_fetch_array($MyId);
|
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());
|
||||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
|
} else {
|
||||||
$uuVilid = mysql_fetch_array($MyVilId);
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = '".($golds['plus']+PLUS_TIME)."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||||
|
}
|
||||||
|
$done1 = " Plus Account";
|
||||||
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
|
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());
|
||||||
$today = date("mdHi");
|
} else {
|
||||||
if($session->sit == 0) {
|
$done1 = " You need more gold";
|
||||||
if (mysql_num_rows($MyGold)) {
|
}
|
||||||
if($golds['6'] > 2) {
|
} else {
|
||||||
|
$done1 = "Failed plus attempt";
|
||||||
if (mysql_num_rows($MyGold)) {
|
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed Plus Account')") or die(mysqli_error());
|
||||||
|
}
|
||||||
|
}
|
||||||
if($golds['12'] == 0) {
|
header("Location: plus.php?id=3");
|
||||||
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());
|
|
||||||
} else {
|
} else {
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set plus = '".($golds['12']+PLUS_TIME)."' where `id`='".$session->uid."'") or die(mysql_error());
|
header("Location: banned.php");
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$done1 = " 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 = " You need more gold";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
header("Location: plus.php?id=3");
|
|
||||||
}else{
|
|
||||||
header("Location: banned.php");
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
+26
-52
@@ -1,55 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
////////////// made by alq0rsan /////////////////////////
|
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||||
if($session->access != BANNED){
|
if($session->access != BANNED && $session->gold >= 5){
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
|
if($session->sit == 0) {
|
||||||
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
if (mysqli_num_rows($MyGold) == 1) {
|
||||||
$uuid = mysql_fetch_array($MyId);
|
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());
|
||||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
|
} else {
|
||||||
$uuVilid = mysql_fetch_array($MyVilId);
|
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";
|
||||||
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
|
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());
|
||||||
$today = date("mdHi");
|
} else {
|
||||||
if($session->sit == 0) {
|
$done1 = "You need more gold";
|
||||||
if (mysql_num_rows($MyGold)) {
|
}
|
||||||
if($golds['6'] > 2) {
|
} else {
|
||||||
|
$done1 = "Failed lumber attempt";
|
||||||
if (mysql_num_rows($MyGold)) {
|
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Lumber')") or die(mysqli_error());
|
||||||
|
}
|
||||||
if($golds['b1'] < time()) {
|
}
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set b1 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
header("Location: plus.php?id=3");
|
||||||
} else {
|
} 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
@@ -32,8 +32,8 @@ echo <<<EOT
|
|||||||
EOT;
|
EOT;
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
$account = mysql_real_escape_string($_POST['username']);
|
$account = mysqli_real_escape_string($GLOBALS['link'],$_POST['username']);
|
||||||
$reward = mysql_real_escape_string($_POST['reward']);
|
$reward = mysqli_real_escape_string($GLOBALS['link'],$_POST['reward']);
|
||||||
$valid=TRUE;
|
$valid=TRUE;
|
||||||
|
|
||||||
|
|
||||||
@@ -50,8 +50,8 @@ EOT;
|
|||||||
$plusTime = 604800; // 7 days
|
$plusTime = 604800; // 7 days
|
||||||
$time = time();
|
$time = time();
|
||||||
$giveplus = ($time + $plustime);
|
$giveplus = ($time + $plustime);
|
||||||
$accountCheck = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
$accountCheck = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||||
if(mysql_num_rows($accountCheck) <= 0){
|
if(mysqli_num_rows($accountCheck) <= 0){
|
||||||
echo "<b>ERROR:</b><br />";
|
echo "<b>ERROR:</b><br />";
|
||||||
echo "The account name you entered does not exist.";
|
echo "The account name you entered does not exist.";
|
||||||
echo "<br /><br /><input type=\"button\" value=\"Back\" onclick=\"history.go(-1)\">";
|
echo "<br /><br /><input type=\"button\" value=\"Back\" onclick=\"history.go(-1)\">";
|
||||||
@@ -59,10 +59,10 @@ EOT;
|
|||||||
}
|
}
|
||||||
if(!$valid) break;
|
if(!$valid) break;
|
||||||
$valid=TRUE;
|
$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());
|
$plusCheck = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||||
$pluss = mysql_fetch_array($plusCheck);
|
$pluss = mysqli_fetch_array($plusCheck);
|
||||||
|
|
||||||
switch($reward){
|
switch($reward){
|
||||||
case 'p_plus':
|
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] ){
|
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>";
|
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
|
}else
|
||||||
if($time < $pluss[$key]){
|
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>";
|
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{
|
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>";
|
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>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,22 +25,22 @@ if($_POST) {
|
|||||||
foreach($_POST as $key => $value) {
|
foreach($_POST as $key => $value) {
|
||||||
if(substr($key, 0, 2) == 'nr') {
|
if(substr($key, 0, 2) == 'nr') {
|
||||||
$i = substr($key, 2);
|
$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') {
|
if(substr($key, 0, 2) == 'id') {
|
||||||
$i = substr($key, 2);
|
$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') {
|
if(substr($key, 0, 8) == 'linkname') {
|
||||||
$i = substr($key, 8);
|
$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') {
|
if(substr($key, 0, 8) == 'linkziel') {
|
||||||
$i = substr($key, 8);
|
$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
|
// Add new link
|
||||||
$userid = $session->uid;
|
$userid = $session->uid;
|
||||||
if($session->access!=BANNED){
|
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{
|
}else{
|
||||||
header("Location: banned.php");
|
header("Location: banned.php");
|
||||||
}
|
}
|
||||||
} elseif(trim($link['nr']) != '' AND trim($link['linkname']) != '' AND trim($link['linkziel']) != '' AND trim($link['id']) != '') {
|
} elseif(trim($link['nr']) != '' AND trim($link['linkname']) != '' AND trim($link['linkziel']) != '' AND trim($link['id']) != '') {
|
||||||
// Update link
|
// Update link
|
||||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
|
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
|
||||||
$data = mysql_fetch_assoc($query);
|
$data = mysqli_fetch_assoc($query);
|
||||||
|
|
||||||
// May the user update this entry?
|
// May the user update this entry?
|
||||||
if($data['userid'] == $session->uid) {
|
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']) != '') {
|
} elseif(trim($link['nr']) == '' AND trim($link['linkname']) == '' AND trim($link['linkziel']) == '' AND trim($link['id']) != '') {
|
||||||
// Delete entry
|
// Delete entry
|
||||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
|
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
|
||||||
$data = mysql_fetch_assoc($query);
|
$data = mysqli_fetch_assoc($query);
|
||||||
|
|
||||||
// May the user delete this entry?
|
// May the user delete this entry?
|
||||||
if($data['userid'] == $session->uid) {
|
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
|
// 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();
|
$links = array();
|
||||||
while($data = mysql_fetch_assoc($query)) {
|
while($data = mysqli_fetch_assoc($query)) {
|
||||||
$links[] = $data;
|
$links[] = $data;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,21 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
$place = $place1 = $place2 = $place3 = "?";
|
$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);
|
for($i=1;$i<=0;$i++) {
|
||||||
if (!$con)
|
|
||||||
{
|
|
||||||
die('Could not connect: ' . mysql_error());
|
|
||||||
}
|
|
||||||
|
|
||||||
for($i=1;$i<=0;$i++) {
|
|
||||||
echo "Row ".$i;
|
echo "Row ".$i;
|
||||||
}
|
}
|
||||||
|
|
||||||
mysql_select_db($db_name, $con);
|
$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");
|
||||||
$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");
|
|
||||||
?>
|
?>
|
||||||
<table cellpadding="1" cellspacing="1">
|
<table cellpadding="1" cellspacing="1">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -39,7 +30,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result))
|
while($row = mysqli_fetch_array($result))
|
||||||
{
|
{
|
||||||
if($row['id']==$session->alliance) {
|
if($row['id']==$session->alliance) {
|
||||||
$place = $i;
|
$place = $i;
|
||||||
@@ -56,7 +47,7 @@
|
|||||||
<td colspan="3" class="empty"></td>
|
<td colspan="3" class="empty"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result2))
|
while($row = mysqli_fetch_array($result2))
|
||||||
{
|
{
|
||||||
if($row['id'] == $session->alliance) {
|
if($row['id'] == $session->alliance) {
|
||||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||||
@@ -75,8 +66,8 @@
|
|||||||
for($i=1;$i<=0;$i++) {
|
for($i=1;$i<=0;$i++) {
|
||||||
echo "Row ".$i;
|
echo "Row ".$i;
|
||||||
}
|
}
|
||||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY dp DESC, id DESC Limit 10");
|
$result = mysqli_query($GLOBALS['link'],"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");
|
$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">
|
<table cellpadding="1" cellspacing="1" id="top10_defs" class="top10 row_table_data">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -93,7 +84,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result))
|
while($row = mysqli_fetch_array($result))
|
||||||
{
|
{
|
||||||
if($row['id']==$session->alliance) {
|
if($row['id']==$session->alliance) {
|
||||||
$place1 = $i;
|
$place1 = $i;
|
||||||
@@ -111,7 +102,7 @@
|
|||||||
<td colspan="3" class="empty"></td>
|
<td colspan="3" class="empty"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result2))
|
while($row = mysqli_fetch_array($result2))
|
||||||
{
|
{
|
||||||
if($row['id'] == $session->alliance) {
|
if($row['id'] == $session->alliance) {
|
||||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||||
@@ -129,8 +120,8 @@
|
|||||||
for($i=1;$i<=0;$i++) {
|
for($i=1;$i<=0;$i++) {
|
||||||
echo "Row ".$i;
|
echo "Row ".$i;
|
||||||
}
|
}
|
||||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY clp DESC, id DESC Limit 10");
|
$result = mysqli_query($GLOBALS['link'],"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");
|
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY clp DESC Limit 1");
|
||||||
?>
|
?>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
|
<table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
|
||||||
@@ -148,7 +139,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result))
|
while($row = mysqli_fetch_array($result))
|
||||||
{
|
{
|
||||||
if($row['id']==$session->alliance) {
|
if($row['id']==$session->alliance) {
|
||||||
$place2 = $i;
|
$place2 = $i;
|
||||||
@@ -165,7 +156,7 @@
|
|||||||
<td colspan="3" class="empty"></td>
|
<td colspan="3" class="empty"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result2))
|
while($row = mysqli_fetch_array($result2))
|
||||||
{
|
{
|
||||||
if($row['id'] == $session->alliance) {
|
if($row['id'] == $session->alliance) {
|
||||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||||
@@ -182,8 +173,8 @@
|
|||||||
for($i=1;$i<=0;$i++) {
|
for($i=1;$i<=0;$i++) {
|
||||||
echo "Row ".$i;
|
echo "Row ".$i;
|
||||||
}
|
}
|
||||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY RR DESC, id DESC Limit 10");
|
$result = mysqli_query($GLOBALS['link'],"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");
|
$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">
|
<table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -200,7 +191,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result))
|
while($row = mysqli_fetch_array($result))
|
||||||
{
|
{
|
||||||
if($row['RR'] >= 0) {
|
if($row['RR'] >= 0) {
|
||||||
if($row['id']==$session->alliance) {
|
if($row['id']==$session->alliance) {
|
||||||
@@ -219,7 +210,7 @@
|
|||||||
<td colspan="3" class="empty"></td>
|
<td colspan="3" class="empty"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result2))
|
while($row = mysqli_fetch_array($result2))
|
||||||
{
|
{
|
||||||
if($row['id'] == $session->alliance) {
|
if($row['id'] == $session->alliance) {
|
||||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||||
@@ -230,7 +221,7 @@
|
|||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
mysql_close($con);
|
mysqli_close($con);
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -9,11 +9,11 @@
|
|||||||
| Copyright: TravianX Project All rights reserved |
|
| Copyright: TravianX Project All rights reserved |
|
||||||
\** --------------------------------------------------- **/
|
\** --------------------------------------------------- **/
|
||||||
|
|
||||||
$tribe1 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 1");
|
$tribe1 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 1");
|
||||||
$tribe2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 2");
|
$tribe2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 2");
|
||||||
$tribe3 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 3");
|
$tribe3 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 3");
|
||||||
$tribes = array(mysql_num_rows($tribe1), mysql_num_rows($tribe2), mysql_num_rows($tribe3));
|
$tribes = array(mysqli_num_rows($tribe1), mysqli_num_rows($tribe2), mysqli_num_rows($tribe3));
|
||||||
$users = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5")); ?>
|
$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">
|
<table cellpadding="1" cellspacing="1" id="world_player" class="world">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<th>Active players</th>
|
<th>Active players</th>
|
||||||
|
|
||||||
<td><?php
|
<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>
|
echo $active; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<th>Players online</th>
|
<th>Players online</th>
|
||||||
|
|
||||||
<td><?php
|
<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>
|
echo $online; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -1,21 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
$place = $place1 = $place2 = $place3 = "?";
|
$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++) {
|
for($i=1;$i<=0;$i++) {
|
||||||
echo "Row ".$i;
|
echo "Row ".$i;
|
||||||
}
|
}
|
||||||
|
|
||||||
//mysql_select_db($db_name, $con);
|
$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");
|
||||||
$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");
|
|
||||||
?>
|
?>
|
||||||
<table cellpadding="1" cellspacing="1">
|
<table cellpadding="1" cellspacing="1">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -39,7 +31,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result))
|
while($row = mysqli_fetch_array($result))
|
||||||
{
|
{
|
||||||
if($row['id']==$session->uid) {
|
if($row['id']==$session->uid) {
|
||||||
if($row['id']==$session->uid) {
|
if($row['id']==$session->uid) {
|
||||||
@@ -56,7 +48,7 @@
|
|||||||
<td colspan="3" class="empty"></td>
|
<td colspan="3" class="empty"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result2))
|
while($row = mysqli_fetch_array($result2))
|
||||||
{
|
{
|
||||||
if($row['id'] == $session->uid) {
|
if($row['id'] == $session->uid) {
|
||||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||||
@@ -75,8 +67,8 @@
|
|||||||
for($i=1;$i<=0;$i++) {
|
for($i=1;$i<=0;$i++) {
|
||||||
echo "Row ".$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");
|
$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 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY dp DESC Limit 1");
|
$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">
|
<table cellpadding="1" cellspacing="1" id="top10_defs" class="top10 row_table_data">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -93,7 +85,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result))
|
while($row = mysqli_fetch_array($result))
|
||||||
{
|
{
|
||||||
if($row['id']==$session->uid) {
|
if($row['id']==$session->uid) {
|
||||||
$place1 = $i;
|
$place1 = $i;
|
||||||
@@ -111,7 +103,7 @@
|
|||||||
<td colspan="3" class="empty"></td>
|
<td colspan="3" class="empty"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result2))
|
while($row = mysqli_fetch_array($result2))
|
||||||
{
|
{
|
||||||
if($row['id'] == $session->uid) {
|
if($row['id'] == $session->uid) {
|
||||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||||
@@ -129,8 +121,8 @@
|
|||||||
for($i=1;$i<=0;$i++) {
|
for($i=1;$i<=0;$i++) {
|
||||||
echo "Row ".$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");
|
$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 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY clp DESC Limit 1");
|
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY clp DESC Limit 1");
|
||||||
?>
|
?>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
|
<table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
|
||||||
@@ -148,7 +140,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result))
|
while($row = mysqli_fetch_array($result))
|
||||||
{
|
{
|
||||||
if($row['id']==$session->uid) {
|
if($row['id']==$session->uid) {
|
||||||
$place2 = $i;
|
$place2 = $i;
|
||||||
@@ -165,7 +157,7 @@
|
|||||||
<td colspan="3" class="empty"></td>
|
<td colspan="3" class="empty"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result2))
|
while($row = mysqli_fetch_array($result2))
|
||||||
{
|
{
|
||||||
if($row['id'] == $session->uid) {
|
if($row['id'] == $session->uid) {
|
||||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||||
@@ -181,8 +173,8 @@
|
|||||||
for($i=1;$i<=0;$i++) {
|
for($i=1;$i<=0;$i++) {
|
||||||
echo "Row ".$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");
|
$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 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY RR DESC Limit 1");
|
$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">
|
<table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -199,7 +191,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result))
|
while($row = mysqli_fetch_array($result))
|
||||||
{
|
{
|
||||||
if($row['RR'] >= 0) {
|
if($row['RR'] >= 0) {
|
||||||
if($row['id']==$session->uid) {
|
if($row['id']==$session->uid) {
|
||||||
@@ -218,7 +210,7 @@
|
|||||||
<td colspan="3" class="empty"></td>
|
<td colspan="3" class="empty"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
while($row = mysql_fetch_array($result2))
|
while($row = mysqli_fetch_array($result2))
|
||||||
{
|
{
|
||||||
if($row['id']==$session->uid) {
|
if($row['id']==$session->uid) {
|
||||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||||
@@ -229,7 +221,7 @@
|
|||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// mysql_close($con);
|
// mysqli_close($con);
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
if (WW == True)
|
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
|
FROM " . TB_PREFIX . "users
|
||||||
INNER JOIN " . TB_PREFIX . "vdata ON " . TB_PREFIX . "users.id = " . TB_PREFIX . "vdata.owner
|
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
|
INNER JOIN " . TB_PREFIX . "fdata ON " . TB_PREFIX . "fdata.vref = " . TB_PREFIX . "vdata.wref
|
||||||
@@ -24,11 +24,11 @@ if (WW == True)
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
$cont = 1;
|
$cont = 1;
|
||||||
while ($row = mysql_fetch_array($result))
|
while ($row = mysqli_fetch_array($result))
|
||||||
{
|
{
|
||||||
$ally = $database->getAlliance($row[alliance]);
|
$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');
|
$query = @mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vref'] . ' ORDER BY `attack_time` ASC LIMIT 1');
|
||||||
$row2 = @mysql_fetch_assoc($query);
|
$row2 = @mysqli_fetch_assoc($query);
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $cont; $cont++; ?>.</td>
|
<td><?php echo $cont; $cont++; ?>.</td>
|
||||||
|
|||||||
@@ -363,8 +363,8 @@ $end = ($tribe*10);
|
|||||||
{
|
{
|
||||||
//$uid
|
//$uid
|
||||||
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = $uid";
|
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = $uid";
|
||||||
$result = mysql_query($q);
|
$result = mysqli_query($GLOBALS['link'],$q);
|
||||||
$hero_f=mysql_fetch_array($result);
|
$hero_f=mysqli_fetch_array($result);
|
||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = ${'u'.$hero_unit}['speed'];
|
$speeds[] = ${'u'.$hero_unit}['speed'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,8 +138,8 @@ $tocoor = $database->getCoor($enforce['vref']);
|
|||||||
}
|
}
|
||||||
if ($enforce['hero']>0){
|
if ($enforce['hero']>0){
|
||||||
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
||||||
$resulth = mysql_query($qh);
|
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||||
$hero_f=mysql_fetch_array($resulth);
|
$hero_f=mysqli_fetch_array($resulth);
|
||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,8 +139,8 @@ $tocoor = $database->getCoor($enforce['vref']);
|
|||||||
}
|
}
|
||||||
if ($enforce['hero']>0){
|
if ($enforce['hero']>0){
|
||||||
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
||||||
$resulth = mysql_query($qh);
|
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||||
$hero_f=mysql_fetch_array($resulth);
|
$hero_f=mysqli_fetch_array($resulth);
|
||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,8 +138,8 @@ $tocoor = $database->getCoor($enforce['vref']);
|
|||||||
}
|
}
|
||||||
if ($enforce['hero']>0){
|
if ($enforce['hero']>0){
|
||||||
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
||||||
$resulth = mysql_query($qh);
|
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||||
$hero_f=mysql_fetch_array($resulth);
|
$hero_f=mysqli_fetch_array($resulth);
|
||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,8 +139,8 @@ $tocoor = $database->getCoor($enforce['vref']);
|
|||||||
}
|
}
|
||||||
if ($enforce['hero']>0){
|
if ($enforce['hero']>0){
|
||||||
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
||||||
$resulth = mysql_query($qh);
|
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||||
$hero_f=mysql_fetch_array($resulth);
|
$hero_f=mysqli_fetch_array($resulth);
|
||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,8 +138,8 @@ $tocoor = $database->getCoor($enforce['vref']);
|
|||||||
}
|
}
|
||||||
if ($enforce['hero']>0){
|
if ($enforce['hero']>0){
|
||||||
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
||||||
$resulth = mysql_query($qh);
|
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||||
$hero_f=mysql_fetch_array($resulth);
|
$hero_f=mysqli_fetch_array($resulth);
|
||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
$sql = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$lid." order by id asc";
|
$sql = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$lid." order by id asc";
|
||||||
$array = $database->query_return($sql);
|
$array = $database->query_return($sql);
|
||||||
foreach($array as $row){
|
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'];
|
$sid = $row['id'];
|
||||||
$wref = $row['towref'];
|
$wref = $row['towref'];
|
||||||
$t1 = $row['t1'];$t2 = $row['t2'];$t3 = $row['t3'];$t4 = $row['t4'];$t5 = $row['t5'];
|
$t1 = $row['t1'];$t2 = $row['t2'];$t3 = $row['t3'];$t4 = $row['t4'];$t5 = $row['t5'];
|
||||||
|
|||||||
@@ -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");
|
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");
|
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY wref = $village->wid DESC");
|
||||||
$query = mysql_num_rows($sql);
|
$query = mysqli_num_rows($sql);
|
||||||
while($row = mysql_fetch_array($sql)){
|
while($row = mysqli_fetch_array($sql)){
|
||||||
$lid = $row["id"];
|
$lid = $row["id"];
|
||||||
$lname = $row["name"];
|
$lname = $row["name"];
|
||||||
$lowner = $row["owner"];
|
$lowner = $row["owner"];
|
||||||
@@ -50,12 +50,12 @@ while($row = mysql_fetch_array($sql)){
|
|||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$sql2 = mysql_query("SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $lid ORDER BY distance ASC");
|
$sql2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $lid ORDER BY distance ASC");
|
||||||
$query2 = mysql_num_rows($sql2);
|
$query2 = mysqli_num_rows($sql2);
|
||||||
if($query2 == 0) {
|
if($query2 == 0) {
|
||||||
echo '<td class="noData" colspan="7">There is not any raid list.</td>';
|
echo '<td class="noData" colspan="7">There is not any raid list.</td>';
|
||||||
}else{
|
}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'];
|
$id= $row['id'];$lid = $row['lid'];$towref = $row['towref'];$x = $row['x'];$y = $row['y'];
|
||||||
if($village->wid == $towref){
|
if($village->wid == $towref){
|
||||||
$distance = '0';
|
$distance = '0';
|
||||||
@@ -192,9 +192,9 @@ $vdata = $database->getVillage($towref);
|
|||||||
<?php
|
<?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");
|
$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)";
|
$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");
|
$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(mysql_num_rows($getnotice) > 0){
|
if(mysqli_num_rows($getnotice) > 0){
|
||||||
while($row2 = mysql_fetch_array($getnotice)){
|
while($row2 = mysqli_fetch_array($getnotice)){
|
||||||
$dataarray = explode(",",$row2['data']);
|
$dataarray = explode(",",$row2['data']);
|
||||||
$type2 = $row2['ntype'];
|
$type2 = $row2['ntype'];
|
||||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport".$row2['ntype']."\" title=\"".$noticeClass[$type2]."\"> ";
|
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({
|
Travian.Game.RaidList.setData({
|
||||||
<?php
|
<?php
|
||||||
$result = mysql_query('SELECT * FROM '.TB_PREFIX.'farmlist WHERE wref = '.$village->wid.'');
|
$result = mysqli_query($GLOBALS['link'],'SELECT * FROM '.TB_PREFIX.'farmlist WHERE wref = '.$village->wid.'');
|
||||||
$query1 = mysql_num_rows($result);
|
$query1 = mysqli_num_rows($result);
|
||||||
$NUM1 = 1;
|
$NUM1 = 1;
|
||||||
while($row = mysql_fetch_array($result)){
|
while($row = mysqli_fetch_array($result)){
|
||||||
$lid = $row['id'];
|
$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']; ?>},
|
"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"},
|
"directions":{"village":"none","ew":"none","distance":"asc","troops":"none","lastRaid":"none"},
|
||||||
"slots":{<?php
|
"slots":{<?php
|
||||||
$result3 = mysql_query('SELECT * FROM '.TB_PREFIX.'raidlist WHERE lid = '.$lid.'');
|
$result3 = mysqli_query($GLOBALS['link'],'SELECT * FROM '.TB_PREFIX.'raidlist WHERE lid = '.$lid.'');
|
||||||
$query2 = mysql_num_rows($result3);
|
$query2 = mysqli_num_rows($result3);
|
||||||
$NUM2 = 1;
|
$NUM2 = 1;
|
||||||
while($row3 = mysql_fetch_array($result3)){
|
while($row3 = mysqli_fetch_array($result3)){
|
||||||
$id = $row3['id'];
|
$id = $row3['id'];
|
||||||
$t1 = $row3['t1'];$t2 = $row3['t2'];$t3 = $row3['t3'];$t4 = $row3['t4'];$t5 = $row3['t5'];$t6 = $row3['t6'];$t7 = $row3['t7'];
|
$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'];
|
$t8 = $row3['t8'];$t9 = $row3['t9'];$t10 = $row3['t10'];
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ $vdata = $database->getVillage($Wref);
|
|||||||
<select name="lid">
|
<select name="lid">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
|
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
|
||||||
while($row = mysql_fetch_array($sql)){
|
while($row = mysqli_fetch_array($sql)){
|
||||||
$lid = $row["id"];
|
$lid = $row["id"];
|
||||||
$lname = $row["name"];
|
$lname = $row["name"];
|
||||||
$lowner = $row["owner"];
|
$lowner = $row["owner"];
|
||||||
@@ -123,7 +123,7 @@ $lvname = $database->getVillageField($row["wref"], 'name');
|
|||||||
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$_GET['lid']."";
|
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$_GET['lid']."";
|
||||||
$arraywref = $database->query_return($getwref);
|
$arraywref = $database->query_return($getwref);
|
||||||
echo '<option value="">Select village</option>';
|
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){
|
foreach($arraywref as $row){
|
||||||
$towref = $row["towref"];
|
$towref = $row["towref"];
|
||||||
$tocoor = $database->getCoor($towref);
|
$tocoor = $database->getCoor($towref);
|
||||||
|
|||||||
@@ -92,8 +92,8 @@ $lid2 = $getlid['lid'];
|
|||||||
<td>
|
<td>
|
||||||
<select onchange="getTargetsByLid();" id="lid" name="lid">
|
<select onchange="getTargetsByLid();" id="lid" name="lid">
|
||||||
<?php
|
<?php
|
||||||
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
|
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
|
||||||
while($row = mysql_fetch_array($sql)){
|
while($row = mysqli_fetch_array($sql)){
|
||||||
$lid = $row["id"];
|
$lid = $row["id"];
|
||||||
$lname = $row["name"];
|
$lname = $row["name"];
|
||||||
$lowner = $row["owner"];
|
$lowner = $row["owner"];
|
||||||
@@ -129,7 +129,7 @@ $lvname = $database->getVillageField($row["wref"], 'name');
|
|||||||
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $lid2";
|
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $lid2";
|
||||||
$arraywref = $database->query_return($getwref);
|
$arraywref = $database->query_return($getwref);
|
||||||
echo '<option value="">Select village</option>';
|
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){
|
foreach($arraywref as $row){
|
||||||
$towref = $row["towref"];
|
$towref = $row["towref"];
|
||||||
$tocoor = $database->getCoor($towref);
|
$tocoor = $database->getCoor($towref);
|
||||||
|
|||||||
+2
-2
@@ -11,9 +11,9 @@
|
|||||||
|
|
||||||
// Fetch all links
|
// Fetch all links
|
||||||
$query = $database->getLinks($session->uid);
|
$query = $database->getLinks($session->uid);
|
||||||
if (mysql_num_rows($query) > 0){
|
if (mysqli_num_rows($query) > 0){
|
||||||
$links = array();
|
$links = array();
|
||||||
while($data = mysql_fetch_assoc($query)) {
|
while($data = mysqli_fetch_assoc($query)) {
|
||||||
$links[] = $data;
|
$links[] = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
#################################################################################
|
#################################################################################
|
||||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||||
## --------------------------------------------------------------------------- ##
|
## --------------------------------------------------------------------------- ##
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
#################################################################################
|
#################################################################################
|
||||||
|
|
||||||
|
|
||||||
$txt="";
|
$txt="Testing system message";
|
||||||
|
|
||||||
//bbcode = html code
|
//bbcode = html code
|
||||||
$txt = preg_replace("/\[b\]/is",'<b>', $txt);
|
$txt = preg_replace("/\[b\]/is",'<b>', $txt);
|
||||||
|
|||||||
@@ -186,8 +186,8 @@ if(isset($_GET['o'])) {
|
|||||||
|
|
||||||
if ($prisoner['t11']>0){
|
if ($prisoner['t11']>0){
|
||||||
$p_qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$p_owner."";
|
$p_qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$p_owner."";
|
||||||
$p_resulth = mysql_query($p_qh);
|
$p_resulth = mysqli_query($GLOBALS['link'],$p_qh);
|
||||||
$p_hero_f=mysql_fetch_array($p_resulth);
|
$p_hero_f=mysqli_fetch_array($p_resulth);
|
||||||
$p_hero_unit=$p_hero_f['unit'];
|
$p_hero_unit=$p_hero_f['unit'];
|
||||||
$p_speeds[] = $GLOBALS['u'.$p_hero_unit]['speed'];
|
$p_speeds[] = $GLOBALS['u'.$p_hero_unit]['speed'];
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ if(isset($_GET['o'])) {
|
|||||||
$troops = $prisoner['t1']+$prisoner['t2']+$prisoner['t3']+$prisoner['t4']+$prisoner['t5']+$prisoner['t6']+$prisoner['t7']+$prisoner['t8']+$prisoner['t9']+$prisoner['t10']+$prisoner['t11'];
|
$troops = $prisoner['t1']+$prisoner['t2']+$prisoner['t3']+$prisoner['t4']+$prisoner['t5']+$prisoner['t6']+$prisoner['t7']+$prisoner['t8']+$prisoner['t9']+$prisoner['t10']+$prisoner['t11'];
|
||||||
if($prisoner['t11'] > 0){
|
if($prisoner['t11'] > 0){
|
||||||
$p_owner = $database->getVillageField($prisoner['from'],"owner");
|
$p_owner = $database->getVillageField($prisoner['from'],"owner");
|
||||||
mysql_query("UPDATE ".TB_PREFIX."hero SET `dead` = '1', `health` = '0' WHERE `uid` = '".$p_owner."'");
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `dead` = '1', `health` = '0' WHERE `uid` = '".$p_owner."'");
|
||||||
}
|
}
|
||||||
$database->modifyUnit($prisoner['wref'],array("99o"),array($troops),array(0));
|
$database->modifyUnit($prisoner['wref'],array("99o"),array($troops),array(0));
|
||||||
$database->deletePrisoners($prisoner['id']);
|
$database->deletePrisoners($prisoner['id']);
|
||||||
|
|||||||
@@ -69,12 +69,12 @@ $automation->isWinner();
|
|||||||
<?php
|
<?php
|
||||||
if ($amount == 199) {
|
if ($amount == 199) {
|
||||||
// Statement retrieve Gold Package A
|
// Statement retrieve Gold Package A
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
$goldnow = $golds['6'] + 60;
|
$goldnow = $golds['6'] + 60;
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysql_error());
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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());
|
||||||
$golds1 = mysql_fetch_array($MyGold);
|
$golds1 = mysqli_fetch_array($MyGold);
|
||||||
?><p>Thank you for your purchase here at <?php echo SERVER_NAME ?></p><p>Below you see the entry record. Out of it, you can observe your old as well as your new account balance.</p>
|
?><p>Thank you for your purchase here at <?php echo SERVER_NAME ?></p><p>Below you see the entry record. Out of it, you can observe your old as well as your new account balance.</p>
|
||||||
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -117,12 +117,12 @@ $golds1 = mysql_fetch_array($MyGold);
|
|||||||
}
|
}
|
||||||
if ($amount == 499) {
|
if ($amount == 499) {
|
||||||
// Statement retrieve Gold Package B
|
// Statement retrieve Gold Package B
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
$goldnow = $golds['6'] + 120;
|
$goldnow = $golds['6'] + 120;
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysql_error());
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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());
|
||||||
$golds1 = mysql_fetch_array($MyGold);
|
$golds1 = mysqli_fetch_array($MyGold);
|
||||||
?><p>Thank you for your purchase here at <?php echo SERVER_NAME ?>.</p><p>Below you see the entry record. Out of it, you can observe your old as well as your new account balance.</p>
|
?><p>Thank you for your purchase here at <?php echo SERVER_NAME ?>.</p><p>Below you see the entry record. Out of it, you can observe your old as well as your new account balance.</p>
|
||||||
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -164,12 +164,12 @@ $golds1 = mysql_fetch_array($MyGold);
|
|||||||
}
|
}
|
||||||
if ($amount == 999) {
|
if ($amount == 999) {
|
||||||
// Statement retrieve Gold Package C
|
// Statement retrieve Gold Package C
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
$goldnow = $golds['6'] + 360;
|
$goldnow = $golds['6'] + 360;
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysql_error());
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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());
|
||||||
$golds1 = mysql_fetch_array($MyGold);
|
$golds1 = mysqli_fetch_array($MyGold);
|
||||||
?><p>Thank you for your purchase here at <?php echo SERVER_NAME ?>.</p><p>Below you see the entry record. Out of it, you can observe your old as well as your new account balance.</p>
|
?><p>Thank you for your purchase here at <?php echo SERVER_NAME ?>.</p><p>Below you see the entry record. Out of it, you can observe your old as well as your new account balance.</p>
|
||||||
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -211,12 +211,12 @@ $golds1 = mysql_fetch_array($MyGold);
|
|||||||
}
|
}
|
||||||
if ($amount == 1999) {
|
if ($amount == 1999) {
|
||||||
// Statement retrieve Gold Package D
|
// Statement retrieve Gold Package D
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
$goldnow = $golds['6'] + 1000;
|
$goldnow = $golds['6'] + 1000;
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysql_error());
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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());
|
||||||
$golds1 = mysql_fetch_array($MyGold);
|
$golds1 = mysqli_fetch_array($MyGold);
|
||||||
?><p>Thank you for your purchase here at <?php echo SERVER_NAME ?>.</p><p>Below you see the entry record. Out of it, you can observe your old as well as your new account balance.</p>
|
?><p>Thank you for your purchase here at <?php echo SERVER_NAME ?>.</p><p>Below you see the entry record. Out of it, you can observe your old as well as your new account balance.</p>
|
||||||
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -258,12 +258,12 @@ $golds1 = mysql_fetch_array($MyGold);
|
|||||||
}
|
}
|
||||||
if ($amount == 4999) {
|
if ($amount == 4999) {
|
||||||
// Statement retrieve Gold Package E
|
// Statement retrieve Gold Package E
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
$goldnow = $golds['6'] + 2000;
|
$goldnow = $golds['6'] + 2000;
|
||||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysql_error());
|
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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());
|
||||||
$golds1 = mysql_fetch_array($MyGold);
|
$golds1 = mysqli_fetch_array($MyGold);
|
||||||
?><p>Thank you for your purchase here at <?php echo SERVER_NAME ?>.</p><p>Below you see the entry record. Out of it, you can observe your old as well as your new account balance.</p>
|
?><p>Thank you for your purchase here at <?php echo SERVER_NAME ?>.</p><p>Below you see the entry record. Out of it, you can observe your old as well as your new account balance.</p>
|
||||||
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -304,8 +304,8 @@ $golds1 = mysql_fetch_array($MyGold);
|
|||||||
}
|
}
|
||||||
if ($amount == 0)
|
if ($amount == 0)
|
||||||
{
|
{
|
||||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users 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 = mysql_fetch_array($MyGold);
|
$golds = mysqli_fetch_array($MyGold);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p>Here you can see your current account statement.</p>
|
<p>Here you can see your current account statement.</p>
|
||||||
|
|||||||
+4
-4
@@ -21,8 +21,8 @@ if(isset($_GET['s'])){
|
|||||||
|
|
||||||
if(isset($_GET['fid'])){
|
if(isset($_GET['fid'])){
|
||||||
$fid = preg_replace("/[^0-9]/","",$_GET['fid']);
|
$fid = preg_replace("/[^0-9]/","",$_GET['fid']);
|
||||||
$forum = mysql_query("SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".$fid."");
|
$forum = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".$fid."");
|
||||||
$forum_type = mysql_fetch_array($forum);
|
$forum_type = mysqli_fetch_array($forum);
|
||||||
if($forum_type['forum_name'] != "" && $forum_type['forum_area'] == 0){
|
if($forum_type['forum_name'] != "" && $forum_type['forum_area'] == 0){
|
||||||
if($forum_type['alliance'] != $session->alliance){
|
if($forum_type['alliance'] != $session->alliance){
|
||||||
header("Location: ".$_SERVER['PHP_SELF']);
|
header("Location: ".$_SERVER['PHP_SELF']);
|
||||||
@@ -30,9 +30,9 @@ if(isset($_GET['fid'])){
|
|||||||
}
|
}
|
||||||
}else if(isset($_GET['fid2'])){
|
}else if(isset($_GET['fid2'])){
|
||||||
$fid = preg_replace("/[^0-9]/","",$_GET['fid2']);
|
$fid = preg_replace("/[^0-9]/","",$_GET['fid2']);
|
||||||
$forum = mysql_query("SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".$fid."");
|
$forum = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".$fid."");
|
||||||
if (!empty($forum)) {
|
if (!empty($forum)) {
|
||||||
$forum_type = mysql_fetch_array($forum);
|
$forum_type = mysqli_fetch_array($forum);
|
||||||
if($forum_type['forum_name'] != "" && $forum_type['forum_area'] != 1){
|
if($forum_type['forum_name'] != "" && $forum_type['forum_area'] != 1){
|
||||||
if($forum_type['forum_area'] == 0){
|
if($forum_type['forum_area'] == 0){
|
||||||
if($forum_type['alliance'] != $session->alliance){
|
if($forum_type['alliance'] != $session->alliance){
|
||||||
|
|||||||
@@ -237,16 +237,16 @@ $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 = ".$_GET['moveid'];
|
$qc="SELECT * FROM " . TB_PREFIX . "movement where proc = 0 and moveid = ".$_GET['moveid'];
|
||||||
$resultc=$database->query($qc) or die(mysql_error());
|
$resultc=$database->query($qc) or die(mysqli_error());
|
||||||
|
|
||||||
if (mysql_num_rows($resultc)==1){
|
if (mysqli_num_rows($resultc)==1){
|
||||||
|
|
||||||
$q = "UPDATE " . TB_PREFIX . "movement set proc = 1 where proc = 0 and moveid = ".$_GET['moveid'];
|
$q = "UPDATE " . TB_PREFIX . "movement set proc = 1 where proc = 0 and moveid = ".$_GET['moveid'];
|
||||||
$database->query($q);
|
$database->query($q);
|
||||||
$end=$now+($now-$oldmovement[0]['starttime']);
|
$end=$now+($now-$oldmovement[0]['starttime']);
|
||||||
//echo "6,".$oldmovement[0]['to'].",".$oldmovement[0]['from'].",0,".$now.",".$end;
|
//echo "6,".$oldmovement[0]['to'].",".$oldmovement[0]['from'].",0,".$now.",".$end;
|
||||||
$q2 = "SELECT id FROM " . TB_PREFIX . "send ORDER BY id DESC";
|
$q2 = "SELECT id FROM " . TB_PREFIX . "send ORDER BY id DESC";
|
||||||
$lastid=mysql_fetch_array(mysql_query($q2));
|
$lastid=mysqli_fetch_array(mysqli_query($GLOBALS['link'],$q2));
|
||||||
$newid=$lastid['id']+1;
|
$newid=$lastid['id']+1;
|
||||||
$q2 = "INSERT INTO " . TB_PREFIX . "send values ($newid,0,0,0,0,0)";
|
$q2 = "INSERT INTO " . TB_PREFIX . "send values ($newid,0,0,0,0,0)";
|
||||||
$database->query($q2);
|
$database->query($q2);
|
||||||
|
|||||||
+19
-21
@@ -21,8 +21,6 @@
|
|||||||
include_once ("GameEngine/Session.php");
|
include_once ("GameEngine/Session.php");
|
||||||
include_once ("GameEngine/config.php");
|
include_once ("GameEngine/config.php");
|
||||||
|
|
||||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
|
||||||
mysql_select_db(SQL_DB);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If user is not administrator, access is denied!
|
* If user is not administrator, access is denied!
|
||||||
@@ -112,7 +110,7 @@ if($_POST['password'] != ""){
|
|||||||
***************************";
|
***************************";
|
||||||
|
|
||||||
$q = "INSERT INTO " . TB_PREFIX . "users (id,username,password,access,email,timestamp,tribe,location,act,protect) VALUES (3, '$username', '$password', " . USER . ", '$email', ".time().", $tribe, '', '', 0)";
|
$q = "INSERT INTO " . TB_PREFIX . "users (id,username,password,access,email,timestamp,tribe,location,act,protect) VALUES (3, '$username', '$password', " . USER . ", '$email', ".time().", $tribe, '', '', 0)";
|
||||||
mysql_query($q);
|
mysqli_query($GLOBALS['link'],$q);
|
||||||
unset($q);
|
unset($q);
|
||||||
$uid = $database->getUserField($username, 'id', 1);
|
$uid = $database->getUserField($username, 'id', 1);
|
||||||
$arrayXY=array();
|
$arrayXY=array();
|
||||||
@@ -159,26 +157,26 @@ if($_POST['password'] != ""){
|
|||||||
$database->updateUserField($uid, "access", USER, 1);
|
$database->updateUserField($uid, "access", USER, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$wid = mysql_fetch_assoc(mysql_query("SELECT * FROM " . TB_PREFIX . "vdata WHERE owner = $uid"));
|
$wid = mysqli_fetch_assoc(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "vdata WHERE owner = $uid"));
|
||||||
$q = "UPDATE " . TB_PREFIX . "vdata SET pop = 834 WHERE owner = $uid";
|
$q = "UPDATE " . TB_PREFIX . "vdata SET pop = 834 WHERE owner = $uid";
|
||||||
mysql_query($q) or die(mysql_error());
|
mysqli_query($GLOBALS['link'],$q) or die(mysqli_error());
|
||||||
$q2 = "UPDATE " . TB_PREFIX . "users SET access = 2 WHERE id = $uid";
|
$q2 = "UPDATE " . TB_PREFIX . "users SET access = 2 WHERE id = $uid";
|
||||||
mysql_query($q2) or die(mysql_error());
|
mysqli_query($GLOBALS['link'],$q2) or die(mysqli_error());
|
||||||
if(SPEED > 3) {
|
if(SPEED > 3) {
|
||||||
$speed = 5;
|
$speed = 5;
|
||||||
} else {
|
} else {
|
||||||
$speed = SPEED;
|
$speed = SPEED;
|
||||||
}
|
}
|
||||||
$q3 = "UPDATE " . TB_PREFIX . "units SET u41 = " . (64700 * $speed) . ", u42 = " . (295231 * $speed) . ", u43 = " . (180747 * $speed) . ", u44 = " . (20000 * $speed) . ", u45 = " . (364401 * $speed) . ", u46 = " . (217602 * $speed) . ", u47 = " . (2034 * $speed) . ", u48 = " . (1040 * $speed) . " , u49 = " . (1 * $speed) . ", u50 = " . (9 * $speed) . " WHERE vref = " . $wid['wref'] . "";
|
$q3 = "UPDATE " . TB_PREFIX . "units SET u41 = " . (64700 * $speed) . ", u42 = " . (295231 * $speed) . ", u43 = " . (180747 * $speed) . ", u44 = " . (20000 * $speed) . ", u45 = " . (364401 * $speed) . ", u46 = " . (217602 * $speed) . ", u47 = " . (2034 * $speed) . ", u48 = " . (1040 * $speed) . " , u49 = " . (1 * $speed) . ", u50 = " . (9 * $speed) . " WHERE vref = " . $wid['wref'] . "";
|
||||||
mysql_query($q3) or die(mysql_error());
|
mysqli_query($GLOBALS['link'],$q3) or die(mysqli_error());
|
||||||
$q4 = "UPDATE " . TB_PREFIX . "users SET desc2 = '$desc' WHERE id = $uid";
|
$q4 = "UPDATE " . TB_PREFIX . "users SET desc2 = '$desc' WHERE id = $uid";
|
||||||
mysql_query($q4) or die(mysql_error());
|
mysqli_query($GLOBALS['link'],$q4) or die(mysqli_error());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SCOUTING ALL PLAYERS FIX BY MisterX
|
* SCOUTING ALL PLAYERS FIX BY MisterX
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$natar = mysql_fetch_array(mysql_query("SELECT * FROM " . TB_PREFIX . "vdata WHERE owner = $uid and capital = 1"));
|
$natar = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "vdata WHERE owner = $uid and capital = 1"));
|
||||||
$multiplier = NATARS_UNITS;
|
$multiplier = NATARS_UNITS;
|
||||||
$q = "SELECT * FROM " . TB_PREFIX . "vdata WHERE capital = '1' and owner > '5'";
|
$q = "SELECT * FROM " . TB_PREFIX . "vdata WHERE capital = '1' and owner > '5'";
|
||||||
$array = $database->query_return($q);
|
$array = $database->query_return($q);
|
||||||
@@ -202,22 +200,22 @@ if($_POST['password'] != ""){
|
|||||||
$database->addUnits($wid);
|
$database->addUnits($wid);
|
||||||
$database->addTech($wid);
|
$database->addTech($wid);
|
||||||
$database->addABTech($wid);
|
$database->addABTech($wid);
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET pop = 163 WHERE wref = $wid");
|
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET pop = 163 WHERE wref = $wid");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET name = '$village_name' WHERE wref = $wid");
|
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET name = '$village_name' WHERE wref = $wid");
|
||||||
if(SPEED > 3) {
|
if(SPEED > 3) {
|
||||||
$speed = 5;
|
$speed = 5;
|
||||||
} else {
|
} else {
|
||||||
$speed = SPEED;
|
$speed = SPEED;
|
||||||
}
|
}
|
||||||
if($size == 1) {
|
if($size == 1) {
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(1000, 2000) * $speed) . ", u42 = " . (rand(1500, 2000) * $speed) . ", u43 = " . (rand(2300, 2800) * $speed) . ", u44 = " . (rand(25, 75) * $speed) . ", u45 = " . (rand(1200, 1900) * $speed) . ", u46 = " . (rand(1500, 2000) * $speed) . ", u47 = " . (rand(500, 900) * $speed) . ", u48 = " . (rand(100, 300) * $speed) . " , u49 = " . (rand(1, 5) * $speed) . ", u50 = " . (rand(1, 5) * $speed) . " WHERE vref = " . $wid . "");
|
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(1000, 2000) * $speed) . ", u42 = " . (rand(1500, 2000) * $speed) . ", u43 = " . (rand(2300, 2800) * $speed) . ", u44 = " . (rand(25, 75) * $speed) . ", u45 = " . (rand(1200, 1900) * $speed) . ", u46 = " . (rand(1500, 2000) * $speed) . ", u47 = " . (rand(500, 900) * $speed) . ", u48 = " . (rand(100, 300) * $speed) . " , u49 = " . (rand(1, 5) * $speed) . ", u50 = " . (rand(1, 5) * $speed) . " WHERE vref = " . $wid . "");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 10, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = $wid");
|
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 10, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = $wid");
|
||||||
} elseif($size == 2) {
|
} elseif($size == 2) {
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(2000, 4000) * $speed) . ", u42 = " . (rand(3000, 4000) * $speed) . ", u43 = " . (rand(4600, 5600) * $speed) . ", u44 = " . (rand(50, 150) * $speed) . ", u45 = " . (rand(2400, 3800) * $speed) . ", u46 = " . (rand(3000, 4000) * $speed) . ", u47 = " . (rand(1000, 1800) * $speed) . ", u48 = " . (rand(200, 600) * $speed) . " , u49 = " . (rand(2, 10) * $speed) . ", u50 = " . (rand(2, 10) * $speed) . " WHERE vref = " . $wid . "");
|
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(2000, 4000) * $speed) . ", u42 = " . (rand(3000, 4000) * $speed) . ", u43 = " . (rand(4600, 5600) * $speed) . ", u44 = " . (rand(50, 150) * $speed) . ", u45 = " . (rand(2400, 3800) * $speed) . ", u46 = " . (rand(3000, 4000) * $speed) . ", u47 = " . (rand(1000, 1800) * $speed) . ", u48 = " . (rand(200, 600) * $speed) . " , u49 = " . (rand(2, 10) * $speed) . ", u50 = " . (rand(2, 10) * $speed) . " WHERE vref = " . $wid . "");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 20, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = $wid");
|
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 20, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = $wid");
|
||||||
} elseif($size == 3) {
|
} elseif($size == 3) {
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(4000, 8000) * $speed) . ", u42 = " . (rand(6000, 8000) * $speed) . ", u43 = " . (rand(9200, 11200) * $speed) . ", u44 = " . (rand(100, 300) * $speed) . ", u45 = " . (rand(4800, 7600) * $speed) . ", u46 = " . (rand(6000, 8000) * $speed) . ", u47 = " . (rand(2000, 3600) * $speed) . ", u48 = " . (rand(400, 1200) * $speed) . " , u49 = " . (rand(4, 20) * $speed) . ", u50 = " . (rand(4, 20) * $speed) . " WHERE vref = " . $wid . "");
|
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(4000, 8000) * $speed) . ", u42 = " . (rand(6000, 8000) * $speed) . ", u43 = " . (rand(9200, 11200) * $speed) . ", u44 = " . (rand(100, 300) * $speed) . ", u45 = " . (rand(4800, 7600) * $speed) . ", u46 = " . (rand(6000, 8000) * $speed) . ", u47 = " . (rand(2000, 3600) * $speed) . ", u48 = " . (rand(400, 1200) * $speed) . " , u49 = " . (rand(4, 20) * $speed) . ", u50 = " . (rand(4, 20) * $speed) . " WHERE vref = " . $wid . "");
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 20, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = $wid");
|
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 20, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = $wid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -488,10 +486,10 @@ if($_POST['password'] != ""){
|
|||||||
fwrite($fh, $text);
|
fwrite($fh, $text);
|
||||||
|
|
||||||
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
|
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
|
||||||
$result=mysql_query($query) or die (mysql_error());
|
$result=mysqli_query($GLOBALS['link'],$query) or die (mysqli_error());
|
||||||
for ($i=0; $row=mysql_fetch_row($result); $i++) {
|
for ($i=0; $row=mysqli_fetch_row($result); $i++) {
|
||||||
$updateattquery = mysql_query("UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'")
|
$updateattquery = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'")
|
||||||
or die(mysql_error());
|
or die(mysqli_error());
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Done";
|
echo "Done";
|
||||||
|
|||||||
+6
-6
@@ -126,9 +126,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
define('PREFIX', TB_PREFIX);
|
define('PREFIX', TB_PREFIX);
|
||||||
$type15 = mysql_query("SELECT id,x,y,occupied FROM ".PREFIX."wdata WHERE fieldtype = 6");
|
$type15 = mysqli_query($GLOBALS['link'],"SELECT id,x,y,occupied FROM ".PREFIX."wdata WHERE fieldtype = 6");
|
||||||
$type9 = mysql_query("SELECT id,x,y,occupied FROM ".PREFIX."wdata WHERE fieldtype = 1");
|
$type9 = mysqli_query($GLOBALS['link'],"SELECT id,x,y,occupied FROM ".PREFIX."wdata WHERE fieldtype = 1");
|
||||||
$type_both = mysql_query("SELECT id,x,y,occupied,fieldtype FROM ".PREFIX."wdata WHERE fieldtype = 1 OR fieldtype = 6");
|
$type_both = mysqli_query($GLOBALS['link'],"SELECT id,x,y,occupied,fieldtype FROM ".PREFIX."wdata WHERE fieldtype = 1 OR fieldtype = 6");
|
||||||
|
|
||||||
if(is_numeric($_GET['x']) AND is_numeric($_GET['y'])) {
|
if(is_numeric($_GET['x']) AND is_numeric($_GET['y'])) {
|
||||||
$coor['x'] = $_GET['x'];
|
$coor['x'] = $_GET['x'];
|
||||||
@@ -172,7 +172,7 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
while($row = mysql_fetch_array($type15)) {
|
while($row = mysqli_fetch_array($type15)) {
|
||||||
$dist = getDistance($coor['x'], $coor['y'], $row['x'], $row['y']);
|
$dist = getDistance($coor['x'], $coor['y'], $row['x'], $row['y']);
|
||||||
|
|
||||||
$rows[$dist] = $row;
|
$rows[$dist] = $row;
|
||||||
@@ -224,7 +224,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
unset($rows);
|
unset($rows);
|
||||||
while($row = mysql_fetch_array($type9)) {
|
while($row = mysqli_fetch_array($type9)) {
|
||||||
$dist = getDistance($coor['x'], $coor['y'], $row['x'], $row['y']);
|
$dist = getDistance($coor['x'], $coor['y'], $row['x'], $row['y']);
|
||||||
|
|
||||||
$rows[$dist] = $row;
|
$rows[$dist] = $row;
|
||||||
@@ -277,7 +277,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
unset($rows);
|
unset($rows);
|
||||||
while($row = mysql_fetch_array($type_both)) {
|
while($row = mysqli_fetch_array($type_both)) {
|
||||||
$dist = getDistance($coor['x'], $coor['y'], $row['x'], $row['y']);
|
$dist = getDistance($coor['x'], $coor['y'], $row['x'], $row['y']);
|
||||||
|
|
||||||
$rows[$dist] = $row;
|
$rows[$dist] = $row;
|
||||||
|
|||||||
@@ -12,14 +12,14 @@
|
|||||||
include("GameEngine/Village.php");
|
include("GameEngine/Village.php");
|
||||||
$start = $generator->pageLoadTimeStart();
|
$start = $generator->pageLoadTimeStart();
|
||||||
if(isset($_GET['ok'])){
|
if(isset($_GET['ok'])){
|
||||||
$database->updateUserField($session->uid,'ok','0','1'); $_SESSION['ok'] = '0';
|
$database->updateUserField($session->uid,'ok','0','1'); $_SESSION['ok'] = '0';
|
||||||
}
|
}
|
||||||
if(isset($_GET['newdid'])) {
|
if(isset($_GET['newdid'])) {
|
||||||
$_SESSION['wid'] = $_GET['newdid'];
|
$_SESSION['wid'] = $_GET['newdid'];
|
||||||
$database->query("UPDATE ".TB_PREFIX."users SET village_select=".$_GET['newdid']." WHERE id=".$session->uid);
|
$database->query("UPDATE ".TB_PREFIX."users SET village_select=".$_GET['newdid']." WHERE id=".$session->uid);
|
||||||
header("Location: ".$_SERVER['PHP_SELF']);
|
header("Location: ".$_SERVER['PHP_SELF']);
|
||||||
}else{
|
} else {
|
||||||
$building->procBuild($_GET);
|
$building->procBuild($_GET);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|||||||
@@ -124,8 +124,8 @@ include ("GameEngine/Lang/".LANG.".php");
|
|||||||
|
|
||||||
<td><?php
|
<td><?php
|
||||||
|
|
||||||
$return=mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5");
|
$return=mysqli_query($link,"SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5");
|
||||||
$users=(!empty($return))? mysql_num_rows($return):0;
|
$users=(!empty($return))? mysqli_num_rows($return):0;
|
||||||
echo $users;
|
echo $users;
|
||||||
?></td>
|
?></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -139,8 +139,8 @@ include ("GameEngine/Lang/".LANG.".php");
|
|||||||
|
|
||||||
<td><?php
|
<td><?php
|
||||||
|
|
||||||
$return = mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (3600*24) AND tribe!=0 AND tribe!=4 AND tribe!=5");
|
$return = mysqli_query($link,"SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (3600*24) AND tribe!=0 AND tribe!=4 AND tribe!=5");
|
||||||
$active=(!empty($return))? mysql_num_rows($return):0;
|
$active=(!empty($return))? mysqli_num_rows($return):0;
|
||||||
echo $active;
|
echo $active;
|
||||||
|
|
||||||
?></td>
|
?></td>
|
||||||
@@ -155,8 +155,8 @@ include ("GameEngine/Lang/".LANG.".php");
|
|||||||
|
|
||||||
<td><?php
|
<td><?php
|
||||||
|
|
||||||
$return = mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5");
|
$return = mysqli_query($link,"SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5");
|
||||||
$online=(!empty($return))? mysql_num_rows($return):0;
|
$online=(!empty($return))? mysqli_num_rows($return):0;
|
||||||
echo $online;
|
echo $online;
|
||||||
|
|
||||||
?></td>
|
?></td>
|
||||||
|
|||||||
@@ -206,14 +206,6 @@ define("SQL_DB", "%SDB%");
|
|||||||
// ***** Database - Table Prefix
|
// ***** Database - Table Prefix
|
||||||
define("TB_PREFIX", "%PREFIX%");
|
define("TB_PREFIX", "%PREFIX%");
|
||||||
|
|
||||||
// ***** Database type
|
|
||||||
// 0 = MYSQL
|
|
||||||
// 1 = MYSQLi
|
|
||||||
// default: 1
|
|
||||||
define("DB_TYPE", %CONNECTT%);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
// **** EXTRA SETTINGS **** //
|
// **** EXTRA SETTINGS **** //
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
|
|||||||
@@ -17,39 +17,5 @@ class MYSQLi_DB {
|
|||||||
return mysqli_query($this->connection, $query);
|
return mysqli_query($this->connection, $query);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
class MYSQL_DB {
|
$database = new MYSQLi_DB;
|
||||||
var $connection;
|
|
||||||
function MYSQL_DB() {
|
|
||||||
$this->connection = mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
|
|
||||||
mysql_select_db(SQL_DB, $this->connection) or die(mysql_error());
|
|
||||||
}
|
|
||||||
|
|
||||||
function mysql_exec_batch ($p_query, $p_transaction_safe = true) {
|
|
||||||
if ($p_transaction_safe) {
|
|
||||||
$p_query = 'START TRANSACTION;' . $p_query . '; COMMIT;';
|
|
||||||
};
|
|
||||||
$query_split = preg_split ("/[;]+/", $p_query);
|
|
||||||
foreach ($query_split as $command_line) {
|
|
||||||
$command_line = trim($command_line);
|
|
||||||
if ($command_line != '') {
|
|
||||||
$query_result = mysql_query($command_line);
|
|
||||||
if ($query_result == 0) {
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
return $query_result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function query($query) {
|
|
||||||
return mysql_query($query, $this->connection);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if(DB_TYPE) {
|
|
||||||
$database = new MYSQLi_DB;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$database = new MYSQL_DB;
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ $gameinstall = 1;
|
|||||||
include ("../../GameEngine/Admin/database.php");
|
include ("../../GameEngine/Admin/database.php");
|
||||||
include ("../../GameEngine/Lang/" . LANG . ".php");
|
include ("../../GameEngine/Lang/" . LANG . ".php");
|
||||||
|
|
||||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||||
mysql_select_db(SQL_DB);
|
mysqli_select_db(SQL_DB);
|
||||||
|
|
||||||
if(isset($_POST['mhpw'])) {
|
if(isset($_POST['mhpw'])) {
|
||||||
$password = $_POST['mhpw'];
|
$password = $_POST['mhpw'];
|
||||||
mysql_query("UPDATE " . TB_PREFIX . "users SET password = '" . md5($password) . "' WHERE username = 'Multihunter'");
|
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "users SET password = '" . md5($password) . "' WHERE username = 'Multihunter'");
|
||||||
$wid = $admin->getWref(0, 0);
|
$wid = $admin->getWref(0, 0);
|
||||||
$uid = 5;
|
$uid = 5;
|
||||||
$status = $database->getVillageState($wid);
|
$status = $database->getVillageState($wid);
|
||||||
|
|||||||
@@ -5,19 +5,11 @@
|
|||||||
$gameinstall = 1;
|
$gameinstall = 1;
|
||||||
include ("../../GameEngine/config.php");
|
include ("../../GameEngine/config.php");
|
||||||
include ("../../GameEngine/Database.php");
|
include ("../../GameEngine/Database.php");
|
||||||
include ("../../GameEngine/Admin/database.php");
|
|
||||||
|
|
||||||
|
|
||||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
|
||||||
mysql_select_db(SQL_DB);
|
|
||||||
|
|
||||||
$database->populateOasisdata();
|
$database->populateOasisdata();
|
||||||
$database->populateOasis();
|
$database->populateOasis();
|
||||||
$database->populateOasisUnits2();
|
$database->populateOasisUnits2();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
header("Location: ../index.php?s=6");
|
header("Location: ../index.php?s=6");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php include("templates/script.tpl");
|
<?php include("templates/script.tpl");
|
||||||
|
|
||||||
if(!isset($_GET['s'])) {
|
if(!isset($_GET['s'])) {
|
||||||
$_GET['s']=0;
|
$_GET['s']=0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ class Process {
|
|||||||
$text = preg_replace("'%SPASS%'", $_POST['spass'], $text);
|
$text = preg_replace("'%SPASS%'", $_POST['spass'], $text);
|
||||||
$text = preg_replace("'%SDB%'", $_POST['sdb'], $text);
|
$text = preg_replace("'%SDB%'", $_POST['sdb'], $text);
|
||||||
$text = preg_replace("'%PREFIX%'", $_POST['prefix'], $text);
|
$text = preg_replace("'%PREFIX%'", $_POST['prefix'], $text);
|
||||||
$text = preg_replace("'%CONNECTT%'", $_POST['connectt'], $text);
|
|
||||||
$text = preg_replace("'%AEMAIL%'", $_POST['aemail'], $text);
|
$text = preg_replace("'%AEMAIL%'", $_POST['aemail'], $text);
|
||||||
$text = preg_replace("'%ANAME%'", $_POST['aname'], $text);
|
$text = preg_replace("'%ANAME%'", $_POST['aname'], $text);
|
||||||
$text = preg_replace("'%SUBDOM%'", $_POST['subdom'], $text);
|
$text = preg_replace("'%SUBDOM%'", $_POST['subdom'], $text);
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php
|
|||||||
</td></tr><tr></tr>
|
</td></tr><tr></tr>
|
||||||
<td><span class="f9 c6">Beginners protection length:</span></td><td>
|
<td><span class="f9 c6">Beginners protection length:</span></td><td>
|
||||||
<select name="beginner">
|
<select name="beginner">
|
||||||
|
<option value="0">No protection</option>
|
||||||
<option value="7200">2 hours</option>
|
<option value="7200">2 hours</option>
|
||||||
<option value="10800">3 hours</option>
|
<option value="10800">3 hours</option>
|
||||||
<option value="18000">5 hours</option>
|
<option value="18000">5 hours</option>
|
||||||
@@ -194,10 +195,7 @@ echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php
|
|||||||
<td><span class="f9 c6">Password:</span></td><td><input type="password" name="spass" id="spass"></td></tr><tr>
|
<td><span class="f9 c6">Password:</span></td><td><input type="password" name="spass" id="spass"></td></tr><tr>
|
||||||
<td><span class="f9 c6">DB name:</span></td><td><input type="text" name="sdb" id="sdb"></td></tr><tr>
|
<td><span class="f9 c6">DB name:</span></td><td><input type="text" name="sdb" id="sdb"></td></tr><tr>
|
||||||
<td><span class="f9 c6">Prefix:</span></td><td><input type="text" name="prefix" id="prefix" value="s1_" size="5"></td></tr>
|
<td><span class="f9 c6">Prefix:</span></td><td><input type="text" name="prefix" id="prefix" value="s1_" size="5"></td></tr>
|
||||||
<td><span class="f9 c6">Type:</span></td><td><select name="connectt">
|
<td><span class="f9 c6">Type:</span></td><td>MYSQLi (MYSQL is deprecated)</td></tr>
|
||||||
<option value="0" selected="selected">MYSQL</option>
|
|
||||||
<option value="1">MYSQLi</option>
|
|
||||||
</select></td></tr>
|
|
||||||
</table>
|
</table>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
+9
-11
@@ -12,9 +12,8 @@
|
|||||||
|
|
||||||
include_once("GameEngine/Account.php");
|
include_once("GameEngine/Account.php");
|
||||||
$max_per_pass = 1000;
|
$max_per_pass = 1000;
|
||||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
|
||||||
mysql_select_db(SQL_DB);
|
if (mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users WHERE access = 9 AND id = ".$session->uid)) != '1') die("Hacking attemp!");
|
||||||
if (mysql_num_rows(mysql_query("SELECT id FROM ".TB_PREFIX."users WHERE access = 9 AND id = ".$session->uid)) != '1') die("Hacking attemp!");
|
|
||||||
|
|
||||||
if (@$_POST['submit'] == "Send")
|
if (@$_POST['submit'] == "Send")
|
||||||
{
|
{
|
||||||
@@ -45,33 +44,33 @@ if (isset($_GET['send']) && isset($_GET['from']))
|
|||||||
$_SESSION['m_message'] = preg_replace("/\*u([0-9]*)(left|right)\*/i", "<img src='img/u2/u$1.gif' style='float:$2;' alt='unit$1' />", $_SESSION['m_message']);
|
$_SESSION['m_message'] = preg_replace("/\*u([0-9]*)(left|right)\*/i", "<img src='img/u2/u$1.gif' style='float:$2;' alt='unit$1' />", $_SESSION['m_message']);
|
||||||
$_SESSION['m_message'] = "[message]".$_SESSION['m_message']."[/message]";
|
$_SESSION['m_message'] = "[message]".$_SESSION['m_message']."[/message]";
|
||||||
|
|
||||||
$users_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as count FROM ".TB_PREFIX."users WHERE id != 0"));
|
$users_count = mysqli_fetch_assoc(mysqli_query($GLOBALS['link'],"SELECT count(*) as count FROM ".TB_PREFIX."users WHERE id != 0"));
|
||||||
$users_count = $users_count['count'];
|
$users_count = $users_count['count'];
|
||||||
if ($_GET['from'] + $max_per_pass <= $users_count) $plus = $max_per_pass; else $plus = $users_count - $_GET['from'];
|
if ($_GET['from'] + $max_per_pass <= $users_count) $plus = $max_per_pass; else $plus = $users_count - $_GET['from'];
|
||||||
$sql = "INSERT INTO ".TB_PREFIX."mdata (`target`, `owner`, `topic`, `message`, `viewed`, `archived`, `send`, `time`) VALUES ";
|
$sql = "INSERT INTO ".TB_PREFIX."mdata (`target`, `owner`, `topic`, `message`, `viewed`, `archived`, `send`, `time`,`deltarget`,`delowner`,`alliance`,`player`,`coor`,`report`) VALUES ";
|
||||||
for($i = $_GET['from']; $i < ($_GET['from'] + $plus) ; $i++) {
|
for($i = $_GET['from']; $i < ($_GET['from'] + $plus) ; $i++) {
|
||||||
if($i > 5){
|
if($i > 5){
|
||||||
if ($_SESSION['m_color'])
|
if ($_SESSION['m_color'])
|
||||||
{
|
{
|
||||||
$sql .= "($i, 5, '<span style=\'color:{$_SESSION['m_color']};\'>{$_SESSION['m_subject']}</span>', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time()."),";
|
$sql .= "($i, 5, '<span style=\'color:{$_SESSION['m_color']};\'>{$_SESSION['m_subject']}</span>', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time().",0,0,0,0,0,0),";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql .= "($i, 5, '{$_SESSION['m_subject']}', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time()."),";
|
$sql .= "($i, 5, '{$_SESSION['m_subject']}', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time().",0,0,0,0,0,0),";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($i > 5){
|
if($i > 5){
|
||||||
if ($_SESSION['m_color'])
|
if ($_SESSION['m_color'])
|
||||||
{
|
{
|
||||||
$sql .= "($i, 5, '<span style=\'color:{$_SESSION['m_color']};\'>{$_SESSION['m_subject']}</span>', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time().")";
|
$sql .= "($i, 5, '<span style=\'color:{$_SESSION['m_color']};\'>{$_SESSION['m_subject']}</span>', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time().",0,0,0,0,0,0)";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql .= "($i, 0, '{$_SESSION['m_subject']}', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time()."),";
|
$sql .= "($i, 0, '{$_SESSION['m_subject']}', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time().",0,0,0,0,0,0),";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mysql_query($sql);
|
mysqli_query($GLOBALS['link'],$sql);
|
||||||
if (($users_count - $_GET['from']) > $max_per_pass) echo header("Location: massmessage.php?send=true&from=",$_GET['from'] + $max_per_pass); else $done = true;
|
if (($users_count - $_GET['from']) > $max_per_pass) echo header("Location: massmessage.php?send=true&from=",$_GET['from'] + $max_per_pass); else $done = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,4 +257,3 @@ if (isset($_GET['send']) && isset($_GET['from']))
|
|||||||
<div id="ce"></div>
|
<div id="ce"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
<?php mysql_close(); ?>
|
|
||||||
+1
-1
@@ -15,7 +15,7 @@ include("GameEngine/Village.php");
|
|||||||
$start = $generator->pageLoadTimeStart();
|
$start = $generator->pageLoadTimeStart();
|
||||||
$message->procMessage($_POST);
|
$message->procMessage($_POST);
|
||||||
if($_GET['t'] == 1){
|
if($_GET['t'] == 1){
|
||||||
$automation->isWinner();
|
$automation->isWinner();
|
||||||
}
|
}
|
||||||
if(isset($_GET['newdid'])) {
|
if(isset($_GET['newdid'])) {
|
||||||
$_SESSION['wid'] = $_GET['newdid'];
|
$_SESSION['wid'] = $_GET['newdid'];
|
||||||
|
|||||||
+31
-33
@@ -79,53 +79,51 @@ if(isset($_GET['newdid'])) {
|
|||||||
<?php
|
<?php
|
||||||
if(isset($_GET['id'])) {
|
if(isset($_GET['id'])) {
|
||||||
switch($_GET['id']) {
|
switch($_GET['id']) {
|
||||||
case 31:
|
case 31:
|
||||||
include("Templates/Ranking/player_attack.tpl");
|
include("Templates/Ranking/player_attack.tpl");
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
include("Templates/Ranking/player_defend.tpl");
|
include("Templates/Ranking/player_defend.tpl");
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
include("Templates/Ranking/player_top10.tpl");
|
include("Templates/Ranking/player_top10.tpl");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
include("Templates/Ranking/villages.tpl");
|
include("Templates/Ranking/villages.tpl");
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
include("Templates/Ranking/alliance.tpl");
|
include("Templates/Ranking/alliance.tpl");
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
include("Templates/Ranking/heroes.tpl");
|
include("Templates/Ranking/heroes.tpl");
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
include("Templates/Ranking/player_1.tpl");
|
include("Templates/Ranking/player_1.tpl");
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
include("Templates/Ranking/player_2.tpl");
|
include("Templates/Ranking/player_2.tpl");
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
include("Templates/Ranking/player_3.tpl");
|
include("Templates/Ranking/player_3.tpl");
|
||||||
break;
|
break;
|
||||||
case 41:
|
case 41:
|
||||||
include("Templates/Ranking/alliance_attack.tpl");
|
include("Templates/Ranking/alliance_attack.tpl");
|
||||||
break;
|
break;
|
||||||
case 42:
|
case 42:
|
||||||
include("Templates/Ranking/alliance_defend.tpl");
|
include("Templates/Ranking/alliance_defend.tpl");
|
||||||
break;
|
break;
|
||||||
case 43:
|
case 43:
|
||||||
include("Templates/Ranking/ally_top10.tpl");
|
include("Templates/Ranking/ally_top10.tpl");
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
include("Templates/Ranking/general.tpl");
|
include("Templates/Ranking/general.tpl");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
default:
|
include("Templates/Ranking/overview.tpl");
|
||||||
include("Templates/Ranking/overview.tpl");
|
break;
|
||||||
break;
|
|
||||||
case 99:
|
case 99:
|
||||||
default:
|
include("Templates/Ranking/ww.tpl");
|
||||||
include("Templates/Ranking/ww.tpl");
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
+9
-12
@@ -11,16 +11,14 @@
|
|||||||
|
|
||||||
include_once("GameEngine/Account.php");
|
include_once("GameEngine/Account.php");
|
||||||
$max_per_pass = 1000;
|
$max_per_pass = 1000;
|
||||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
if (mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users WHERE access = 9 AND id = ".$session->uid)) != '1') die("Hacking attempt!");
|
||||||
mysql_select_db(SQL_DB);
|
|
||||||
if (mysql_num_rows(mysql_query("SELECT id FROM ".TB_PREFIX."users WHERE access = 9 AND id = ".$session->uid)) != '1') die("Hacking attempt!");
|
|
||||||
|
|
||||||
if(isset($_GET['del'])){
|
if(isset($_GET['del'])){
|
||||||
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
|
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
|
||||||
$result=mysql_query($query) or die (mysql_error());
|
$result=mysqli_query($GLOBALS['link'],$query) or die (mysqli_error());
|
||||||
for ($i=0; $row=mysql_fetch_row($result); $i++) {
|
for ($i=0; $row=mysqli_fetch_row($result); $i++) {
|
||||||
$updateattquery = mysql_query("UPDATE ".TB_PREFIX."users SET ok = '0' WHERE id = '".$row[0]."'")
|
$updateattquery = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET ok = '0' WHERE id = '".$row[0]."'")
|
||||||
or die(mysql_error());
|
or die(mysqli_error());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,10 +45,10 @@ if (@isset($_POST['confirm']))
|
|||||||
fwrite($fh, $text);
|
fwrite($fh, $text);
|
||||||
|
|
||||||
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
|
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
|
||||||
$result=mysql_query($query) or die (mysql_error());
|
$result=mysqli_query($GLOBALS['link'],$query) or die (mysqli_error());
|
||||||
for ($i=0; $row=mysql_fetch_row($result); $i++) {
|
for ($i=0; $row=mysqli_fetch_row($result); $i++) {
|
||||||
$updateattquery = mysql_query("UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'")
|
$updateattquery = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'")
|
||||||
or die(mysql_error());
|
or die(mysqli_error());
|
||||||
}
|
}
|
||||||
$done = true;
|
$done = true;
|
||||||
} else { die("<br/><br/><br/>wrong"); }
|
} else { die("<br/><br/><br/>wrong"); }
|
||||||
@@ -185,4 +183,3 @@ System Message was sent
|
|||||||
<div id="ce"></div>
|
<div id="ce"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
<?php mysql_close(); ?>
|
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ function fd(url,gd,hd,id){
|
|||||||
switch(kd){
|
switch(kd){
|
||||||
case'application/json':
|
case'application/json':
|
||||||
if (jd.responseText.indexOf('[]') < 0) {
|
if (jd.responseText.indexOf('[]') < 0) {
|
||||||
gd((jd.responseText==''?null:eval('('+jd.responseText+')')));
|
gd(jd.responseText==''?null:eval('('+jd.responseText+')'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case'text/plain':case'text/html':gd(jd.responseText);break;
|
case'text/plain':case'text/html':gd(jd.responseText);break;
|
||||||
|
|||||||
+15
-15
@@ -49,8 +49,8 @@ $q = "
|
|||||||
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
||||||
ORDER BY totalpop DESC, totalvillages DESC, username ASC";
|
ORDER BY totalpop DESC, totalvillages DESC, username ASC";
|
||||||
|
|
||||||
$result = (mysql_query($q));
|
$result = (mysqli_query($GLOBALS['link'],$q));
|
||||||
while($row = mysql_fetch_assoc($result))
|
while($row = mysqli_fetch_assoc($result))
|
||||||
{
|
{
|
||||||
$datas[] = $row;
|
$datas[] = $row;
|
||||||
}
|
}
|
||||||
@@ -78,8 +78,8 @@ $q = "
|
|||||||
WHERE " . TB_PREFIX . "users.apall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3
|
WHERE " . TB_PREFIX . "users.apall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3
|
||||||
ORDER BY " . TB_PREFIX . "users.apall DESC, pop DESC, username ASC";
|
ORDER BY " . TB_PREFIX . "users.apall DESC, pop DESC, username ASC";
|
||||||
|
|
||||||
$result = mysql_query($q) or die(mysql_error());
|
$result = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error());
|
||||||
while($row = mysql_fetch_assoc($result))
|
while($row = mysqli_fetch_assoc($result))
|
||||||
{
|
{
|
||||||
$attacker[] = $row;
|
$attacker[] = $row;
|
||||||
}
|
}
|
||||||
@@ -105,8 +105,8 @@ $q = "
|
|||||||
FROM " . TB_PREFIX . "users
|
FROM " . TB_PREFIX . "users
|
||||||
WHERE " . TB_PREFIX . "users.dpall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
WHERE " . TB_PREFIX . "users.dpall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
||||||
ORDER BY " . TB_PREFIX . "users.dpall DESC, pop DESC, username ASC";
|
ORDER BY " . TB_PREFIX . "users.dpall DESC, pop DESC, username ASC";
|
||||||
$result = mysql_query($q) or die(mysql_error());
|
$result = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error());
|
||||||
while($row = mysql_fetch_assoc($result))
|
while($row = mysqli_fetch_assoc($result))
|
||||||
{
|
{
|
||||||
$defender[] = $row;
|
$defender[] = $row;
|
||||||
}
|
}
|
||||||
@@ -120,29 +120,29 @@ $q = "
|
|||||||
}
|
}
|
||||||
|
|
||||||
## Get WW Winner Details
|
## Get WW Winner Details
|
||||||
$sql = mysql_query("SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
|
$sql = mysqli_query($GLOBALS['link'],"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
|
||||||
$vref = mysql_result($sql, 0);
|
$vref = mysql_result($sql, 0);
|
||||||
|
|
||||||
$sql = mysql_query("SELECT name FROM ".TB_PREFIX."vdata WHERE wref = '$vref'")or die(mysql_error());
|
$sql = mysqli_query($GLOBALS['link'],"SELECT name FROM ".TB_PREFIX."vdata WHERE wref = '$vref'")or die(mysqli_error());
|
||||||
$winningvillagename = mysql_result($sql, 0);
|
$winningvillagename = mysql_result($sql, 0);
|
||||||
|
|
||||||
$sql = mysql_query("SELECT owner FROM ".TB_PREFIX."vdata WHERE wref = '$vref'")or die(mysql_error());
|
$sql = mysqli_query($GLOBALS['link'],"SELECT owner FROM ".TB_PREFIX."vdata WHERE wref = '$vref'")or die(mysqli_error());
|
||||||
$owner = mysql_result($sql, 0);
|
$owner = mysql_result($sql, 0);
|
||||||
|
|
||||||
$sql = mysql_query("SELECT username FROM ".TB_PREFIX."users WHERE id = '$owner'")or die(mysql_error());
|
$sql = mysqli_query($GLOBALS['link'],"SELECT username FROM ".TB_PREFIX."users WHERE id = '$owner'")or die(mysqli_error());
|
||||||
$username = mysql_result($sql, 0);
|
$username = mysql_result($sql, 0);
|
||||||
|
|
||||||
$sql = mysql_query("SELECT alliance FROM ".TB_PREFIX."users WHERE id = '$owner'")or die(mysql_error());
|
$sql = mysqli_query($GLOBALS['link'],"SELECT alliance FROM ".TB_PREFIX."users WHERE id = '$owner'")or die(mysqli_error());
|
||||||
$allianceid = mysql_result($sql, 0);
|
$allianceid = mysql_result($sql, 0);
|
||||||
|
|
||||||
$sql = mysql_query("SELECT name, tag FROM ".TB_PREFIX."alidata WHERE id = '$allianceid'")or die(mysql_error());
|
$sql = mysqli_query($GLOBALS['link'],"SELECT name, tag FROM ".TB_PREFIX."alidata WHERE id = '$allianceid'")or die(mysqli_error());
|
||||||
$winningalliance = mysql_result($sql, 0);
|
$winningalliance = mysql_result($sql, 0);
|
||||||
|
|
||||||
$sql = mysql_query("SELECT tag FROM ".TB_PREFIX."alidata WHERE id = '$allianceid'")or die(mysql_error());
|
$sql = mysqli_query($GLOBALS['link'],"SELECT tag FROM ".TB_PREFIX."alidata WHERE id = '$allianceid'")or die(mysqli_error());
|
||||||
$winningalliancetag = mysql_result($sql, 0);
|
$winningalliancetag = mysql_result($sql, 0);
|
||||||
|
|
||||||
$sql = mysql_query("SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
|
$sql = mysqli_query($GLOBALS['link'],"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
|
||||||
$winner = mysql_num_rows($sql);
|
$winner = mysqli_num_rows($sql);
|
||||||
|
|
||||||
if($winner!=0){
|
if($winner!=0){
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user