mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +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();
|
||||
include_once("../GameEngine/config.php");
|
||||
include_once("../GameEngine/Database.php");
|
||||
include_once ("../GameEngine/Lang/" . LANG . ".php");
|
||||
include_once("../GameEngine/Admin/database.php");
|
||||
|
||||
@@ -20,7 +20,7 @@ include("Session.php");
|
||||
|
||||
class Account {
|
||||
|
||||
function Account() {
|
||||
function __construct() {
|
||||
global $session;
|
||||
if(isset($_POST['ft'])) {
|
||||
switch($_POST['ft']) {
|
||||
@@ -140,8 +140,8 @@ class Account {
|
||||
{
|
||||
global $database;
|
||||
$q = "SELECT * FROM ".TB_PREFIX."activate where act = '".$_POST['id']."'";
|
||||
$result = mysql_query($q, $database->connection);
|
||||
$dbarray = mysql_fetch_array($result);
|
||||
$result = mysqli_query($GLOBALS['link'],$q);
|
||||
$dbarray = mysqli_fetch_array($result);
|
||||
if($dbarray['act'] == $_POST['id']) {
|
||||
$uid = $database->register($dbarray['username'],$dbarray['password'],$dbarray['email'],$dbarray['tribe'],"");
|
||||
if($uid) {
|
||||
@@ -165,8 +165,8 @@ class Account {
|
||||
private function Unreg() {
|
||||
global $database;
|
||||
$q = "SELECT * FROM ".TB_PREFIX."activate where id = '".$_POST['id']."'";
|
||||
$result = mysql_query($q, $database->connection);
|
||||
$dbarray = mysql_fetch_array($result);
|
||||
$result = mysqli_query($GLOBALS['link'],$q);
|
||||
$dbarray = mysqli_fetch_array($result);
|
||||
if(md5($_POST['pw']) == $dbarray['password']) {
|
||||
$database->unreg($dbarray['username']);
|
||||
header("Location: anmelden.php");
|
||||
@@ -178,9 +178,10 @@ class Account {
|
||||
|
||||
private function Login() {
|
||||
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'] == "") {
|
||||
$form->addError("user",LOGIN_USR_EMPTY);
|
||||
$form->addError("user",$user);
|
||||
}
|
||||
else if(!$database->checkExist($_POST['user'],0)) {
|
||||
$form->addError("user",USR_NT_FOUND);
|
||||
@@ -224,7 +225,7 @@ class Account {
|
||||
global $session,$database;
|
||||
unset($_SESSION['wid']);
|
||||
$database->activeModify(addslashes($session->username),1);
|
||||
$database->UpdateOnline("logout") or die(mysql_error());
|
||||
$database->UpdateOnline("logout") or die(mysqli_error());
|
||||
$session->Logout();
|
||||
}
|
||||
|
||||
|
||||
@@ -24,25 +24,26 @@ include_once("../GameEngine/Data/unitdata.php");
|
||||
include_once("../GameEngine/Technology.php");
|
||||
include_once("../GameEngine/Data/buidata.php");
|
||||
}
|
||||
include_once("../../GameEngine/Database.php");
|
||||
class adm_DB {
|
||||
var $connection;
|
||||
|
||||
function adm_DB(){
|
||||
global $database;
|
||||
$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());
|
||||
|
||||
var $connection;
|
||||
function adm_DB(){
|
||||
global $database;
|
||||
$database = new MYSQLi_DB;
|
||||
$this->connection = $database->return_link();
|
||||
}
|
||||
|
||||
function Login($username,$password){
|
||||
$q = "SELECT password FROM ".TB_PREFIX."users where username = '$username' and access >= ".MULTIHUNTER;
|
||||
$result = mysql_query($q, $this->connection);
|
||||
$dbarray = mysql_fetch_array($result);
|
||||
$result = mysqli_query($this->connection,$q);
|
||||
$dbarray = mysqli_fetch_array($result);
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -70,7 +71,7 @@ class adm_DB {
|
||||
}
|
||||
|
||||
$q = "UPDATE ".TB_PREFIX."vdata set pop = $popTot where wref = $vid";
|
||||
mysql_query($q, $this->connection);
|
||||
mysqli_query($q, $this->connection);
|
||||
}
|
||||
|
||||
function recountCP($vid){
|
||||
@@ -85,7 +86,7 @@ class adm_DB {
|
||||
}
|
||||
}
|
||||
$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){
|
||||
@@ -114,8 +115,8 @@ class adm_DB {
|
||||
|
||||
function getWref($x,$y) {
|
||||
$q = "SELECT id FROM ".TB_PREFIX."wdata where x = $x and y = $y";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
$r = mysql_fetch_array($result);
|
||||
$result = mysqli_query($this->connection,$q);
|
||||
$r = mysqli_fetch_array($result);
|
||||
return $r['id'];
|
||||
}
|
||||
|
||||
@@ -126,7 +127,7 @@ class adm_DB {
|
||||
$status = $database->getVillageState($wid);
|
||||
$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->addVillage($wid,$uid,'new village','0');
|
||||
$database->addResourceFields($wid,$database->getVillageType($wid));
|
||||
@@ -164,23 +165,23 @@ class adm_DB {
|
||||
if($post['clean_ware']){
|
||||
$time = time();
|
||||
$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){
|
||||
global $database;
|
||||
$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);
|
||||
for ($i = 1; $i <= 40; $i++) {
|
||||
if($fdata['f'.$i]>1){
|
||||
$zm = ($fdata['f'.$i]/100)*$proc;
|
||||
if($zm < 1){$zm = 1;}else{$zm = floor($zm);}
|
||||
$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){
|
||||
$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){
|
||||
@@ -205,26 +206,26 @@ class adm_DB {
|
||||
$this->DelVillage($villages[$i]['wref'], 1);
|
||||
}
|
||||
$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);
|
||||
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;";
|
||||
mysql_query($q, $this->connection);
|
||||
mysqli_query($this->connection,$q);
|
||||
}
|
||||
}
|
||||
|
||||
function getUserActive() {
|
||||
$time = time() - (60*5);
|
||||
$q = "SELECT * FROM ".TB_PREFIX."users where timestamp > $time and username != 'support'";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
return $this->mysqli_fetch_all($result);
|
||||
}
|
||||
|
||||
function CheckPass($password,$uid){
|
||||
$q = "SELECT password FROM ".TB_PREFIX."users where id = '$uid' and access = ".ADMIN;
|
||||
$result = mysql_query($q, $this->connection);
|
||||
$dbarray = mysql_fetch_array($result);
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
$dbarray = mysqli_fetch_array($result);
|
||||
if($dbarray['password'] == md5($password)) {
|
||||
return true;
|
||||
}else{
|
||||
@@ -239,37 +240,37 @@ class adm_DB {
|
||||
}else{
|
||||
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
|
||||
}
|
||||
$result = mysql_query($q, $this->connection);
|
||||
if(mysql_num_rows($result) > 0){
|
||||
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Deleted village <b>$wref</b>',".time().")");
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
if(mysqli_num_rows($result) > 0){
|
||||
mysqli_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Deleted village <b>$wref</b>',".time().")");
|
||||
|
||||
$database->clearExpansionSlot($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";
|
||||
mysql_query($q, $this->connection);
|
||||
mysqli_query($q, $this->connection);
|
||||
$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";
|
||||
mysql_query($q, $this->connection);
|
||||
mysqli_query($q, $this->connection);
|
||||
$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";
|
||||
mysql_query($q, $this->connection);
|
||||
mysqli_query($q, $this->connection);
|
||||
$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";
|
||||
mysql_query($q, $this->connection);
|
||||
mysqli_query($q, $this->connection);
|
||||
$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";
|
||||
mysql_query($q, $this->connection);
|
||||
mysqli_query($q, $this->connection);
|
||||
$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";
|
||||
mysql_query($q, $this->connection);
|
||||
mysqli_query($q, $this->connection);
|
||||
|
||||
$getmovement = $database->getMovement(3,$wref,1);
|
||||
foreach($getmovement as $movedata) {
|
||||
@@ -284,11 +285,11 @@ class adm_DB {
|
||||
$this->returnTroops($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";
|
||||
mysql_query($q, $this->connection);
|
||||
mysqli_query($q, $this->connection);
|
||||
|
||||
$getprisoners = $database->getPrisoners($wref);
|
||||
foreach($getprisoners as $pris) {
|
||||
@@ -315,83 +316,83 @@ class adm_DB {
|
||||
function DelBan($uid,$id){
|
||||
global $database;
|
||||
$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;";
|
||||
mysql_query($q, $this->connection);
|
||||
mysqli_query($q, $this->connection);
|
||||
$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){
|
||||
global $database;
|
||||
$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;";
|
||||
mysql_query($q, $this->connection);
|
||||
mysqli_query($q, $this->connection);
|
||||
$time = time();
|
||||
$admin = $_SESSION['id']; //$database->getUserField($_SESSION['username'],'id',1);
|
||||
$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');";
|
||||
mysql_query($q, $this->connection);
|
||||
mysqli_query($q, $this->connection);
|
||||
}
|
||||
|
||||
function search_player($player){
|
||||
$q = "SELECT id,username FROM ".TB_PREFIX."users WHERE `username` LIKE '%$player%' and username != 'support'";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
return $this->mysqli_fetch_all($result);
|
||||
}
|
||||
|
||||
function search_email($email){
|
||||
$q = "SELECT id,email FROM ".TB_PREFIX."users WHERE `email` LIKE '%$email%' and username != 'support'";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
return $this->mysqli_fetch_all($result);
|
||||
}
|
||||
|
||||
function search_village($village){
|
||||
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `name` LIKE '%$village%' or `wref` LIKE '%$village%'";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
return $this->mysqli_fetch_all($result);
|
||||
}
|
||||
|
||||
function search_alliance($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);
|
||||
return $this->mysql_fetch_all($result);
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
return $this->mysqli_fetch_all($result);
|
||||
}
|
||||
|
||||
function search_ip($ip){
|
||||
$q = "SELECT * FROM ".TB_PREFIX."login_log WHERE `ip` LIKE '%$ip%'";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
return $this->mysqli_fetch_all($result);
|
||||
}
|
||||
|
||||
function search_banned(){
|
||||
$q = "SELECT * FROM ".TB_PREFIX."banlist where active = '1'";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
return $this->mysqli_fetch_all($result);
|
||||
}
|
||||
|
||||
function Del_banned(){
|
||||
//$q = "SELECT * FROM ".TB_PREFIX."banlist";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
return $this->mysqli_fetch_all($result);
|
||||
}
|
||||
|
||||
/***************************
|
||||
Function to process MYSQLi->fetch_all (Only exist in MYSQL)
|
||||
References: Result
|
||||
***************************/
|
||||
function mysql_fetch_all($result) {
|
||||
function mysqli_fetch_all($result) {
|
||||
$all = array();
|
||||
if($result) {
|
||||
while ($row = mysql_fetch_assoc($result)){ $all[] = $row; }
|
||||
while ($row = mysqli_fetch_assoc($result)){ $all[] = $row; }
|
||||
return $all;
|
||||
}
|
||||
}
|
||||
|
||||
function query_return($q) {
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
return $this->mysqli_fetch_all($result);
|
||||
}
|
||||
|
||||
/***************************
|
||||
@@ -399,7 +400,7 @@ class adm_DB {
|
||||
References: Query
|
||||
***************************/
|
||||
function query($query) {
|
||||
return mysql_query($query, $this->connection);
|
||||
return mysqli_query($query, $this->connection);
|
||||
}
|
||||
|
||||
public function getTypeLevel($tid,$vid) {
|
||||
@@ -519,8 +520,8 @@ class adm_DB {
|
||||
|
||||
if( intval($enforce['hero']) > 0){
|
||||
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$from['owner']."";
|
||||
$result = mysql_query($q);
|
||||
$hero_f=mysql_fetch_array($result);
|
||||
$result = mysqli_query($q);
|
||||
$hero_f=mysqli_fetch_array($result);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
} else {
|
||||
|
||||
@@ -454,8 +454,8 @@
|
||||
|
||||
private function updateMax($leader) {
|
||||
global $bid18, $database;
|
||||
$q = mysql_query("SELECT * FROM " . TB_PREFIX . "alidata where leader = $leader");
|
||||
if(mysql_num_rows($q) > 0){
|
||||
$q = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "alidata where leader = $leader");
|
||||
if(mysqli_num_rows($q) > 0){
|
||||
$villages = $database->getVillagesID2($leader);
|
||||
$max = 0;
|
||||
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){
|
||||
|
||||
$_result=mysql_query("select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$atkhero['heroid']."'");
|
||||
$fdb = mysql_fetch_array($_result);
|
||||
$_result=mysqli_query($GLOBALS['link'],"select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$atkhero['heroid']."'");
|
||||
$fdb = mysqli_fetch_array($_result);
|
||||
$hero_id=$fdb['heroid'];
|
||||
$hero_health=$fdb['health'];
|
||||
$damage_health=round(100*$result[1]);
|
||||
@@ -668,10 +668,10 @@ class Battle {
|
||||
if ($hero_health<=$damage_health or $damage_health>90){
|
||||
//hero die
|
||||
$result['casualties_attacker']['11'] = 1;
|
||||
mysql_query("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 `dead`='1' where `heroid`='".$hero_id."'");
|
||||
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `health`='0' where `heroid`='".$hero_id."'");
|
||||
}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);
|
||||
@@ -679,19 +679,19 @@ class Battle {
|
||||
|
||||
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']."'");
|
||||
$fdb = mysql_fetch_array($_result);
|
||||
$_result=mysqli_query($GLOBALS['link'],"select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$defenderhero['heroid']."'");
|
||||
$fdb = mysqli_fetch_array($_result);
|
||||
$hero_id=$fdb['heroid'];
|
||||
$hero_health=$fdb['health'];
|
||||
$damage_health=round(100*$result[2]);
|
||||
if ($hero_health<=$damage_health or $damage_health>90){
|
||||
//hero die
|
||||
$result['deadherodef'] = 1;
|
||||
mysql_query("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 `dead`='1' where `heroid`='".$hero_id."'");
|
||||
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `health`='0' where `heroid`='".$hero_id."'");
|
||||
}else{
|
||||
$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);
|
||||
@@ -703,19 +703,19 @@ class Battle {
|
||||
if(!empty($heroarray)) { reset($heroarray); }
|
||||
$Reinforcer = $database->getVillageField($defenders['from'],"owner");
|
||||
$heroarraydefender = $this->getBattleHero($Reinforcer);
|
||||
$_result=mysql_query("select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$heroarraydefender['heroid']."'");
|
||||
$fdb = mysql_fetch_array($_result);
|
||||
$_result=mysqli_query($GLOBALS['link'],"select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$heroarraydefender['heroid']."'");
|
||||
$fdb = mysqli_fetch_array($_result);
|
||||
$hero_id=$fdb['heroid'];
|
||||
$hero_health=$fdb['health'];
|
||||
$damage_health=round(100*$result[2]);
|
||||
if ($hero_health<=$damage_health or $damage_health>90){
|
||||
//hero die
|
||||
$result['deadheroref'][$defenders['id']] = 1;
|
||||
mysql_query("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 `dead`='1' where `heroid`='".$hero_id."'");
|
||||
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `health`='0' where `heroid`='".$hero_id."'");
|
||||
}else{
|
||||
$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;
|
||||
$now = time();
|
||||
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;
|
||||
|
||||
$alliance = $session->alliance;
|
||||
$query = mysql_query("select * from ".TB_PREFIX."chat where alli='$alliance' order by id desc limit 0,13");
|
||||
while ($r = mysql_fetch_array($query)) {
|
||||
$query = mysqli_query($GLOBALS['link'],"select * from ".TB_PREFIX."chat where alli='$alliance' order by id desc limit 0,13");
|
||||
while ($r = mysqli_fetch_array($query)) {
|
||||
$dates = date("g:i",$r[date]);
|
||||
$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;
|
||||
for($i = 1; $i <= 10; $i++) {
|
||||
if(isset($post['n' . $i])) {
|
||||
$message1 = mysql_query("SELECT * FROM " . TB_PREFIX . "mdata where id = ".$post['n' . $i]."");
|
||||
$message = mysql_fetch_array($message1);
|
||||
$message1 = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "mdata where id = ".$post['n' . $i]."");
|
||||
$message = mysqli_fetch_array($message1);
|
||||
if($message['target'] == $session->uid && $message['owner'] == $session->uid){
|
||||
$database->getMessage($post['n' . $i], 8);
|
||||
}else if($message['target'] == $session->uid){
|
||||
@@ -321,16 +321,16 @@ class Message {
|
||||
// Vulnerability closed by Shadow
|
||||
|
||||
$q = "SELECT * FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".time()." - 60";
|
||||
$res = mysql_query($q) or die(mysql_error(). " query ".$q);
|
||||
$flood = mysql_num_rows($res);
|
||||
$res = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error(). " query ".$q);
|
||||
$flood = mysqli_num_rows($res);
|
||||
if($flood > 5)
|
||||
return; //flood
|
||||
|
||||
// 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);
|
||||
$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) {
|
||||
$topic = $this->wordCensor($topic);
|
||||
$text = $this->wordCensor($text);
|
||||
@@ -395,7 +395,7 @@ class Message {
|
||||
}
|
||||
if($permission[opt7]==1){
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -410,8 +410,8 @@ class Message {
|
||||
// Vulnerability closed by Shadow
|
||||
|
||||
$q = "SELECT * FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".time()." - 60";
|
||||
$res = mysql_query($q) or die(mysql_error(). " query ".$q);
|
||||
$flood = mysql_num_rows($res);
|
||||
$res = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error(). " query ".$q);
|
||||
$flood = mysqli_num_rows($res);
|
||||
if($flood > 5)
|
||||
return; //flood
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ class Profile {
|
||||
if($set){
|
||||
unset($_SESSION['wid']);
|
||||
$database->activeModify(addslashes($session->username),1);
|
||||
$database->UpdateOnline("logout") or die(mysql_error());
|
||||
$database->UpdateOnline("logout") or die(mysqli_error());
|
||||
$session->Logout();
|
||||
header("Location: login.php");
|
||||
}else{
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
//heef npc uitzondering omdat die met speciaal $_post werken
|
||||
if(isset($_POST)){
|
||||
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);
|
||||
}
|
||||
}
|
||||
$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['rsargs']=$rsargs;
|
||||
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
|
||||
//$_COOKIE = array_map('mysqli_real_escape_string', $_COOKIE);
|
||||
$_COOKIE = array_map('htmlspecialchars', $_COOKIE);
|
||||
?>
|
||||
+90
-91
@@ -19,25 +19,24 @@
|
||||
}
|
||||
|
||||
public function getUserRank($id) {
|
||||
$ranking = $this->getRank();
|
||||
$users = "SELECT * FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8") . "";
|
||||
$users2 = mysql_num_rows(mysql_query($users));
|
||||
$users3 = $users2+1;
|
||||
if(count($ranking) > 0) {
|
||||
for($i=0;$i<($users3);$i++) {
|
||||
if( isset( $ranking[$i]['userid'] ) )
|
||||
{
|
||||
if($ranking[$i]['userid'] == $id && $ranking[$i] != "pad") {
|
||||
$myrank = $i;
|
||||
$ranking = $this->getRank();
|
||||
$users = "SELECT * FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8") . "";
|
||||
$users2 = mysqli_num_rows(mysqli_query($GLOBALS['link'],$users));
|
||||
$users3 = $users2+1;
|
||||
if(count($ranking) > 0) {
|
||||
for($i=0;$i<($users3);$i++) {
|
||||
if( isset( $ranking[$i]['userid'] ) ) {
|
||||
if($ranking[$i]['userid'] == $id && $ranking[$i] != "pad") {
|
||||
$myrank = $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $myrank;
|
||||
}
|
||||
|
||||
public function procRankReq($get) {
|
||||
global $village, $session, $database;
|
||||
global $village, $session;
|
||||
if(isset($get['id'])) {
|
||||
switch($get['id']) {
|
||||
case 1:
|
||||
@@ -219,55 +218,55 @@
|
||||
}
|
||||
|
||||
public function procRankArray() {
|
||||
global $database, $multisort;
|
||||
if($database->countUser() > 0){
|
||||
$holder = array();
|
||||
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, (
|
||||
global $multisort;
|
||||
if($GLOBALS['db']->countUser() > 0){
|
||||
$holder = array();
|
||||
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, (
|
||||
|
||||
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
||||
FROM " . TB_PREFIX . "vdata
|
||||
WHERE " . TB_PREFIX . "vdata.owner = userid
|
||||
)totalpop, (
|
||||
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
||||
FROM " . TB_PREFIX . "vdata
|
||||
WHERE " . TB_PREFIX . "vdata.owner = userid
|
||||
)totalpop, (
|
||||
|
||||
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
|
||||
FROM " . TB_PREFIX . "vdata
|
||||
WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99
|
||||
)totalvillages, (
|
||||
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
|
||||
FROM " . TB_PREFIX . "vdata
|
||||
WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99
|
||||
)totalvillages, (
|
||||
|
||||
SELECT " . TB_PREFIX . "alidata.tag
|
||||
FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users
|
||||
WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance
|
||||
AND " . TB_PREFIX . "users.id = userid
|
||||
)allitag
|
||||
FROM " . TB_PREFIX . "users
|
||||
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
||||
AND " . TB_PREFIX . "users.tribe <= 5 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
||||
}else{
|
||||
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.oldrank oldrank, " . TB_PREFIX . "users.alliance alliance, (
|
||||
SELECT " . TB_PREFIX . "alidata.tag
|
||||
FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users
|
||||
WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance
|
||||
AND " . TB_PREFIX . "users.id = userid
|
||||
)allitag
|
||||
FROM " . TB_PREFIX . "users
|
||||
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
||||
AND " . TB_PREFIX . "users.tribe <= 5 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
||||
} else {
|
||||
$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 )
|
||||
FROM " . TB_PREFIX . "vdata
|
||||
WHERE " . TB_PREFIX . "vdata.owner = userid
|
||||
)totalpop, (
|
||||
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
||||
FROM " . TB_PREFIX . "vdata
|
||||
WHERE " . TB_PREFIX . "vdata.owner = userid
|
||||
)totalpop, (
|
||||
|
||||
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
|
||||
FROM " . TB_PREFIX . "vdata
|
||||
WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99
|
||||
)totalvillages, (
|
||||
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
|
||||
FROM " . TB_PREFIX . "vdata
|
||||
WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99
|
||||
)totalvillages, (
|
||||
|
||||
SELECT " . TB_PREFIX . "alidata.tag
|
||||
FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users
|
||||
WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance
|
||||
AND " . TB_PREFIX . "users.id = userid
|
||||
)allitag
|
||||
FROM " . TB_PREFIX . "users
|
||||
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
||||
AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
||||
}
|
||||
SELECT " . TB_PREFIX . "alidata.tag
|
||||
FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users
|
||||
WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance
|
||||
AND " . TB_PREFIX . "users.id = userid
|
||||
)allitag
|
||||
FROM " . TB_PREFIX . "users
|
||||
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
||||
AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
||||
}
|
||||
|
||||
$result = (mysql_query($q));
|
||||
while($row = mysql_fetch_assoc($result)) {
|
||||
$result = (mysqli_query($GLOBALS['link'],$q));
|
||||
while($row = mysqli_fetch_assoc($result)) {
|
||||
$datas[] = $row;
|
||||
}
|
||||
|
||||
@@ -291,13 +290,13 @@
|
||||
}
|
||||
|
||||
public function procRankRaceArray($race) {
|
||||
global $database, $multisort;
|
||||
//$array = $database->getRanking();
|
||||
global $multisort;
|
||||
//$array = $GLOBALS['db']->getRanking();
|
||||
$holder = array();
|
||||
//$value['totalvillage'] = count($database->getVillagesID($value['id']));
|
||||
//$value['totalvillage'] = count($database->getVillagesID($value['id']));
|
||||
//$value['totalpop'] = $database->getVSumField($value['id'],"pop");
|
||||
//$value['aname'] = $database->getAllianceName($value['alliance']);
|
||||
//$value['totalvillage'] = count($GLOBALS['db']->getVillagesID($value['id']));
|
||||
//$value['totalvillage'] = count($GLOBALS['db']->getVillagesID($value['id']));
|
||||
//$value['totalpop'] = $GLOBALS['db']->getVSumField($value['id'],"pop");
|
||||
//$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, (
|
||||
|
||||
SELECT SUM( " . TB_PREFIX . "vdata.pop )
|
||||
@@ -320,12 +319,12 @@
|
||||
ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
|
||||
|
||||
|
||||
$result = (mysql_query($q));
|
||||
while($row = mysql_fetch_assoc($result)) {
|
||||
$result = (mysqli_query($GLOBALS['link'],$q));
|
||||
while($row = mysqli_fetch_assoc($result)) {
|
||||
$datas[] = $row;
|
||||
}
|
||||
|
||||
if(mysql_num_rows($result)) {
|
||||
if(mysqli_num_rows($result)) {
|
||||
|
||||
|
||||
foreach($datas as $result) {
|
||||
@@ -356,12 +355,12 @@
|
||||
}
|
||||
|
||||
public function procAttRankArray() {
|
||||
global $database, $multisort;
|
||||
//$array = $database->getRanking();
|
||||
global $multisort;
|
||||
//$array = $GLOBALS['db']->getRanking();
|
||||
$holder = array();
|
||||
|
||||
//$value['totalvillage'] = count($database->getVillagesID($value['id']));
|
||||
//$value['totalpop'] = $database->getVSumField($value['id'],"pop");
|
||||
//$value['totalvillage'] = count($GLOBALS['db']->getVillagesID($value['id']));
|
||||
//$value['totalpop'] = $GLOBALS['db']->getVSumField($value['id'],"pop");
|
||||
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.apall, (
|
||||
|
||||
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
|
||||
@@ -376,8 +375,8 @@
|
||||
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
|
||||
ORDER BY " . TB_PREFIX . "users.apall DESC, pop DESC, userid DESC";
|
||||
$result = mysql_query($q) or die(mysql_error());
|
||||
while($row = mysql_Fetch_assoc($result)) {
|
||||
$result = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error());
|
||||
while($row = mysqli_Fetch_assoc($result)) {
|
||||
$datas[] = $row;
|
||||
}
|
||||
|
||||
@@ -401,8 +400,8 @@
|
||||
}
|
||||
|
||||
public function procDefRankArray() {
|
||||
//global $database, $multisort;
|
||||
//$array = $database->getRanking();
|
||||
//global $GLOBALS['db'], $multisort;
|
||||
//$array = $GLOBALS['db']->getRanking();
|
||||
$holder = array();
|
||||
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.dpall, (
|
||||
|
||||
@@ -418,8 +417,8 @@
|
||||
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
|
||||
ORDER BY " . TB_PREFIX . "users.dpall DESC, pop DESC, userid DESC";
|
||||
$result = mysql_query($q) or die(mysql_error());
|
||||
while($row = mysql_Fetch_assoc($result)) {
|
||||
$result = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error());
|
||||
while($row = mysqli_Fetch_assoc($result)) {
|
||||
$datas[] = $row;
|
||||
}
|
||||
|
||||
@@ -443,14 +442,14 @@
|
||||
}
|
||||
|
||||
public function procVRankArray() {
|
||||
global $database, $multisort;
|
||||
$array = $database->getVRanking();
|
||||
global $multisort;
|
||||
$array = $GLOBALS['db']->getVRanking();
|
||||
$holder = array();
|
||||
foreach($array as $value) {
|
||||
$coor = $database->getCoor($value['wref']);
|
||||
$coor = $GLOBALS['db']->getCoor($value['wref']);
|
||||
$value['x'] = $coor['x'];
|
||||
$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);
|
||||
}
|
||||
@@ -463,15 +462,15 @@
|
||||
}
|
||||
|
||||
public function procARankArray() {
|
||||
global $database, $multisort;
|
||||
$array = $database->getARanking();
|
||||
global $multisort;
|
||||
$array = $GLOBALS['db']->getARanking();
|
||||
$holder = array();
|
||||
|
||||
foreach($array as $value) {
|
||||
$memberlist = $database->getAllMember($value['id']);
|
||||
$memberlist = $GLOBALS['db']->getAllMember($value['id']);
|
||||
$totalpop = 0;
|
||||
foreach($memberlist as $member) {
|
||||
$totalpop += $database->getVSumField($member['id'], "pop");
|
||||
$totalpop += $GLOBALS['db']->getVSumField($member['id'], "pop");
|
||||
}
|
||||
$value['players'] = count($memberlist);
|
||||
$value['totalpop'] = $totalpop;
|
||||
@@ -492,11 +491,11 @@
|
||||
}
|
||||
|
||||
public function procHeroRankArray() {
|
||||
global $database, $multisort;
|
||||
$array = $database->getHeroRanking();
|
||||
global $multisort;
|
||||
$array = $GLOBALS['db']->getHeroRanking();
|
||||
$holder = array();
|
||||
foreach($array as $value) {
|
||||
$value['owner'] = $database->getUserField($value['uid'], "username", 0);
|
||||
$value['owner'] = $GLOBALS['db']->getUserField($value['uid'], "username", 0);
|
||||
$value['level'];
|
||||
$value['name'];
|
||||
$value['uid'];
|
||||
@@ -512,11 +511,11 @@
|
||||
}
|
||||
|
||||
public function procAAttRankArray() {
|
||||
global $database, $multisort;
|
||||
$array = $database->getARanking();
|
||||
global $multisort;
|
||||
$array = $GLOBALS['db']->getARanking();
|
||||
$holder = array();
|
||||
foreach($array as $value) {
|
||||
$memberlist = $database->getAllMember($value['id']);
|
||||
$memberlist = $GLOBALS['db']->getAllMember($value['id']);
|
||||
$totalap = 0;
|
||||
foreach($memberlist as $member) {
|
||||
$totalap += $member['ap'];
|
||||
@@ -540,11 +539,11 @@
|
||||
}
|
||||
|
||||
public function procADefRankArray() {
|
||||
global $database, $multisort;
|
||||
$array = $database->getARanking();
|
||||
global $multisort;
|
||||
$array = $GLOBALS['db']->getARanking();
|
||||
$holder = array();
|
||||
foreach($array as $value) {
|
||||
$memberlist = $database->getAllMember($value['id']);
|
||||
$memberlist = $GLOBALS['db']->getAllMember($value['id']);
|
||||
$totaldp = 0;
|
||||
foreach($memberlist as $member) {
|
||||
$totaldp += $member['dp'];
|
||||
|
||||
+20
-17
@@ -60,7 +60,7 @@ class Session {
|
||||
private $userarray = array();
|
||||
var $villages = array();
|
||||
|
||||
function Session() {
|
||||
function __construct() {
|
||||
global $database; //TienTN fix
|
||||
|
||||
$this->time = time();
|
||||
@@ -88,25 +88,25 @@ class Session {
|
||||
$_SESSION['checker'] = $generator->generateRandStr(3);
|
||||
$_SESSION['mchecker'] = $generator->generateRandStr(5);
|
||||
$_SESSION['qst'] = $database->getUserField($_SESSION['username'], "quest", 1);
|
||||
$result = mysql_query("SELECT village_select FROM `". TB_PREFIX."users` WHERE `username`='".$_SESSION['username']."'");
|
||||
$dbarray = mysql_fetch_assoc($result);
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT village_select FROM `". TB_PREFIX."users` WHERE `username`='".$_SESSION['username']."'");
|
||||
$dbarray = mysqli_fetch_assoc($result);
|
||||
$selected_village=$dbarray['village_select'];
|
||||
if(!isset($_SESSION['wid'])) {
|
||||
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{
|
||||
$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'];
|
||||
} else
|
||||
if($_SESSION['wid'] == '') {
|
||||
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{
|
||||
$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'];
|
||||
}
|
||||
$this->PopulateVar();
|
||||
@@ -157,20 +157,23 @@ class Session {
|
||||
***************************/
|
||||
|
||||
function CheckHeroReal () {
|
||||
global $database;
|
||||
global $database,$link;
|
||||
$hero=0;
|
||||
foreach($this->villages as $myvill){
|
||||
$q1 = "SELECT SUM(hero) from " . TB_PREFIX . "enforcement where `from` = ".$myvill; // check if hero is send as reinforcement
|
||||
$result1 = mysql_query($q1, $database->connection);
|
||||
$he1=mysql_fetch_array($result1);
|
||||
$hero+=$he1[0];
|
||||
$result1 = mysqli_query($GLOBALS['link'],$q1);
|
||||
if(mysqli_num_rows($result1) != 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)
|
||||
$result2 = mysql_query($q2, $database->connection);
|
||||
$he2=mysql_fetch_array($result2);
|
||||
$result2 = mysqli_query($GLOBALS['link'],$q2);
|
||||
$he2=mysqli_fetch_array($result2);
|
||||
$hero+=$he2[0];
|
||||
$q3 = "SELECT SUM(t11) from " . TB_PREFIX . "prisoners where `from` = ".$myvill; // check if hero is prisoner
|
||||
$result3 = mysql_query($q3, $database->connection);
|
||||
$he3=mysql_fetch_array($result3);
|
||||
$result3 = mysqli_query($GLOBALS['link'],$q3);
|
||||
$he3=mysqli_fetch_array($result3);
|
||||
$hero+=$he3[0];
|
||||
$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);
|
||||
for($i=1;$i<=50;$i++) {
|
||||
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
|
||||
$controlloTruppe = $database->getUnit($village->wid);
|
||||
for($i=1;$i<=50;$i++) {
|
||||
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
|
||||
@@ -182,7 +182,7 @@ class Technology {
|
||||
global $village,$$unit;
|
||||
$unitarray = $$unit;
|
||||
$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['clay'] > $res['maxstore']){$res['clay'] = $res['maxstore'];}
|
||||
if ($res['iron'] > $res['maxstore']){$res['iron'] = $res['maxstore'];}
|
||||
@@ -208,7 +208,7 @@ class Technology {
|
||||
global $village,$$unit;
|
||||
$unitarray = $$unit;
|
||||
$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'];
|
||||
$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);
|
||||
@@ -724,7 +724,7 @@ private function trainUnit($unit,$amt,$great=false) {
|
||||
global $database,$village;
|
||||
$q = "UPDATE ".TB_PREFIX."research SET timestamp=".(time()-1)." WHERE vref = ".$village->wid;
|
||||
$result = $database->query($q);
|
||||
return mysql_affected_rows();
|
||||
return mysqli_affected_rows();
|
||||
}
|
||||
|
||||
public function calculateAvaliable($id,$resarray=array()) {
|
||||
|
||||
+15
-19
@@ -287,8 +287,8 @@ class Units {
|
||||
}
|
||||
if( intval($enforce['hero']) > 0){
|
||||
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$from['owner']."";
|
||||
$result = mysql_query($q);
|
||||
$hero_f=mysql_fetch_array($result);
|
||||
$result = mysqli_query($GLOBALS['link'],$q);
|
||||
$hero_f=mysqli_fetch_array($result);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
}else{
|
||||
@@ -354,13 +354,11 @@ class Units {
|
||||
if ($data['u11'] > $village->unitarray['hero'])
|
||||
{
|
||||
$form->addError("error","You can't send more units than you have");
|
||||
break;
|
||||
}
|
||||
|
||||
if($data['u11']<0)
|
||||
{
|
||||
$form->addError("error","You can't send negative units.");
|
||||
break;
|
||||
}
|
||||
if($form->returnErrors() > 0) {
|
||||
$_SESSION['errorarray'] = $form->getErrors();
|
||||
@@ -380,14 +378,14 @@ if($session->access != BANNED){
|
||||
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']));
|
||||
$data1 = mysql_fetch_assoc($query1);
|
||||
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
|
||||
$data2 = mysql_fetch_assoc($query2);
|
||||
$query11 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysql_escape_string($village->wid));
|
||||
$data11 = mysql_fetch_assoc($query11);
|
||||
$query21 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data11['owner']);
|
||||
$data21 = mysql_fetch_assoc($query21);
|
||||
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysqli_escape_string($GLOBALS['link'],$data['to_vid']));
|
||||
$data1 = mysqli_fetch_assoc($query1);
|
||||
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
|
||||
$data2 = mysqli_fetch_assoc($query2);
|
||||
$query11 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysqli_escape_string($GLOBALS['link'],$village->wid));
|
||||
$data11 = mysqli_fetch_assoc($query11);
|
||||
$query21 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data11['owner']);
|
||||
$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.
|
||||
// Like it says : Exceptions are the WW which can always be targeted and the treasure chamber which can always be targeted, except with the unique artifact.
|
||||
// Fixed by Advocaite and Shadow
|
||||
$q = mysql_query("SELECT vref FROM ".TB_PREFIX."fdata WHERE f99t = '40' AND vref = ".$data['to_vid']."");
|
||||
$isThere = mysql_num_rows($q);
|
||||
$q = mysqli_query($GLOBALS['link'],"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99t = '40' AND vref = ".$data['to_vid']."");
|
||||
$isThere = mysqli_num_rows($q);
|
||||
if($isThere > 0)
|
||||
{
|
||||
$iswwvilla = 1;
|
||||
@@ -517,7 +515,7 @@ if($session->access != BANNED){
|
||||
if($checkexist or $checkoexist){
|
||||
$database->addMovement(3,$village->wid,$data['to_vid'],$reference,time(),($time+time()));
|
||||
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'])
|
||||
{
|
||||
$form->addError("error","You can't send more units than you have");
|
||||
break;
|
||||
}
|
||||
|
||||
if($post['t11']<0)
|
||||
{
|
||||
$form->addError("error","You can't send negative units.");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$post['t11']='0';
|
||||
@@ -619,8 +615,8 @@ if($session->access != BANNED){
|
||||
if (isset($post['t11'])){
|
||||
if( $post['t11'] != '' && $post['t11'] > 0){
|
||||
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$from['owner']."";
|
||||
$resulth = mysql_query($qh);
|
||||
$hero_f=mysql_fetch_array($resulth);
|
||||
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||
$hero_f=mysqli_fetch_array($resulth);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
} else {
|
||||
|
||||
@@ -30,8 +30,7 @@ class Village {
|
||||
function Village() {
|
||||
global $session, $database;
|
||||
if(isset($_SESSION['wid'])) {
|
||||
$this->wid = $_SESSION['wid'];
|
||||
|
||||
$this->wid = $_SESSION['wid'];
|
||||
}
|
||||
else {
|
||||
$this->wid = $session->villages[0];
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
session_start();
|
||||
include('GameEngine/config.php');
|
||||
include_once ("GameEngine/Lang/" . LANG . ".php");
|
||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
|
||||
mysql_select_db(SQL_DB) or die(mysql_error());
|
||||
include("GameEngine/Generator.php");
|
||||
include("GameEngine/Database/db_MYSQL.php");
|
||||
include("GameEngine/Database.php");
|
||||
|
||||
//include("GameEngine/Session.php");
|
||||
|
||||
@@ -88,14 +86,14 @@ $query2 = "SELECT
|
||||
where ".TB_PREFIX."wdata.id IN ($maparray)
|
||||
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
||||
|
||||
$result2 = mysql_query($query2) or die(mysql_error());
|
||||
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error());
|
||||
|
||||
$i=0;
|
||||
//Load coor array
|
||||
$yrow = 0;
|
||||
|
||||
$map_js ='';
|
||||
while ($donnees = mysql_fetch_assoc($result2)){
|
||||
while ($donnees = mysqli_fetch_assoc($result2)){
|
||||
|
||||
$targetalliance=$donnees["aliance_id"];
|
||||
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
session_start();
|
||||
include('GameEngine/config.php');
|
||||
include_once ("GameEngine/Lang/" . LANG . ".php");
|
||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
|
||||
mysql_select_db(SQL_DB) or die(mysql_error());
|
||||
include("GameEngine/Generator.php");
|
||||
include("GameEngine/Database/db_MYSQL.php");
|
||||
include("GameEngine/Database.php");
|
||||
header("Content-Type: application/json;");
|
||||
|
||||
//include("GameEngine/Session.php");
|
||||
@@ -103,7 +101,7 @@ $query2 = "SELECT
|
||||
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
||||
|
||||
//echo $query2;
|
||||
$result2 = mysql_query($query2) or die(mysql_error());
|
||||
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error());
|
||||
|
||||
$i=0;
|
||||
$i2=0;
|
||||
@@ -112,7 +110,7 @@ $row = 0;
|
||||
$coorindex = 0;
|
||||
$map_js ='';
|
||||
|
||||
while ($donnees = mysql_fetch_assoc($result2)){
|
||||
while ($donnees = mysqli_fetch_assoc($result2)){
|
||||
|
||||
$targetalliance=$donnees["aliance_id"];
|
||||
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
|
||||
|
||||
@@ -71,7 +71,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst']= 3;
|
||||
//Give Reward
|
||||
if(!$session->plus){
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||
$plus+=86400;
|
||||
@@ -151,7 +151,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst']= 11;
|
||||
//Give Reward
|
||||
if(!$session->plus){
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||
$plus+=172800;
|
||||
@@ -338,7 +338,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst_time'] = time()+$skipp_time;
|
||||
//Give Reward
|
||||
if(!$session->plus){
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||
$plus+=86400;
|
||||
@@ -401,7 +401,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst']= 97;
|
||||
//Give Reward 20 gold + 2 days plus
|
||||
if(!$session->plus){
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||
$plus+=172800;
|
||||
|
||||
@@ -69,7 +69,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst']= 3;
|
||||
//Give Reward
|
||||
if(!$session->plus){
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||
$plus+=86400;
|
||||
@@ -154,7 +154,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst']= 11;
|
||||
//Give Reward
|
||||
if(!$session->plus){
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||
$plus+=172800;
|
||||
@@ -322,7 +322,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst_time'] = time()+$skipp_time;
|
||||
//Give Reward
|
||||
if(!$session->plus){
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus',1);
|
||||
$plus+=86400;
|
||||
@@ -385,7 +385,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst']= 97;
|
||||
//Give Reward 20 gold + 2 days plus
|
||||
if(!$session->plus){
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysqli_error());
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus',1);
|
||||
$plus+=172800;
|
||||
|
||||
@@ -9,14 +9,14 @@ if($session->access!=BANNED){
|
||||
$displayarray = $database->getUserArray($session->uid,1);
|
||||
$forumcat = $database->ForumCat(htmlspecialchars($displayarray['alliance']));
|
||||
$ally = $session->alliance;
|
||||
$public = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 1");
|
||||
$public1 = mysql_num_rows($public);
|
||||
$cofederation = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 2");
|
||||
$cofederation1 = mysql_num_rows($cofederation);
|
||||
$alliance = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 0");
|
||||
$alliance1 = mysql_num_rows($alliance);
|
||||
$closed = mysql_query("SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 3");
|
||||
$closed1 = mysql_num_rows($closed);
|
||||
$public = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 1");
|
||||
$public1 = mysqli_num_rows($public);
|
||||
$cofederation = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 2");
|
||||
$cofederation1 = mysqli_num_rows($cofederation);
|
||||
$alliance = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 0");
|
||||
$alliance1 = mysqli_num_rows($alliance);
|
||||
$closed = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 3");
|
||||
$closed1 = mysqli_num_rows($closed);
|
||||
if($public1 != 0){
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="public"><thead>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
$prefix = "".TB_PREFIX."ndata";
|
||||
$limit = "ntype!=0 AND ntype!=4 AND ntype!=5 AND ntype!=6 AND ntype!=7 AND ntype!=8 AND ntype!=9 AND ntype!=10 AND ntype!=11 AND ntype!=12 AND ntype!=13 AND ntype!=14 AND ntype!=15 AND ntype!=16 AND ntype!=17 AND ntype!=20 AND ntype!=21";
|
||||
$sql = mysql_query("SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
|
||||
$query = mysql_num_rows($sql);
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
|
||||
$query = mysqli_num_rows($sql);
|
||||
$outputList = '';
|
||||
$name = 1;
|
||||
if($query == 0) {
|
||||
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
|
||||
}else{
|
||||
while($row = mysql_fetch_array($sql)){
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$id = $row["id"];
|
||||
$uid = $row["uid"];
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
$prefix = "".TB_PREFIX."ndata";
|
||||
$limit = "ntype!=1 AND ntype!=2 AND ntype!=3 AND ntype!=8 AND ntype!=9 AND ntype!=10 AND ntype!=11 AND ntype!=12 AND ntype!=13 AND ntype!=14 AND ntype!=15 AND ntype!=16 AND ntype!=17 AND ntype!=18 AND ntype!=19";
|
||||
$sql = mysql_query("SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
|
||||
$query = mysql_num_rows($sql);
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
|
||||
$query = mysqli_num_rows($sql);
|
||||
$outputList = '';
|
||||
$name = 1;
|
||||
if($query == 0) {
|
||||
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
|
||||
}else{
|
||||
while($row = mysql_fetch_array($sql)){
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$id = $row["id"];
|
||||
$uid = $row["uid"];
|
||||
|
||||
@@ -28,14 +28,14 @@ include("alli_menu.tpl");
|
||||
}else{
|
||||
$prefix = "".TB_PREFIX."ndata";
|
||||
$limit = "ntype!=8 AND ntype!=9 AND ntype!=10 AND ntype!=11 AND ntype!=12 AND ntype!=13 AND ntype!=14 AND ntype!=15 AND ntype!=16 AND ntype!=17";
|
||||
$sql = mysql_query("SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
|
||||
$query = mysql_num_rows($sql);
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM $prefix WHERE ally = $session->alliance AND $limit ORDER BY time DESC LIMIT 20");
|
||||
$query = mysqli_num_rows($sql);
|
||||
$outputList = '';
|
||||
$name = 1;
|
||||
if($query == 0) {
|
||||
$outputList .= "<td colspan=\"4\" class=\"none\">There are no reports available.</td>";
|
||||
}else{
|
||||
while($row = mysql_fetch_array($sql)){
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$id = $row["id"];
|
||||
$uid = $row["uid"];
|
||||
|
||||
@@ -8,8 +8,8 @@ $total_for2 = count($send);
|
||||
for($y=0;$y < $total_for;$y++){
|
||||
for($i=0;$i < $total_for2;$i++){
|
||||
if($units[$y]['ref'] == $send[$i]['ref2']){
|
||||
$res1 = mysql_query("SELECT * FROM " . TB_PREFIX . "send where id = ".$send[$i]['ref']."");
|
||||
$res = mysql_fetch_array($res1);
|
||||
$res1 = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "send where id = ".$send[$i]['ref']."");
|
||||
$res = mysqli_fetch_array($res1);
|
||||
}
|
||||
}
|
||||
$timer = $y+1;
|
||||
|
||||
+14
-14
@@ -6,33 +6,33 @@ if(time() - $_SESSION['time_p'] > 5) {
|
||||
}
|
||||
|
||||
if($_POST AND $_GET['action'] == 'change_capital') {
|
||||
$pass = mysql_escape_string($_POST['pass']);
|
||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $session->uid);
|
||||
$data = mysql_fetch_assoc($query);
|
||||
$pass = mysqli_escape_string($GLOBALS['link'],$_POST['pass']);
|
||||
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $session->uid);
|
||||
$data = mysqli_fetch_assoc($query);
|
||||
if($data['password'] == md5($pass)) {
|
||||
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
|
||||
$data1 = mysql_fetch_assoc($query1);
|
||||
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'fdata` WHERE `vref` = ' . $data1['wref']);
|
||||
$data2 = mysql_fetch_assoc($query2);
|
||||
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
|
||||
$data1 = mysqli_fetch_assoc($query1);
|
||||
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'fdata` WHERE `vref` = ' . $data1['wref']);
|
||||
$data2 = mysqli_fetch_assoc($query2);
|
||||
if($data2['vref'] != $village->wid) {
|
||||
for($i = 1; $i<=18; ++$i) {
|
||||
if($data2['f' . $i] > 10) {
|
||||
$query2 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . '` = 10 WHERE `vref` = ' . $data2['vref']) or die(mysql_error());
|
||||
$query2 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . '` = 10 WHERE `vref` = ' . $data2['vref']) or die(mysqli_error());
|
||||
}
|
||||
}
|
||||
for($i=19; $i<=40; ++$i) {
|
||||
if($data2['f' . $i . 't'] == 34) {
|
||||
$query3 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . $data2['vref']) or die(mysql_error());
|
||||
$query3 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . $data2['vref']) or die(mysqli_error());
|
||||
}
|
||||
}
|
||||
|
||||
for($i=19; $i<=40; ++$i) {
|
||||
if($data2['f' . $i . 't'] == 29 or $data2['f' . $i . 't'] == 30 or $data2['f' . $i . 't'] == 38 or $data2['f' . $i . 't'] == 39 or $data2['f' . $i . 't'] == 42) {
|
||||
$query3 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . $village->wid) or die(mysql_error());
|
||||
$query3 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . $village->wid) or die(mysqli_error());
|
||||
}
|
||||
}
|
||||
$query3 = mysql_query('UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 0 WHERE `wref` = ' . $data1['wref']);
|
||||
$query4 = mysql_query('UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 1 WHERE `wref` = ' . $village->wid);
|
||||
$query3 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 0 WHERE `wref` = ' . $data1['wref']);
|
||||
$query4 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 1 WHERE `wref` = ' . $village->wid);
|
||||
}
|
||||
} else {
|
||||
$error = '<br /><font color="red">'.LOGIN_PW_ERROR.'</font><br />';
|
||||
@@ -68,8 +68,8 @@ else{
|
||||
?>
|
||||
|
||||
<?php
|
||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
|
||||
$data = mysql_fetch_assoc($query);
|
||||
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $session->uid . ' AND `capital` = 1');
|
||||
$data = mysqli_fetch_assoc($query);
|
||||
if($data['wref'] == $village->wid) {
|
||||
?>
|
||||
<p class="none"><?php echo CAPITAL; ?></p>
|
||||
|
||||
@@ -84,7 +84,7 @@ Treasury <b>' . $reqlvl . '</b>, Effect <b>' . $effect . '</b>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
if(mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
|
||||
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
|
||||
echo '<td colspan="4" class="none">'.NO_ARTIFACTS_AREA.'</td>';
|
||||
} else {
|
||||
|
||||
@@ -102,11 +102,11 @@ if(mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts")) == 0)
|
||||
|
||||
unset($reqlvl);
|
||||
unset($effect);
|
||||
$arts = mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts");
|
||||
$arts = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "artefacts");
|
||||
$rows = array();
|
||||
while($row = mysql_fetch_array($arts)) {
|
||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'wdata` WHERE `id` = ' . $row['vref']);
|
||||
$coor2 = mysql_fetch_assoc($query);
|
||||
while($row = mysqli_fetch_array($arts)) {
|
||||
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'wdata` WHERE `id` = ' . $row['vref']);
|
||||
$coor2 = mysqli_fetch_assoc($query);
|
||||
|
||||
|
||||
$dist = round(getDistance($coor['x'], $coor['y'], $coor2['x'], $coor2['y']),1);
|
||||
|
||||
+19
-19
@@ -31,13 +31,13 @@
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
if(mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
|
||||
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
|
||||
echo '<td colspan="4" class="none">'.NO_ARTIFACTS.'</td>';
|
||||
} else {
|
||||
|
||||
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 1");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 1");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -56,8 +56,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 2");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 2");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -76,8 +76,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 3");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 3");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -96,8 +96,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 4");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 4");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -115,8 +115,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 5");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 5");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -134,8 +134,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 6");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 6");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -153,8 +153,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 7");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 7");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -172,8 +172,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 8");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 8");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -186,8 +186,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 8");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 8");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
|
||||
+31
-31
@@ -31,12 +31,12 @@
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
if(mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
|
||||
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "artefacts")) == 0) {
|
||||
echo '<td colspan="4" class="none">'.NO_ARTIFACTS.'</td>';
|
||||
} else {
|
||||
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 1");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 1");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -49,8 +49,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 1");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 1");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -69,8 +69,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 2");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 2");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -83,8 +83,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 2");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 2");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -103,8 +103,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 3");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 3");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -117,8 +117,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 3");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 3");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -137,8 +137,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 4");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 4");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -151,8 +151,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 4");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 4");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -170,8 +170,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 5");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 5");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -184,8 +184,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 5");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 5");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -203,8 +203,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 6");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 6");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -217,8 +217,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 6");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 6");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -236,8 +236,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 7");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 7");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -250,8 +250,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 7");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 7");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
@@ -269,8 +269,8 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysql_query("SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 8");
|
||||
while($row = mysql_fetch_array($artefact)) {
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT * FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 8");
|
||||
while($row = mysqli_fetch_array($artefact)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="icon"><img class="artefact_icon_' . $row['type'] . '" src="img/x.gif" alt="" title=""></td>';
|
||||
echo '<td class="nam">';
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
| Copyright: TravianX Project All rights reserved |
|
||||
\*-------------------------------------------------------*/
|
||||
|
||||
$hero = mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
|
||||
$hero_info = mysql_fetch_array($hero);
|
||||
$hero = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
|
||||
$hero_info = mysqli_fetch_array($hero);
|
||||
|
||||
$define['reset_level'] = 3; // Until which level you are able to reset your points
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
if(isset($_GET['land'])) {
|
||||
include("37_land.tpl");
|
||||
} else {
|
||||
if(mysql_num_rows($hero) == 0){
|
||||
if(mysqli_num_rows($hero) == 0){
|
||||
include("37_train.tpl");
|
||||
}elseif($hero_info['intraining'] == 1){
|
||||
$timeleft = $generator->getTimeFormat($hero_info['trainingtime'] - time());
|
||||
@@ -87,10 +87,10 @@
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
if(mysql_num_rows($hero) != 0 AND $hero_info['dead'] == 1 AND $hero_info['intraining'] == 0){
|
||||
if(mysqli_num_rows($hero) != 0 AND $hero_info['dead'] == 1 AND $hero_info['intraining'] == 0){
|
||||
include("37_revive.tpl");
|
||||
}
|
||||
if(mysql_num_rows($hero) != 0 AND $hero_info['dead'] == 0 AND $hero_info['trainingtime'] <= time() AND $hero_info['inrevive'] == 0 AND $hero_info['intraining'] == 0){
|
||||
if(mysqli_num_rows($hero) != 0 AND $hero_info['dead'] == 0 AND $hero_info['trainingtime'] <= time() AND $hero_info['inrevive'] == 0 AND $hero_info['intraining'] == 0){
|
||||
include("37_hero.tpl");
|
||||
}
|
||||
}
|
||||
|
||||
+19
-19
@@ -13,9 +13,9 @@ include_once("GameEngine/Data/hero_full.php");
|
||||
|
||||
if (isset($_POST['name'])) {
|
||||
$_POST['name'] = stripslashes($_POST['name']);
|
||||
mysql_query("UPDATE ".TB_PREFIX."hero SET `name`='".($_POST['name'])."' where `uid`='".$session->uid."'") or die("ERROR:".mysql_error());
|
||||
$hero = mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
|
||||
$hero_info = mysql_fetch_array($hero);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `name`='".($_POST['name'])."' where `uid`='".$session->uid."'") or die("ERROR:".mysqli_error());
|
||||
$hero = mysqli_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . "");
|
||||
$hero_info = mysqli_fetch_array($hero);
|
||||
echo "".NAME_CHANGED."";
|
||||
}
|
||||
|
||||
@@ -169,48 +169,48 @@ if (isset($_POST['name'])) {
|
||||
if($_GET['add'] == "reset") {
|
||||
if($hero_info['level'] <= 3){
|
||||
if($hero_info['attack'] != 0 OR $hero_info['defence'] != 0 OR $hero_info['attackbonus'] != 0 OR $hero_info['defencebonus'] != 0 OR $hero_info['regeneration'] != 0){
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = '".(($hero_info['level']*5)+5)."' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `regeneration` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = '".(($hero_info['level']*5)+5)."' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = '0' WHERE `uid` = '" . $session->uid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "off" && $hero_info['attack'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "deff" && $hero_info['defence'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "obonus" && $hero_info['attackbonus'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "dbonus" && $hero_info['defencebonus'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "reg" && $hero_info['regeneration'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `uid` = '" . $session->uid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,11 +171,11 @@
|
||||
|
||||
if($_GET['revive'] == 1 && $hero_info['inrevive'] == 0 && $hero_info['intraining'] == 0 && $hero_info['dead'] == 1){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".$training_time2."', `wref` = '".$village->wid."' WHERE `uid` = '".$session->uid."'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$wood." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$clay." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$iron." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$crop." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".$training_time2."', `wref` = '".$village->wid."' WHERE `uid` = '".$session->uid."'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$wood." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$clay." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$iron." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$crop." WHERE `wref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
|
||||
+108
-108
@@ -34,8 +34,8 @@
|
||||
|
||||
//check if there is unit needed in the village
|
||||
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".$village->wid."");
|
||||
$units = mysql_fetch_array($result);
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".$village->wid."");
|
||||
$units = mysqli_fetch_array($result);
|
||||
|
||||
$output="<table cellpadding=1 cellspacing=1 class=\"build_details\">
|
||||
<thead>
|
||||
@@ -529,18 +529,18 @@ $output.="<tr>
|
||||
|
||||
|
||||
//HERO TRAINING
|
||||
$count_hero = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . ""));
|
||||
$count_hero = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = " . $session->uid . ""));
|
||||
if($session->tribe == 1){
|
||||
if($_GET['train'] == 1){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '1', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u1` = `u1` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u1['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u1['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u1['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u1['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '1', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u1` = `u1` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u1['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u1['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u1['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u1['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -549,14 +549,14 @@ $output.="<tr>
|
||||
}
|
||||
if($_GET['train'] == 2){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '2', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u2` = `u2` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u2['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u2['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u2['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u2['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '2', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u1['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u2` = `u2` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u2['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u2['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u2['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u2['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -565,13 +565,13 @@ $output.="<tr>
|
||||
}
|
||||
if($_GET['train'] == 3){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '3', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u3['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u3` = `u3` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u3['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u3['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u3['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u3['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '3', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u3['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u3` = `u3` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u3['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u3['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u3['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u3['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
@@ -579,14 +579,14 @@ $output.="<tr>
|
||||
}
|
||||
if($_GET['train'] == 5){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '5', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u5['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u5` = `u5` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u5['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u5['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u5['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u5['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '5', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u5['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u5` = `u5` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u5['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u5['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u5['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u5['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -595,14 +595,14 @@ $output.="<tr>
|
||||
}
|
||||
if($_GET['train'] == 6){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '6', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u6['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u6` = `u6` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u6['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u6['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u6['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u6['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '6', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u6['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u6` = `u6` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u6['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u6['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u6['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u6['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -613,14 +613,14 @@ $output.="<tr>
|
||||
if($session->tribe == 2){
|
||||
if($_GET['train'] == 11){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '11', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u11['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u11` = `u11` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u11['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u11['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u11['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u11['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '11', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u11['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u11` = `u11` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u11['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u11['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u11['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u11['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -629,14 +629,14 @@ $output.="<tr>
|
||||
}
|
||||
if($_GET['train'] == 12){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '12', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u12['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u12` = `u12` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u12['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u12['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u12['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u12['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '12', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u12['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u12` = `u12` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u12['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u12['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u12['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u12['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -645,14 +645,14 @@ $output.="<tr>
|
||||
}
|
||||
if($_GET['train'] == 13){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '13', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u13['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u13` = `u13` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u13['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u13['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u13['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u13['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '13', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u13['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u13` = `u13` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u13['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u13['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u13['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u13['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -661,14 +661,14 @@ $output.="<tr>
|
||||
}
|
||||
if($_GET['train'] == 15){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '15', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u15['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u15` = `u15` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u15['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u15['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u15['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u15['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '15', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u15['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u15` = `u15` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u15['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u15['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u15['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u15['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -677,14 +677,14 @@ $output.="<tr>
|
||||
}
|
||||
if($_GET['train'] == 16){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '16', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u16['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u16` = `u16` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u16['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u16['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u16['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u16['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '16', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u16['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u16` = `u16` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u16['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u16['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u16['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u16['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -695,14 +695,14 @@ $output.="<tr>
|
||||
if($session->tribe == 3){
|
||||
if($_GET['train'] == 21){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '21', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u21['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u21` = `u21` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u21['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u21['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u21['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u21['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '21', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u21['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u21` = `u21` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u21['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u21['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u21['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u21['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -711,14 +711,14 @@ $output.="<tr>
|
||||
}
|
||||
if($_GET['train'] == 22){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '22', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u22['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u22` = `u22` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u22['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u22['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u22['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u22['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '22', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u22['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u22` = `u22` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u22['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u22['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u22['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u22['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -727,14 +727,14 @@ $output.="<tr>
|
||||
}
|
||||
if($_GET['train'] == 24){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '24', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u24['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u24` = `u24` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u24['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u24['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u24['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u24['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '24', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u24['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u24` = `u24` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u24['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u24['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u24['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u24['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -743,14 +743,14 @@ $output.="<tr>
|
||||
}
|
||||
if($_GET['train'] == 25){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '25', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u25['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u25` = `u25` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u25['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u25['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u25['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u25['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '25', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u25['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u25` = `u25` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u25['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u25['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u25['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u25['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
@@ -759,14 +759,14 @@ $output.="<tr>
|
||||
}
|
||||
if($_GET['train'] == 26){
|
||||
if($session->access != BANNED){
|
||||
mysql_query("DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
mysqli_query($GLOBALS['link'],"DELETE from " . TB_PREFIX . "hero WHERE `dead` = 1 AND `uid` = '" . $session->uid . "'");
|
||||
if($count_hero == 0){
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '26', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u26['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "units SET `u26` = `u26` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u26['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u26['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u26['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u26['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES ('".$session->uid."', '" . $village->wid . "', '0', '26', '".addslashes($session->username)."', '0', '5', '0', '0', '100', '0', '0', '0', '0', '".round((time() + ($u26['time'] / SPEED)*3))."', '50', '1')");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u26` = `u26` - 1 WHERE `vref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `wood` = `wood` - ".$u26['wood']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u26['clay']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `iron` = `iron` - ".$u26['iron']." WHERE `wref` = '" . $village->wid . "'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET `crop` = `crop` - ".$u26['crop']." WHERE `wref` = '" . $village->wid . "'");
|
||||
}
|
||||
header("Location: build.php?id=".$id."");
|
||||
}else{
|
||||
|
||||
@@ -162,17 +162,14 @@ if($palace == 0 && $palace1 == 0 && $village->natar == 0 && $embassy >= 1 && $ma
|
||||
//id user
|
||||
$user = $session->uid;
|
||||
|
||||
//connect to DB
|
||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
mysql_select_db(SQL_DB);
|
||||
|
||||
//loop search village user
|
||||
$query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
|
||||
while($villaggi_array = mysql_fetch_array($query)){
|
||||
$query = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
|
||||
while($villaggi_array = mysqli_fetch_array($query)){
|
||||
|
||||
//loop structure village
|
||||
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
|
||||
$strutture= mysql_fetch_array($query1);
|
||||
$query1 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
|
||||
$strutture= mysqli_fetch_array($query1);
|
||||
if($strutture == false)
|
||||
$strutture = [];
|
||||
//search Castle in array structure village
|
||||
@@ -287,16 +284,16 @@ if($embassy == 0 || $mainbuilding >= 2 && $mainbuilding <= 4 && $village->natar
|
||||
$user = $session->uid;
|
||||
|
||||
//connect to DB
|
||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
mysql_select_db(SQL_DB);
|
||||
//mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
//mysql_select_db(SQL_DB);
|
||||
|
||||
//loop search village user
|
||||
$query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
|
||||
while($villaggi_array = mysql_fetch_array($query)){
|
||||
$query = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
|
||||
while($villaggi_array = mysqli_fetch_array($query)){
|
||||
|
||||
//loop structure village
|
||||
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
|
||||
$strutture= mysql_fetch_array($query1);
|
||||
$query1 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
|
||||
$strutture= mysqli_fetch_array($query1);
|
||||
|
||||
//search Castle in array structure village
|
||||
if($strutture !== false)
|
||||
|
||||
@@ -111,7 +111,7 @@ $query2 = "SELECT
|
||||
|
||||
//$query2;
|
||||
|
||||
$result2 = mysql_query($query2) or die(mysql_error());
|
||||
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error());
|
||||
|
||||
$targetalliance = array();
|
||||
$neutralarray = array();
|
||||
@@ -129,7 +129,7 @@ $map_js ='';
|
||||
$map_gen='';
|
||||
$map_content='';
|
||||
|
||||
while ($donnees = mysql_fetch_assoc($result2)){
|
||||
while ($donnees = mysqli_fetch_assoc($result2)){
|
||||
|
||||
$targetalliance=$donnees["aliance_id"];
|
||||
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
|
||||
|
||||
@@ -121,7 +121,7 @@ $query2 = "SELECT
|
||||
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
||||
|
||||
//echo $query2;
|
||||
$result2 = mysql_query($query2) or die(mysql_error());
|
||||
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error());
|
||||
|
||||
$targetalliance = array();
|
||||
$neutralarray = array();
|
||||
@@ -307,7 +307,7 @@ $coorarray = array(
|
||||
,"924, 253, 961, 273, 924, 293, 887, 273"
|
||||
);
|
||||
|
||||
while ($donnees = mysql_fetch_assoc($result2)){
|
||||
while ($donnees = mysqli_fetch_assoc($result2)){
|
||||
|
||||
$targetalliance=$donnees["aliance_id"];
|
||||
$friendarray=$database->getAllianceAlly($donnees["aliance_id"],1);
|
||||
|
||||
+25
-25
@@ -2,8 +2,8 @@
|
||||
<?php
|
||||
$basearray = $database->getMInfo($_GET['d']);
|
||||
$uinfo = $database->getVillage($basearray['id']);
|
||||
$oasis1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysql_real_escape_string($_GET['d']));
|
||||
$oasis = mysql_fetch_assoc($oasis1);
|
||||
$oasis1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysqli_real_escape_string($GLOBALS['link'],$_GET['d']));
|
||||
$oasis = mysqli_fetch_assoc($oasis1);
|
||||
$access=$session->access;
|
||||
?>
|
||||
<h1><?php if($basearray['fieldtype']!=0){
|
||||
@@ -159,10 +159,10 @@ if($session->uid == $database->getVillage($_GET['d'])){
|
||||
}
|
||||
$toWref = $_GET['d'];
|
||||
if($session->alliance!=0){
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysql_num_rows($result);
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysqli_num_rows($result);
|
||||
if($query != 0){
|
||||
while($row = mysql_fetch_array($result)){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
$topic=$row['topic'];
|
||||
@@ -183,10 +183,10 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
|
||||
<?php }
|
||||
}else{
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysql_num_rows($result);
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysqli_num_rows($result);
|
||||
if($query != 0){
|
||||
while($row = mysql_fetch_array($result)){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
$topic=$row['topic'];
|
||||
@@ -258,10 +258,10 @@ if($session->uid == $database->getVillage($_GET['d'])){
|
||||
}
|
||||
$toWref = $_GET['d'];
|
||||
if($session->alliance!=0){
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysql_num_rows($result);
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysqli_num_rows($result);
|
||||
if($query != 0){
|
||||
while($row = mysql_fetch_array($result)){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
$topic=$row['topic'];
|
||||
@@ -282,10 +282,10 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
|
||||
<?php }
|
||||
}else{
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysql_num_rows($result);
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysqli_num_rows($result);
|
||||
if($query != 0){
|
||||
while($row = mysql_fetch_array($result)){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
$topic=$row['topic'];
|
||||
@@ -384,10 +384,10 @@ if($session->uid == $database->getVillage($_GET['d'])){
|
||||
}
|
||||
$toWref = $_GET['d'];
|
||||
if($session->alliance!=0){
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysql_num_rows($result);
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysqli_num_rows($result);
|
||||
if($query != 0){
|
||||
while($row = mysql_fetch_array($result)){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
$topic=$row['topic'];
|
||||
@@ -408,10 +408,10 @@ if($type==18 or $type==19 or $type==20 or $type==21 or $type==22){
|
||||
|
||||
<?php }
|
||||
}else{
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysql_num_rows($result);
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limit AND uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$query = mysqli_num_rows($result);
|
||||
if($query != 0){
|
||||
while($row = mysql_fetch_array($result)){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$dataarray = explode(",",$row['data']);
|
||||
$type = $row['ntype'];
|
||||
$topic=$row['topic'];
|
||||
@@ -485,13 +485,13 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
<td class="none">
|
||||
<?php
|
||||
if($basearray['fieldtype'] == 0){
|
||||
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysql_escape_string($_GET['d']));
|
||||
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysqli_escape_string($GLOBALS['link'],$_GET['d']));
|
||||
}else{
|
||||
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysql_real_escape_string($_GET['d']));
|
||||
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysqli_real_escape_string($GLOBALS['link'],$_GET['d']));
|
||||
}
|
||||
$data1 = mysql_fetch_assoc($query1);
|
||||
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
|
||||
$data2 = mysql_fetch_assoc($query2);
|
||||
$data1 = mysqli_fetch_assoc($query1);
|
||||
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
|
||||
$data2 = mysqli_fetch_assoc($query2);
|
||||
if($data2['access']=='0' or $data2['access']=='8' or $data2['access']=='9') {
|
||||
echo "» ".SENDTROOP." (".BAN.")";
|
||||
} else if($data2['vac_mode']=='1') {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
x<div id="content" class="messages">
|
||||
<h1>Messages</h1>
|
||||
<?php
|
||||
<?php
|
||||
include("menu.tpl");
|
||||
?>
|
||||
<form method="post" action="nachrichten.php" name="msg" ><table cellpadding="1" cellspacing="1" id="overview">
|
||||
@@ -11,8 +11,8 @@ x<div id="content" class="messages">
|
||||
<th class="sent">Sent</th>
|
||||
</tr></thead><tfoot><tr><th>
|
||||
<?php
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$date2=strtotime("NOW");
|
||||
if ($golds['plus'] <= $date2) { ?>
|
||||
<?php } else { ?>
|
||||
@@ -23,7 +23,7 @@ x<div id="content" class="messages">
|
||||
<input name="delmsg" value="delete" type="image" id="btn_delete" class="dynamic_img" src="img/x.gif" alt="delete" />
|
||||
<?php if($session->plus) { echo "<input name=\"archive\" value=\"Archive\" type=\"image\" id=\"btn_archiv\" class=\"dynamic_img\" src=\"img/x.gif\" alt=\"Archive\" />"; } ?>
|
||||
<input name="ft" value="m3" type="hidden" />
|
||||
</th><th class="navi"><?php
|
||||
</th><th class="navi"><?php
|
||||
if(!isset($_GET['s']) && count($message->inbox1) < 10) {
|
||||
echo "«»";
|
||||
}
|
||||
@@ -47,7 +47,7 @@ x<div id="content" class="messages">
|
||||
background-color:orange;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
<?php
|
||||
if(isset($_GET['s'])) {
|
||||
$s = $_GET['s'];
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
<th>Recipient</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
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$date2=strtotime("NOW");
|
||||
if ($golds['plus'] <= $date2) { ?>
|
||||
<?php } else { ?>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<h5><img src="img/en/t2/newsbox1.gif" alt="newsbox 1"></h5>
|
||||
<?php
|
||||
|
||||
$online = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
$top_rank = mysql_fetch_assoc(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access< 8 AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY oldrank ASC Limit 1"));
|
||||
$online = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
$top_rank = mysqli_fetch_assoc(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access< 8 AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY oldrank ASC Limit 1"));
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<h5><img src="img/en/t2/newsbox2.gif" alt="newsbox 2"></h5>
|
||||
<?php
|
||||
|
||||
$online = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
$online = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -12,8 +12,8 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
|
||||
</tr>
|
||||
</thead><tfoot>
|
||||
<tr><th><?php
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$date2=strtotime("NOW");
|
||||
if ($golds['plus'] <= $date2) { ?>
|
||||
<?php } else { ?>
|
||||
|
||||
+25
-51
@@ -1,55 +1,29 @@
|
||||
<?php
|
||||
////////////// made by alq0rsan /////////////////////////
|
||||
if($session->access != BANNED){
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
|
||||
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$uuid = mysql_fetch_array($MyId);
|
||||
|
||||
|
||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
|
||||
$uuVilid = mysql_fetch_array($MyVilId);
|
||||
|
||||
|
||||
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
|
||||
|
||||
$today = date("mdHi");
|
||||
if($session->sit == 0) {
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if($golds['6'] > 2) {
|
||||
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
|
||||
if($golds['b2'] < time()) {
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set b2 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||
if($session->access != BANNED && $session->gold >= 5){
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
if($session->sit == 0) {
|
||||
if (mysqli_num_rows($MyGold) == 1) {
|
||||
if($golds['gold'] >= 5) {
|
||||
if($golds['b2'] < time()) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b2 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
} else {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b2 = '".($golds['b2']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
}
|
||||
$done1 = "+25% Production: Clay";
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Clay')") or die(mysqli_error());
|
||||
} else {
|
||||
$done1 = "You need more gold";
|
||||
}
|
||||
} else {
|
||||
$done1 = "Failed clay attempt";
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Clay')") or die(mysqli_error());
|
||||
}
|
||||
}
|
||||
header("Location: plus.php?id=3");
|
||||
} else {
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set b2 = '".($golds['b2']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
}
|
||||
|
||||
|
||||
$done1 = "+25% Production: Clay";
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysql_error());
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', '+25% Production: Clay')") or die(mysql_error());
|
||||
|
||||
} else {
|
||||
$done1 = "nothing has been done";
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed +25% Production: Clay')") or die(mysql_error());
|
||||
|
||||
}
|
||||
} else {
|
||||
$done1 = "You need more gold";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
header("Location: plus.php?id=3");
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
header("Location: banned.php");
|
||||
}
|
||||
?>
|
||||
+25
-51
@@ -1,55 +1,29 @@
|
||||
<?php
|
||||
////////////// made by alq0rsan /////////////////////////
|
||||
if($session->access != BANNED){
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
|
||||
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$uuid = mysql_fetch_array($MyId);
|
||||
|
||||
|
||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
|
||||
$uuVilid = mysql_fetch_array($MyVilId);
|
||||
|
||||
|
||||
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
|
||||
|
||||
$today = date("mdHi");
|
||||
if($session->sit == 0) {
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if($golds['6'] > 2) {
|
||||
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
|
||||
if($golds['b3'] < time()) {
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set b3 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||
if($session->access != BANNED && $session->gold >= 5){
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
if($session->sit == 0) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] >= 5) {
|
||||
if($golds['b3'] < time()) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b3 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
} else {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b3 = '".($golds['b3']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
}
|
||||
$done1 = "+25% Production: Iron";
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Iron')") or die(mysqli_error());
|
||||
} else {
|
||||
$done1 = "You need more gold";
|
||||
}
|
||||
} else {
|
||||
$done1 = "Failed iron attempt";
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Iron')") or die(mysqli_error());
|
||||
}
|
||||
}
|
||||
header("Location: plus.php?id=3");
|
||||
} else {
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set b3 = '".($golds['b3']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
}
|
||||
|
||||
|
||||
$done1 = "+25% Production: Iron";
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysql_error());
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', '+25% Production: Iron')") or die(mysql_error());
|
||||
|
||||
} else {
|
||||
$done1 = "nothing has been done";
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed +25% Production: Iron')") or die(mysql_error());
|
||||
|
||||
}
|
||||
} else {
|
||||
$done1 = "You need more gold";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
header("Location: plus.php?id=3");
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
header("Location: banned.php");
|
||||
}
|
||||
?>
|
||||
+25
-51
@@ -1,55 +1,29 @@
|
||||
<?php
|
||||
////////////// made by alq0rsan /////////////////////////
|
||||
if($session->access != BANNED){
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
|
||||
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$uuid = mysql_fetch_array($MyId);
|
||||
|
||||
|
||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
|
||||
$uuVilid = mysql_fetch_array($MyVilId);
|
||||
|
||||
|
||||
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
|
||||
|
||||
$today = date("mdHi");
|
||||
if($session->sit == 0) {
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if($golds['6'] > 2) {
|
||||
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
|
||||
if($golds['b4'] < time()) {
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set b4 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||
if($session->access != BANNED && $session->gold >= 5){
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
if($session->sit == 0) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] >= 5) {
|
||||
if($golds['b4'] < time()) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b4 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
} else {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b4 = '".($golds['b4']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
}
|
||||
$done1 = "+25% Production: Crop";
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Crop')") or die(mysqli_error());
|
||||
} else {
|
||||
$done1 = "You need more gold";
|
||||
}
|
||||
} else {
|
||||
$done1 = "Failed crop attempt";
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Crop')") or die(mysqli_error());
|
||||
}
|
||||
}
|
||||
header("Location: plus.php?id=3");
|
||||
} else {
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set b4 = '".($golds['b4']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
}
|
||||
|
||||
|
||||
$done1 = "+25% Production: Crop";
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysql_error());
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', '+25% Production: Crop')") or die(mysql_error());
|
||||
|
||||
} else {
|
||||
$done1 = "nothing has been done";
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed +25% Production: Crop')") or die(mysql_error());
|
||||
|
||||
}
|
||||
} else {
|
||||
$done1 = "You need more gold";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
header("Location: plus.php?id=3");
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
header("Location: banned.php");
|
||||
}
|
||||
?>
|
||||
@@ -1,7 +1,7 @@
|
||||
<!---<?php
|
||||
/*include("Templates/Plus/pmenu.tpl");
|
||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysql_error());
|
||||
$uuVilid = mysql_fetch_array($MyVilId);
|
||||
$MyVilId = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysqli_error());
|
||||
$uuVilid = mysqli_fetch_array($MyVilId);
|
||||
$totalR = ($uuVilid['6']+$uuVilid['7']+$uuVilid['8']+$uuVilid['10']);
|
||||
$quart = ($totalR / 4);
|
||||
*/
|
||||
@@ -21,11 +21,11 @@
|
||||
<td align="center">
|
||||
<?php
|
||||
if($session->sit == 0) {
|
||||
/* $MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
/* $MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
|
||||
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$uuid = mysql_fetch_array($MyId);
|
||||
$MyId = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$uuid = mysqli_fetch_array($MyId);
|
||||
|
||||
echo "<input type='text' name='T1' size='6' value=".$quart."></td>";
|
||||
echo "<td align='center'>";
|
||||
@@ -34,7 +34,7 @@ if($session->sit == 0) {
|
||||
echo "<input type='text' name='T3' size='6' value=".$quart."></td>";
|
||||
echo "<td align='center'>";
|
||||
echo "<input type='text' name='T4' size='6' value=".$quart."></td>";
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-1)." where `id`='".$session->uid."'") or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-1)." where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
*/
|
||||
}
|
||||
?>
|
||||
|
||||
+12
-12
@@ -1,28 +1,28 @@
|
||||
<?php
|
||||
////////////// made by alq0rsan /////////////////////////
|
||||
if($session->access != BANNED){
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
|
||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysql_error());
|
||||
$uuVilid = mysql_fetch_array($MyVilId);
|
||||
$MyVilId = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysqli_error());
|
||||
$uuVilid = mysqli_fetch_array($MyVilId);
|
||||
|
||||
$totalT = ($T1+$T2+$T3+$T4);
|
||||
$totalR = ($uuVilid['6']+$uuVilid['7']+$uuVilid['8']+$uuVilid['10']);
|
||||
|
||||
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
|
||||
$goldlog = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysqli_error());
|
||||
|
||||
if($totalT <= $totalR) {
|
||||
mysql_query("UPDATE ".TB_PREFIX."vdata set wood = '".$T1."' where `wref`='".$village->wid."'") or die(mysql_error());
|
||||
mysql_query("UPDATE ".TB_PREFIX."vdata set clay = '".$T2."' where `wref`='".$village->wid."'") or die(mysql_error());
|
||||
mysql_query("UPDATE ".TB_PREFIX."vdata set iron = '".$T3."' where `wref`='".$village->wid."'") or die(mysql_error());
|
||||
mysql_query("UPDATE ".TB_PREFIX."vdata set crop = '".$T4."' where `wref`='".$village->wid."'") or die(mysql_error());
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-3)." where `id`='".$session->uid."'") or die(mysql_error());
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'trade 1:1')") or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set wood = '".$T1."' where `wref`='".$village->wid."'") or die(mysqli_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set clay = '".$T2."' where `wref`='".$village->wid."'") or die(mysqli_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set iron = '".$T3."' where `wref`='".$village->wid."'") or die(mysqli_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set crop = '".$T4."' where `wref`='".$village->wid."'") or die(mysqli_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-3)." where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysqli_num_rows($goldlog)+1)."', '".$village->wid."', 'trade 1:1')") or die(mysqli_error());
|
||||
echo "done";
|
||||
} else {
|
||||
echo "failed";
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed trade 1:1')") or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysqli_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed trade 1:1')") or die(mysqli_error());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
////////////// made by alq0rsan /////////////////////////
|
||||
if($session->access != BANNED){
|
||||
if($session->gold >= 100 && $session->sit == 0 && $session->goldclub == 0) {
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set goldclub = 1, gold = gold - 100 where `id`='".$session->uid."'");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set goldclub = 1, gold = gold - 100 where `id`='".$session->uid."'");
|
||||
}
|
||||
header("Location: plus.php?id=3");
|
||||
|
||||
|
||||
+24
-24
@@ -1,17 +1,17 @@
|
||||
<?php
|
||||
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
|
||||
include("Templates/Plus/pmenu.tpl");
|
||||
|
||||
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
|
||||
$today = date("mdHi");
|
||||
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($session->gold == 0) {
|
||||
echo "<p>You currently don't own gold.</p>";
|
||||
} else {
|
||||
@@ -60,7 +60,7 @@ $date2=strtotime("NOW");
|
||||
}else
|
||||
if ($datetimep <= $date2) {
|
||||
print "Your PLUS advantage has ended.<br>";
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set plus = '0' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = '0' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
} else {
|
||||
|
||||
$holdtotmin=(($datetimep-$date2)/60);
|
||||
@@ -87,10 +87,10 @@ $holdmr=intval($holdtotmin-(($holdhr*60)+($holdtotday*1440)));
|
||||
<td class="act">
|
||||
|
||||
<?php
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 9 && $datetimep < $date2) {
|
||||
echo '
|
||||
<a href="plus.php?id=8"><span>Activate';
|
||||
@@ -151,7 +151,7 @@ echo "<b> ".($holdmr1). "</b> mins</font> ";
|
||||
|
||||
<?php
|
||||
if ($session->access != BANNED){
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 4 && $tl_b1 < $date2) {
|
||||
echo '<a href="plus.php?id=9"><span>Activate';
|
||||
}elseif
|
||||
@@ -161,7 +161,7 @@ if (mysql_num_rows($MyGold)) {
|
||||
echo '<a href="plus.php?s=1"><span class="none">too little gold';}
|
||||
}
|
||||
} else {
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 4 && $tl_b1 < $date2) {
|
||||
echo '<a href="banned.php"><span>Activate';
|
||||
}elseif
|
||||
@@ -217,7 +217,7 @@ echo "<b> ".($holdmr2). "</b> mins<font>";
|
||||
|
||||
<?php
|
||||
if ($session->access != BANNED){
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 4 && $tl_b2 < $date2) {
|
||||
echo '<a href="plus.php?id=10"><span>Activate';
|
||||
}elseif
|
||||
@@ -227,7 +227,7 @@ if (mysql_num_rows($MyGold)) {
|
||||
echo '<a href="plus.php?s=1"><span class="none">too little gold</span></a></td>';}
|
||||
}
|
||||
} else {
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 4 && $tl_b2 < $date2) {
|
||||
echo '<a href="banned.php"><span>Activate';
|
||||
}elseif
|
||||
@@ -281,7 +281,7 @@ echo "<b> ".($holdmr3). "</b> mins</font>";
|
||||
|
||||
<?php
|
||||
if ($session->access != BANNED){
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 4 && $tl_b3 < $date2) {
|
||||
echo '<a href="plus.php?id=11"><span>Activate';
|
||||
}elseif
|
||||
@@ -291,7 +291,7 @@ if (mysql_num_rows($MyGold)) {
|
||||
echo '<a href="plus.php?s=1"><span class="none">too little gold';}
|
||||
}
|
||||
} else {
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 4 && $tl_b3 < $date2) {
|
||||
echo '<a href="banned.php"><span>Activate';
|
||||
}elseif
|
||||
@@ -343,7 +343,7 @@ echo "<b> ".($holdmr4). "</b> mins</font>";
|
||||
<td <span class="none">
|
||||
<?php
|
||||
if ($session->access != BANNED){
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 4 && $tl_b4 < $date2) {
|
||||
echo '<a href="plus.php?id=12"><span>Activate';
|
||||
}elseif
|
||||
@@ -353,7 +353,7 @@ if (mysql_num_rows($MyGold)) {
|
||||
echo '<a href="plus.php?s=1"><span class="none">too little gold';}
|
||||
}
|
||||
} else {
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 4 && $tl_b4 < $date2) {
|
||||
echo '<a href="banned.php"><span>Activate';
|
||||
}elseif
|
||||
@@ -380,7 +380,7 @@ if (mysql_num_rows($MyGold)) {
|
||||
|
||||
<?php
|
||||
if ($session->access != BANNED){
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 1) {
|
||||
echo '
|
||||
<a href="plus.php?id=7"><span>On';
|
||||
@@ -389,7 +389,7 @@ if (mysql_num_rows($MyGold)) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 1) {
|
||||
echo '
|
||||
<a href="banned.php"><span>On';
|
||||
@@ -412,7 +412,7 @@ if (mysql_num_rows($MyGold)) {
|
||||
|
||||
<?php
|
||||
if ($session->access != BANNED){
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 2) {
|
||||
echo ' <a href="build.php?gid=17&t=3"><span>NPC';
|
||||
} else {
|
||||
@@ -420,7 +420,7 @@ if (mysql_num_rows($MyGold)) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['gold'] > 2) {
|
||||
echo ' <a href="banned.php"><span>NPC';
|
||||
} else {
|
||||
@@ -464,10 +464,10 @@ if (mysql_num_rows($MyGold)) {
|
||||
<td class="act">
|
||||
|
||||
<?php
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
if($golds['goldclub']==0){
|
||||
if($golds['gold'] > 99) {
|
||||
echo '
|
||||
|
||||
+24
-51
@@ -1,56 +1,29 @@
|
||||
<?php
|
||||
////////////// made by alq0rsan /////////////////////////
|
||||
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||
if($session->access != BANNED && $session->gold >= 10){
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
|
||||
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$uuid = mysql_fetch_array($MyId);
|
||||
|
||||
|
||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
|
||||
$uuVilid = mysql_fetch_array($MyVilId);
|
||||
|
||||
|
||||
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
|
||||
|
||||
$today = date("mdHi");
|
||||
if($session->sit == 0) {
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if($golds['6'] > 2) {
|
||||
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
|
||||
|
||||
if($golds['12'] == 0) {
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+".PLUS_TIME." where `id`='".$session->uid."'") or die(mysql_error());
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
if($session->sit == 0) {
|
||||
if (mysqli_num_rows($MyGold) == 1) {
|
||||
if($golds['gold'] >= 10) {
|
||||
if($golds['plus'] == 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+".PLUS_TIME." where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
} else {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = '".($golds['plus']+PLUS_TIME)."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
}
|
||||
$done1 = " Plus Account";
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-10)." where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Plus Account')") or die(mysqli_error());
|
||||
} else {
|
||||
$done1 = " You need more gold";
|
||||
}
|
||||
} else {
|
||||
$done1 = "Failed plus attempt";
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed Plus Account')") or die(mysqli_error());
|
||||
}
|
||||
}
|
||||
header("Location: plus.php?id=3");
|
||||
} else {
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set plus = '".($golds['12']+PLUS_TIME)."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
}
|
||||
|
||||
|
||||
$done1 = " 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");
|
||||
header("Location: banned.php");
|
||||
}
|
||||
?>
|
||||
+26
-52
@@ -1,55 +1,29 @@
|
||||
<?php
|
||||
////////////// made by alq0rsan /////////////////////////
|
||||
if($session->access != BANNED){
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
|
||||
$MyId = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$uuid = mysql_fetch_array($MyId);
|
||||
|
||||
|
||||
$MyVilId = mysql_query("SELECT * FROM ".TB_PREFIX."bdata WHERE `wid`='".$village->wid."'") or die(mysql_error());
|
||||
$uuVilid = mysql_fetch_array($MyVilId);
|
||||
|
||||
|
||||
$goldlog = mysql_query("SELECT * FROM ".TB_PREFIX."gold_fin_log") or die(mysql_error());
|
||||
|
||||
$today = date("mdHi");
|
||||
if($session->sit == 0) {
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
if($golds['6'] > 2) {
|
||||
|
||||
if (mysql_num_rows($MyGold)) {
|
||||
|
||||
if($golds['b1'] < time()) {
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set b1 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||
if($session->access != BANNED && $session->gold >= 5){
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
if($session->sit == 0) {
|
||||
if (mysqli_num_rows($MyGold) == 1) {
|
||||
if($golds['gold'] >= 5) {
|
||||
if($golds['b1'] < time()) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b1 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
} else {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b1 = '".($golds['b1']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
}
|
||||
$done1 = "+25% Production: Lumber";
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Lumber')") or die(mysqli_error());
|
||||
} else {
|
||||
$done1 = "You need more gold";
|
||||
}
|
||||
} else {
|
||||
$done1 = "Failed lumber attempt";
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Lumber')") or die(mysqli_error());
|
||||
}
|
||||
}
|
||||
header("Location: plus.php?id=3");
|
||||
} else {
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set b1 = '".($golds['b1']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
header("Location: banned.php");
|
||||
}
|
||||
|
||||
|
||||
$done1 = "+25% Production: Lumber";
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysql_error());
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', '+25% Production: Lumber')") or die(mysql_error());
|
||||
|
||||
} else {
|
||||
$done1 = "nothing has been done";
|
||||
mysql_query("INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".(mysql_num_rows($goldlog)+1)."', '".$village->wid."', 'Failed +25% Production: Lumber')") or die(mysql_error());
|
||||
|
||||
}
|
||||
} else {
|
||||
$done1 = "You need more gold";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
header("Location: plus.php?id=3");
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
}
|
||||
?>
|
||||
?>
|
||||
+11
-11
@@ -32,8 +32,8 @@ echo <<<EOT
|
||||
EOT;
|
||||
}else{
|
||||
|
||||
$account = mysql_real_escape_string($_POST['username']);
|
||||
$reward = mysql_real_escape_string($_POST['reward']);
|
||||
$account = mysqli_real_escape_string($GLOBALS['link'],$_POST['username']);
|
||||
$reward = mysqli_real_escape_string($GLOBALS['link'],$_POST['reward']);
|
||||
$valid=TRUE;
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ EOT;
|
||||
$plusTime = 604800; // 7 days
|
||||
$time = time();
|
||||
$giveplus = ($time + $plustime);
|
||||
$accountCheck = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
if(mysql_num_rows($accountCheck) <= 0){
|
||||
$accountCheck = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
if(mysqli_num_rows($accountCheck) <= 0){
|
||||
echo "<b>ERROR:</b><br />";
|
||||
echo "The account name you entered does not exist.";
|
||||
echo "<br /><br /><input type=\"button\" value=\"Back\" onclick=\"history.go(-1)\">";
|
||||
@@ -59,10 +59,10 @@ EOT;
|
||||
}
|
||||
if(!$valid) break;
|
||||
$valid=TRUE;
|
||||
$acc = mysql_fetch_array($accountCheck);
|
||||
$acc = mysqli_fetch_array($accountCheck);
|
||||
|
||||
$plusCheck = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$pluss = mysql_fetch_array($plusCheck);
|
||||
$plusCheck = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$pluss = mysqli_fetch_array($plusCheck);
|
||||
|
||||
switch($reward){
|
||||
case 'p_plus':
|
||||
@@ -101,19 +101,19 @@ echo' Please select the option you wish to activate or extend.<br>';
|
||||
|
||||
|
||||
|
||||
if(mysql_num_rows($plusCheck) > 0){
|
||||
if(mysqli_num_rows($plusCheck) > 0){
|
||||
if($time > $pluss[$key] ){
|
||||
$editplus = mysql_query("UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` + ('".$time."'+'".$plusTime."'), `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$editplus = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` + ('".$time."'+'".$plusTime."'), `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
echo "<META HTTP-EQUIV=Refresh CONTENT=\"2; {$url}\" ><br /><br /><div align=center><font color=green size=4><b> Your Status has been updated!</b></font></div>";
|
||||
}else
|
||||
if($time < $pluss[$key]){
|
||||
$editplus = mysql_query("UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` +'".$plusTime."', `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$editplus = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` +'".$plusTime."', `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
echo "<META HTTP-EQUIV=Refresh CONTENT=\"2; {$url}\" ><br /><br /><div align=center><font color=green size=4><b> Your Status has been updated!</b></font></div>";
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
$insertplus = mysql_query("INSERT INTO ".TB_PREFIX."users (`username`,`{$key}`, `gold`) VALUES ('".$session->username."', ('".$time."'+'".$plusTime."'),`gold` - {$gldz})") or die(mysql_error());
|
||||
$insertplus = mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."users (`username`,`{$key}`, `gold`) VALUES ('".$session->username."', ('".$time."'+'".$plusTime."'),`gold` - {$gldz})") or die(mysqli_error());
|
||||
echo "<META HTTP-EQUIV=Refresh CONTENT=\"3; {$url})\" ><br /><br /><div align=center><font color=green size=4><b> Your Status has been updated!</b></font></div>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,22 +25,22 @@ if($_POST) {
|
||||
foreach($_POST as $key => $value) {
|
||||
if(substr($key, 0, 2) == 'nr') {
|
||||
$i = substr($key, 2);
|
||||
$links[$i]['nr'] = mysql_real_escape_string($value);
|
||||
$links[$i]['nr'] = mysqli_real_escape_string($GLOBALS['link'],$value);
|
||||
}
|
||||
|
||||
if(substr($key, 0, 2) == 'id') {
|
||||
$i = substr($key, 2);
|
||||
$links[$i]['id'] = mysql_real_escape_string($value);
|
||||
$links[$i]['id'] = mysqli_real_escape_string($GLOBALS['link'],$value);
|
||||
}
|
||||
|
||||
if(substr($key, 0, 8) == 'linkname') {
|
||||
$i = substr($key, 8);
|
||||
$links[$i]['linkname'] = mysql_real_escape_string($value);
|
||||
$links[$i]['linkname'] = mysqli_real_escape_string($GLOBALS['link'],$value);
|
||||
}
|
||||
|
||||
if(substr($key, 0, 8) == 'linkziel') {
|
||||
$i = substr($key, 8);
|
||||
$links[$i]['linkziel'] = mysql_real_escape_string($value);
|
||||
$links[$i]['linkziel'] = mysqli_real_escape_string($GLOBALS['link'],$value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,27 +52,27 @@ if($_POST) {
|
||||
// Add new link
|
||||
$userid = $session->uid;
|
||||
if($session->access!=BANNED){
|
||||
$query = mysql_query('INSERT INTO `' . TB_PREFIX . 'links` (`userid`, `name`, `url`, `pos`) VALUES (' . $userid . ', \'' . $link['linkname'] . '\', \'' . $link['linkziel'] . '\', ' . $link['nr'] . ')');
|
||||
$query = mysqli_query($GLOBALS['link'],'INSERT INTO `' . TB_PREFIX . 'links` (`userid`, `name`, `url`, `pos`) VALUES (' . $userid . ', \'' . $link['linkname'] . '\', \'' . $link['linkziel'] . '\', ' . $link['nr'] . ')');
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
}
|
||||
} elseif(trim($link['nr']) != '' AND trim($link['linkname']) != '' AND trim($link['linkziel']) != '' AND trim($link['id']) != '') {
|
||||
// Update link
|
||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
|
||||
$data = mysql_fetch_assoc($query);
|
||||
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
|
||||
$data = mysqli_fetch_assoc($query);
|
||||
|
||||
// May the user update this entry?
|
||||
if($data['userid'] == $session->uid) {
|
||||
$query2 = mysql_query('UPDATE `' . TB_PREFIX . 'links` SET `name` = \'' . $link['linkname'] . '\', `url` = \'' . $link['linkziel'] . '\', `pos` = ' . $link['nr'] . ' WHERE `id` = ' . $link['id']);
|
||||
$query2 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'links` SET `name` = \'' . $link['linkname'] . '\', `url` = \'' . $link['linkziel'] . '\', `pos` = ' . $link['nr'] . ' WHERE `id` = ' . $link['id']);
|
||||
}
|
||||
} elseif(trim($link['nr']) == '' AND trim($link['linkname']) == '' AND trim($link['linkziel']) == '' AND trim($link['id']) != '') {
|
||||
// Delete entry
|
||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
|
||||
$data = mysql_fetch_assoc($query);
|
||||
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
|
||||
$data = mysqli_fetch_assoc($query);
|
||||
|
||||
// May the user delete this entry?
|
||||
if($data['userid'] == $session->uid) {
|
||||
$query2 = mysql_query('DELETE FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
|
||||
$query2 = mysqli_query($GLOBALS['link'],'DELETE FROM `' . TB_PREFIX . 'links` WHERE `id` = ' . $link['id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,9 +82,9 @@ if($_POST) {
|
||||
|
||||
|
||||
// Fetch all links
|
||||
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'links` WHERE `userid` = ' . $session->uid . ' ORDER BY `pos` ASC') or die(mysql_error());
|
||||
$query = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `userid` = ' . $session->uid . ' ORDER BY `pos` ASC') or die(mysqli_error());
|
||||
$links = array();
|
||||
while($data = mysql_fetch_assoc($query)) {
|
||||
while($data = mysqli_fetch_assoc($query)) {
|
||||
$links[] = $data;
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -1,21 +1,12 @@
|
||||
<?php
|
||||
$place = $place1 = $place2 = $place3 = "?";
|
||||
$db_host=SQL_SERVER; $db_user=SQL_USER; $db_pass=SQL_PASS; $db_name=SQL_DB;
|
||||
$place = $place1 = $place2 = $place3 = "?";
|
||||
|
||||
$con = mysql_connect($db_host, $db_user, $db_pass);
|
||||
if (!$con)
|
||||
{
|
||||
die('Could not connect: ' . mysql_error());
|
||||
}
|
||||
|
||||
for($i=1;$i<=0;$i++) {
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
|
||||
mysql_select_db($db_name, $con);
|
||||
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY ap DESC, id DESC Limit 1");
|
||||
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY ap DESC, id DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -39,7 +30,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result))
|
||||
while($row = mysqli_fetch_array($result))
|
||||
{
|
||||
if($row['id']==$session->alliance) {
|
||||
$place = $i;
|
||||
@@ -56,7 +47,7 @@
|
||||
<td colspan="3" class="empty"></td>
|
||||
</tr>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result2))
|
||||
while($row = mysqli_fetch_array($result2))
|
||||
{
|
||||
if($row['id'] == $session->alliance) {
|
||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||
@@ -75,8 +66,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY dp DESC Limit 1");
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY dp DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="top10_defs" class="top10 row_table_data">
|
||||
<thead>
|
||||
@@ -93,7 +84,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result))
|
||||
while($row = mysqli_fetch_array($result))
|
||||
{
|
||||
if($row['id']==$session->alliance) {
|
||||
$place1 = $i;
|
||||
@@ -111,7 +102,7 @@
|
||||
<td colspan="3" class="empty"></td>
|
||||
</tr>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result2))
|
||||
while($row = mysqli_fetch_array($result2))
|
||||
{
|
||||
if($row['id'] == $session->alliance) {
|
||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||
@@ -129,8 +120,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY clp DESC Limit 1");
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY clp DESC Limit 1");
|
||||
?>
|
||||
<div class="clear"></div>
|
||||
<table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
|
||||
@@ -148,7 +139,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result))
|
||||
while($row = mysqli_fetch_array($result))
|
||||
{
|
||||
if($row['id']==$session->alliance) {
|
||||
$place2 = $i;
|
||||
@@ -165,7 +156,7 @@
|
||||
<td colspan="3" class="empty"></td>
|
||||
</tr>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result2))
|
||||
while($row = mysqli_fetch_array($result2))
|
||||
{
|
||||
if($row['id'] == $session->alliance) {
|
||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||
@@ -182,8 +173,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY RR DESC Limit 1");
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY RR DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">
|
||||
<thead>
|
||||
@@ -200,7 +191,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result))
|
||||
while($row = mysqli_fetch_array($result))
|
||||
{
|
||||
if($row['RR'] >= 0) {
|
||||
if($row['id']==$session->alliance) {
|
||||
@@ -219,7 +210,7 @@
|
||||
<td colspan="3" class="empty"></td>
|
||||
</tr>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result2))
|
||||
while($row = mysqli_fetch_array($result2))
|
||||
{
|
||||
if($row['id'] == $session->alliance) {
|
||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||
@@ -230,7 +221,7 @@
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
mysql_close($con);
|
||||
mysqli_close($con);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
| Copyright: TravianX Project All rights reserved |
|
||||
\** --------------------------------------------------- **/
|
||||
|
||||
$tribe1 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 1");
|
||||
$tribe2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 2");
|
||||
$tribe3 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 3");
|
||||
$tribes = array(mysql_num_rows($tribe1), mysql_num_rows($tribe2), mysql_num_rows($tribe3));
|
||||
$users = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5")); ?>
|
||||
$tribe1 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 1");
|
||||
$tribe2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 2");
|
||||
$tribe3 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 3");
|
||||
$tribes = array(mysqli_num_rows($tribe1), mysqli_num_rows($tribe2), mysqli_num_rows($tribe3));
|
||||
$users = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5")); ?>
|
||||
|
||||
<table cellpadding="1" cellspacing="1" id="world_player" class="world">
|
||||
<thead>
|
||||
@@ -34,7 +34,7 @@
|
||||
<th>Active players</th>
|
||||
|
||||
<td><?php
|
||||
$active = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (3600*24) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
$active = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (3600*24) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
echo $active; ?></td>
|
||||
</tr>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<th>Players online</th>
|
||||
|
||||
<td><?php
|
||||
$online = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
$online = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
echo $online; ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -1,21 +1,13 @@
|
||||
<?php
|
||||
$place = $place1 = $place2 = $place3 = "?";
|
||||
//$db_host=SQL_SERVER; $db_user=SQL_USER; $db_pass=SQL_PASS; $db_name=SQL_DB;
|
||||
|
||||
//$con = mysql_connect($db_host, $db_user, $db_pass);
|
||||
//if (!$con)
|
||||
// {
|
||||
// die('Could not connect: ' . mysql_error());
|
||||
// }
|
||||
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
|
||||
//mysql_select_db($db_name, $con);
|
||||
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY ap DESC, id DESC Limit 1");
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY ap DESC, id DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -39,7 +31,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result))
|
||||
while($row = mysqli_fetch_array($result))
|
||||
{
|
||||
if($row['id']==$session->uid) {
|
||||
if($row['id']==$session->uid) {
|
||||
@@ -56,7 +48,7 @@
|
||||
<td colspan="3" class="empty"></td>
|
||||
</tr>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result2))
|
||||
while($row = mysqli_fetch_array($result2))
|
||||
{
|
||||
if($row['id'] == $session->uid) {
|
||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||
@@ -75,8 +67,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY dp DESC Limit 1");
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY dp DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="top10_defs" class="top10 row_table_data">
|
||||
<thead>
|
||||
@@ -93,7 +85,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result))
|
||||
while($row = mysqli_fetch_array($result))
|
||||
{
|
||||
if($row['id']==$session->uid) {
|
||||
$place1 = $i;
|
||||
@@ -111,7 +103,7 @@
|
||||
<td colspan="3" class="empty"></td>
|
||||
</tr>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result2))
|
||||
while($row = mysqli_fetch_array($result2))
|
||||
{
|
||||
if($row['id'] == $session->uid) {
|
||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||
@@ -129,8 +121,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY clp DESC Limit 1");
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY clp DESC Limit 1");
|
||||
?>
|
||||
<div class="clear"></div>
|
||||
<table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
|
||||
@@ -148,7 +140,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result))
|
||||
while($row = mysqli_fetch_array($result))
|
||||
{
|
||||
if($row['id']==$session->uid) {
|
||||
$place2 = $i;
|
||||
@@ -165,7 +157,7 @@
|
||||
<td colspan="3" class="empty"></td>
|
||||
</tr>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result2))
|
||||
while($row = mysqli_fetch_array($result2))
|
||||
{
|
||||
if($row['id'] == $session->uid) {
|
||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||
@@ -181,8 +173,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY RR DESC Limit 1");
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY RR DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">
|
||||
<thead>
|
||||
@@ -199,7 +191,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result))
|
||||
while($row = mysqli_fetch_array($result))
|
||||
{
|
||||
if($row['RR'] >= 0) {
|
||||
if($row['id']==$session->uid) {
|
||||
@@ -218,7 +210,7 @@
|
||||
<td colspan="3" class="empty"></td>
|
||||
</tr>
|
||||
<?php
|
||||
while($row = mysql_fetch_array($result2))
|
||||
while($row = mysqli_fetch_array($result2))
|
||||
{
|
||||
if($row['id']==$session->uid) {
|
||||
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
|
||||
@@ -229,7 +221,7 @@
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
// mysql_close($con);
|
||||
// mysqli_close($con);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (WW == True)
|
||||
{
|
||||
$result = mysql_query("select " . TB_PREFIX . "users.id, " . TB_PREFIX . "users.username," . TB_PREFIX . "users.alliance, " . TB_PREFIX . "fdata.wwname, " . TB_PREFIX . "fdata.f99, " . TB_PREFIX . "vdata.name, " . TB_PREFIX . "fdata.vref
|
||||
$result = mysqli_query($GLOBALS['link'],"select " . TB_PREFIX . "users.id, " . TB_PREFIX . "users.username," . TB_PREFIX . "users.alliance, " . TB_PREFIX . "fdata.wwname, " . TB_PREFIX . "fdata.f99, " . TB_PREFIX . "vdata.name, " . TB_PREFIX . "fdata.vref
|
||||
FROM " . TB_PREFIX . "users
|
||||
INNER JOIN " . TB_PREFIX . "vdata ON " . TB_PREFIX . "users.id = " . TB_PREFIX . "vdata.owner
|
||||
INNER JOIN " . TB_PREFIX . "fdata ON " . TB_PREFIX . "fdata.vref = " . TB_PREFIX . "vdata.wref
|
||||
@@ -24,11 +24,11 @@ if (WW == True)
|
||||
<tbody>
|
||||
<?php
|
||||
$cont = 1;
|
||||
while ($row = mysql_fetch_array($result))
|
||||
while ($row = mysqli_fetch_array($result))
|
||||
{
|
||||
$ally = $database->getAlliance($row[alliance]);
|
||||
$query = @mysql_query('SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vref'] . ' ORDER BY `attack_time` ASC LIMIT 1');
|
||||
$row2 = @mysql_fetch_assoc($query);
|
||||
$query = @mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vref'] . ' ORDER BY `attack_time` ASC LIMIT 1');
|
||||
$row2 = @mysqli_fetch_assoc($query);
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $cont; $cont++; ?>.</td>
|
||||
|
||||
@@ -363,8 +363,8 @@ $end = ($tribe*10);
|
||||
{
|
||||
//$uid
|
||||
$q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = $uid";
|
||||
$result = mysql_query($q);
|
||||
$hero_f=mysql_fetch_array($result);
|
||||
$result = mysqli_query($GLOBALS['link'],$q);
|
||||
$hero_f=mysqli_fetch_array($result);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = ${'u'.$hero_unit}['speed'];
|
||||
}
|
||||
|
||||
@@ -138,8 +138,8 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
}
|
||||
if ($enforce['hero']>0){
|
||||
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
||||
$resulth = mysql_query($qh);
|
||||
$hero_f=mysql_fetch_array($resulth);
|
||||
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||
$hero_f=mysqli_fetch_array($resulth);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
}
|
||||
|
||||
@@ -139,8 +139,8 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
}
|
||||
if ($enforce['hero']>0){
|
||||
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
||||
$resulth = mysql_query($qh);
|
||||
$hero_f=mysql_fetch_array($resulth);
|
||||
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||
$hero_f=mysqli_fetch_array($resulth);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
}
|
||||
|
||||
@@ -138,8 +138,8 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
}
|
||||
if ($enforce['hero']>0){
|
||||
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
||||
$resulth = mysql_query($qh);
|
||||
$hero_f=mysql_fetch_array($resulth);
|
||||
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||
$hero_f=mysqli_fetch_array($resulth);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
}
|
||||
|
||||
@@ -139,8 +139,8 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
}
|
||||
if ($enforce['hero']>0){
|
||||
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
||||
$resulth = mysql_query($qh);
|
||||
$hero_f=mysql_fetch_array($resulth);
|
||||
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||
$hero_f=mysqli_fetch_array($resulth);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
}
|
||||
|
||||
@@ -138,8 +138,8 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
}
|
||||
if ($enforce['hero']>0){
|
||||
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$to['owner']."";
|
||||
$resulth = mysql_query($qh);
|
||||
$hero_f=mysql_fetch_array($resulth);
|
||||
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||
$hero_f=mysqli_fetch_array($resulth);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
$sql = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$lid." order by id asc";
|
||||
$array = $database->query_return($sql);
|
||||
foreach($array as $row){
|
||||
$sql1 = mysql_fetch_array(mysql_query("SELECT * FROM ".TB_PREFIX."units WHERE vref = ".$getFLData['wref']));
|
||||
$sql1 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."units WHERE vref = ".$getFLData['wref']));
|
||||
$sid = $row['id'];
|
||||
$wref = $row['towref'];
|
||||
$t1 = $row['t1'];$t2 = $row['t2'];$t3 = $row['t3'];$t4 = $row['t4'];$t5 = $row['t5'];
|
||||
|
||||
@@ -8,9 +8,9 @@ if(isset($_GET['t'])==99 && isset($_POST['action'])=='addList' && $_POST['did']!
|
||||
header("Location: build.php?gid=16&t=99&action=addList");
|
||||
}
|
||||
|
||||
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY wref = $village->wid DESC");
|
||||
$query = mysql_num_rows($sql);
|
||||
while($row = mysql_fetch_array($sql)){
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY wref = $village->wid DESC");
|
||||
$query = mysqli_num_rows($sql);
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$lid = $row["id"];
|
||||
$lname = $row["name"];
|
||||
$lowner = $row["owner"];
|
||||
@@ -50,12 +50,12 @@ while($row = mysql_fetch_array($sql)){
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
$sql2 = mysql_query("SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $lid ORDER BY distance ASC");
|
||||
$query2 = mysql_num_rows($sql2);
|
||||
$sql2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $lid ORDER BY distance ASC");
|
||||
$query2 = mysqli_num_rows($sql2);
|
||||
if($query2 == 0) {
|
||||
echo '<td class="noData" colspan="7">There is not any raid list.</td>';
|
||||
}else{
|
||||
while($row = mysql_fetch_array($sql2)){
|
||||
while($row = mysqli_fetch_array($sql2)){
|
||||
$id= $row['id'];$lid = $row['lid'];$towref = $row['towref'];$x = $row['x'];$y = $row['y'];
|
||||
if($village->wid == $towref){
|
||||
$distance = '0';
|
||||
@@ -192,9 +192,9 @@ $vdata = $database->getVillage($towref);
|
||||
<?php
|
||||
$noticeClass = array("Scout Report","Won as attacker without losses","Won as attacker with losses","Lost as attacker with losses","Won as defender without losses","Won as defender with losses","Lost as defender with losses","Lost as defender without losses","Reinforcement arrived","","Wood Delivered","Clay Delivered","Iron Delivered","Crop Delivered","","Won as defender without losses","Won as defender with losses","Lost as defender with losses","Won scouting as attacker","Lost scouting as attacker","Won scouting as defender","Lost scouting as defender");
|
||||
$limits = "(ntype=1 or ntype=2 or ntype=3 or ntype=18 or ntype=19 or ntype=22)";
|
||||
$getnotice = mysql_query("SELECT * FROM ".TB_PREFIX."ndata WHERE $limits AND toWref = ".$towref." AND uid = ".$session->uid." ORDER BY time DESC Limit 1");
|
||||
if(mysql_num_rows($getnotice) > 0){
|
||||
while($row2 = mysql_fetch_array($getnotice)){
|
||||
$getnotice = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."ndata WHERE $limits AND toWref = ".$towref." AND uid = ".$session->uid." ORDER BY time DESC Limit 1");
|
||||
if(mysqli_num_rows($getnotice) > 0){
|
||||
while($row2 = mysqli_fetch_array($getnotice)){
|
||||
$dataarray = explode(",",$row2['data']);
|
||||
$type2 = $row2['ntype'];
|
||||
echo "<img src=\"img/x.gif\" class=\"iReport iReport".$row2['ntype']."\" title=\"".$noticeClass[$type2]."\"> ";
|
||||
@@ -313,10 +313,10 @@ if(!$database->getVilFarmlist($village->wid)){
|
||||
{
|
||||
Travian.Game.RaidList.setData({
|
||||
<?php
|
||||
$result = mysql_query('SELECT * FROM '.TB_PREFIX.'farmlist WHERE wref = '.$village->wid.'');
|
||||
$query1 = mysql_num_rows($result);
|
||||
$result = mysqli_query($GLOBALS['link'],'SELECT * FROM '.TB_PREFIX.'farmlist WHERE wref = '.$village->wid.'');
|
||||
$query1 = mysqli_num_rows($result);
|
||||
$NUM1 = 1;
|
||||
while($row = mysql_fetch_array($result)){
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$lid = $row['id'];
|
||||
|
||||
?>
|
||||
@@ -324,10 +324,10 @@ $lid = $row['id'];
|
||||
"troops":{"1":<?php echo $unit1; ?>,"2":<?php echo $unit2; ?>,"3":<?php echo $unit3; ?>,"4":<?php echo $unit4; ?>,"5":<?php echo $unit5; ?>,"6":<?php echo $unit6; ?>,"7":<?php echo $unit7; ?>,"8":<?php echo $unit8; ?>,"9":<?php echo $unit9; ?>,"10":<?php echo $unit10; ?>,"11":<?php echo $getUnit['hero']; ?>},
|
||||
"directions":{"village":"none","ew":"none","distance":"asc","troops":"none","lastRaid":"none"},
|
||||
"slots":{<?php
|
||||
$result3 = mysql_query('SELECT * FROM '.TB_PREFIX.'raidlist WHERE lid = '.$lid.'');
|
||||
$query2 = mysql_num_rows($result3);
|
||||
$result3 = mysqli_query($GLOBALS['link'],'SELECT * FROM '.TB_PREFIX.'raidlist WHERE lid = '.$lid.'');
|
||||
$query2 = mysqli_num_rows($result3);
|
||||
$NUM2 = 1;
|
||||
while($row3 = mysql_fetch_array($result3)){
|
||||
while($row3 = mysqli_fetch_array($result3)){
|
||||
$id = $row3['id'];
|
||||
$t1 = $row3['t1'];$t2 = $row3['t2'];$t3 = $row3['t3'];$t4 = $row3['t4'];$t5 = $row3['t5'];$t6 = $row3['t6'];$t7 = $row3['t7'];
|
||||
$t8 = $row3['t8'];$t9 = $row3['t9'];$t10 = $row3['t10'];
|
||||
|
||||
@@ -85,8 +85,8 @@ $vdata = $database->getVillage($Wref);
|
||||
<select name="lid">
|
||||
<?php
|
||||
|
||||
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
|
||||
while($row = mysql_fetch_array($sql)){
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$lid = $row["id"];
|
||||
$lname = $row["name"];
|
||||
$lowner = $row["owner"];
|
||||
@@ -123,7 +123,7 @@ $lvname = $database->getVillageField($row["wref"], 'name');
|
||||
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$_GET['lid']."";
|
||||
$arraywref = $database->query_return($getwref);
|
||||
echo '<option value="">Select village</option>';
|
||||
if(mysql_num_rows(mysql_query($getwref)) != 0){
|
||||
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],$getwref)) != 0){
|
||||
foreach($arraywref as $row){
|
||||
$towref = $row["towref"];
|
||||
$tocoor = $database->getCoor($towref);
|
||||
|
||||
@@ -92,8 +92,8 @@ $lid2 = $getlid['lid'];
|
||||
<td>
|
||||
<select onchange="getTargetsByLid();" id="lid" name="lid">
|
||||
<?php
|
||||
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
|
||||
while($row = mysql_fetch_array($sql)){
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."farmlist WHERE owner = $session->uid ORDER BY name ASC");
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$lid = $row["id"];
|
||||
$lname = $row["name"];
|
||||
$lowner = $row["owner"];
|
||||
@@ -129,7 +129,7 @@ $lvname = $database->getVillageField($row["wref"], 'name');
|
||||
$getwref = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = $lid2";
|
||||
$arraywref = $database->query_return($getwref);
|
||||
echo '<option value="">Select village</option>';
|
||||
if(mysql_num_rows(mysql_query($getwref)) != 0){
|
||||
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],$getwref)) != 0){
|
||||
foreach($arraywref as $row){
|
||||
$towref = $row["towref"];
|
||||
$tocoor = $database->getCoor($towref);
|
||||
|
||||
+3
-3
@@ -10,10 +10,10 @@
|
||||
#################################################################################
|
||||
|
||||
// Fetch all links
|
||||
$query = $database->getLinks($session->uid);
|
||||
if (mysql_num_rows($query) > 0){
|
||||
$query = $database->getLinks($session->uid);
|
||||
if (mysqli_num_rows($query) > 0){
|
||||
$links = array();
|
||||
while($data = mysql_fetch_assoc($query)) {
|
||||
while($data = mysqli_fetch_assoc($query)) {
|
||||
$links[] = $data;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
@@ -10,7 +10,7 @@
|
||||
#################################################################################
|
||||
|
||||
|
||||
$txt="";
|
||||
$txt="Testing system message";
|
||||
|
||||
//bbcode = html code
|
||||
$txt = preg_replace("/\[b\]/is",'<b>', $txt);
|
||||
|
||||
@@ -186,8 +186,8 @@ if(isset($_GET['o'])) {
|
||||
|
||||
if ($prisoner['t11']>0){
|
||||
$p_qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$p_owner."";
|
||||
$p_resulth = mysql_query($p_qh);
|
||||
$p_hero_f=mysql_fetch_array($p_resulth);
|
||||
$p_resulth = mysqli_query($GLOBALS['link'],$p_qh);
|
||||
$p_hero_f=mysqli_fetch_array($p_resulth);
|
||||
$p_hero_unit=$p_hero_f['unit'];
|
||||
$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'];
|
||||
if($prisoner['t11'] > 0){
|
||||
$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->deletePrisoners($prisoner['id']);
|
||||
|
||||
@@ -69,12 +69,12 @@ $automation->isWinner();
|
||||
<?php
|
||||
if ($amount == 199) {
|
||||
// Statement retrieve Gold Package A
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$goldnow = $golds['6'] + 60;
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds1 = mysql_fetch_array($MyGold);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$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>
|
||||
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -117,12 +117,12 @@ $golds1 = mysql_fetch_array($MyGold);
|
||||
}
|
||||
if ($amount == 499) {
|
||||
// Statement retrieve Gold Package B
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$goldnow = $golds['6'] + 120;
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds1 = mysql_fetch_array($MyGold);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$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>
|
||||
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -164,12 +164,12 @@ $golds1 = mysql_fetch_array($MyGold);
|
||||
}
|
||||
if ($amount == 999) {
|
||||
// Statement retrieve Gold Package C
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$goldnow = $golds['6'] + 360;
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds1 = mysql_fetch_array($MyGold);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$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>
|
||||
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -211,12 +211,12 @@ $golds1 = mysql_fetch_array($MyGold);
|
||||
}
|
||||
if ($amount == 1999) {
|
||||
// Statement retrieve Gold Package D
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$goldnow = $golds['6'] + 1000;
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds1 = mysql_fetch_array($MyGold);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$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>
|
||||
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -258,12 +258,12 @@ $golds1 = mysql_fetch_array($MyGold);
|
||||
}
|
||||
if ($amount == 4999) {
|
||||
// Statement retrieve Gold Package E
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$goldnow = $golds['6'] + 2000;
|
||||
mysql_query("UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysql_error());
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds1 = mysql_fetch_array($MyGold);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$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>
|
||||
<table class="plusFunctions" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -304,8 +304,8 @@ $golds1 = mysql_fetch_array($MyGold);
|
||||
}
|
||||
if ($amount == 0)
|
||||
{
|
||||
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
|
||||
$golds = mysql_fetch_array($MyGold);
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
?>
|
||||
|
||||
<p>Here you can see your current account statement.</p>
|
||||
|
||||
+4
-4
@@ -21,8 +21,8 @@ if(isset($_GET['s'])){
|
||||
|
||||
if(isset($_GET['fid'])){
|
||||
$fid = preg_replace("/[^0-9]/","",$_GET['fid']);
|
||||
$forum = mysql_query("SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".$fid."");
|
||||
$forum_type = mysql_fetch_array($forum);
|
||||
$forum = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".$fid."");
|
||||
$forum_type = mysqli_fetch_array($forum);
|
||||
if($forum_type['forum_name'] != "" && $forum_type['forum_area'] == 0){
|
||||
if($forum_type['alliance'] != $session->alliance){
|
||||
header("Location: ".$_SERVER['PHP_SELF']);
|
||||
@@ -30,9 +30,9 @@ if(isset($_GET['fid'])){
|
||||
}
|
||||
}else if(isset($_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)) {
|
||||
$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_area'] == 0){
|
||||
if($forum_type['alliance'] != $session->alliance){
|
||||
|
||||
@@ -237,16 +237,16 @@ $now=time();
|
||||
if(($now-$oldmovement[0]['starttime'])<90 && $oldmovement[0]['from'] == $village->wid){
|
||||
|
||||
$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'];
|
||||
$database->query($q);
|
||||
$end=$now+($now-$oldmovement[0]['starttime']);
|
||||
//echo "6,".$oldmovement[0]['to'].",".$oldmovement[0]['from'].",0,".$now.",".$end;
|
||||
$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;
|
||||
$q2 = "INSERT INTO " . TB_PREFIX . "send values ($newid,0,0,0,0,0)";
|
||||
$database->query($q2);
|
||||
|
||||
+19
-21
@@ -21,8 +21,6 @@
|
||||
include_once ("GameEngine/Session.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!
|
||||
@@ -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)";
|
||||
mysql_query($q);
|
||||
mysqli_query($GLOBALS['link'],$q);
|
||||
unset($q);
|
||||
$uid = $database->getUserField($username, 'id', 1);
|
||||
$arrayXY=array();
|
||||
@@ -159,26 +157,26 @@ if($_POST['password'] != ""){
|
||||
$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";
|
||||
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";
|
||||
mysql_query($q2) or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],$q2) or die(mysqli_error());
|
||||
if(SPEED > 3) {
|
||||
$speed = 5;
|
||||
} else {
|
||||
$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'] . "";
|
||||
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";
|
||||
mysql_query($q4) or die(mysql_error());
|
||||
mysqli_query($GLOBALS['link'],$q4) or die(mysqli_error());
|
||||
|
||||
/**
|
||||
* 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;
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "vdata WHERE capital = '1' and owner > '5'";
|
||||
$array = $database->query_return($q);
|
||||
@@ -202,22 +200,22 @@ if($_POST['password'] != ""){
|
||||
$database->addUnits($wid);
|
||||
$database->addTech($wid);
|
||||
$database->addABTech($wid);
|
||||
mysql_query("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 pop = 163 WHERE wref = $wid");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET name = '$village_name' WHERE wref = $wid");
|
||||
if(SPEED > 3) {
|
||||
$speed = 5;
|
||||
} else {
|
||||
$speed = SPEED;
|
||||
}
|
||||
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 . "");
|
||||
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 . "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 . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 10, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = $wid");
|
||||
} 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 . "");
|
||||
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 . "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 . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 20, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = $wid");
|
||||
} 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 . "");
|
||||
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 . "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 . "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);
|
||||
|
||||
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
|
||||
$result=mysql_query($query) or die (mysql_error());
|
||||
for ($i=0; $row=mysql_fetch_row($result); $i++) {
|
||||
$updateattquery = mysql_query("UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'")
|
||||
or die(mysql_error());
|
||||
$result=mysqli_query($GLOBALS['link'],$query) or die (mysqli_error());
|
||||
for ($i=0; $row=mysqli_fetch_row($result); $i++) {
|
||||
$updateattquery = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'")
|
||||
or die(mysqli_error());
|
||||
}
|
||||
|
||||
echo "Done";
|
||||
|
||||
+6
-6
@@ -126,9 +126,9 @@
|
||||
<?php
|
||||
|
||||
define('PREFIX', TB_PREFIX);
|
||||
$type15 = mysql_query("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");
|
||||
$type_both = mysql_query("SELECT id,x,y,occupied,fieldtype FROM ".PREFIX."wdata WHERE fieldtype = 1 OR fieldtype = 6");
|
||||
$type15 = mysqli_query($GLOBALS['link'],"SELECT id,x,y,occupied FROM ".PREFIX."wdata WHERE fieldtype = 6");
|
||||
$type9 = mysqli_query($GLOBALS['link'],"SELECT id,x,y,occupied FROM ".PREFIX."wdata WHERE fieldtype = 1");
|
||||
$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'])) {
|
||||
$coor['x'] = $_GET['x'];
|
||||
@@ -172,7 +172,7 @@
|
||||
|
||||
<?php
|
||||
|
||||
while($row = mysql_fetch_array($type15)) {
|
||||
while($row = mysqli_fetch_array($type15)) {
|
||||
$dist = getDistance($coor['x'], $coor['y'], $row['x'], $row['y']);
|
||||
|
||||
$rows[$dist] = $row;
|
||||
@@ -224,7 +224,7 @@
|
||||
<?php
|
||||
|
||||
unset($rows);
|
||||
while($row = mysql_fetch_array($type9)) {
|
||||
while($row = mysqli_fetch_array($type9)) {
|
||||
$dist = getDistance($coor['x'], $coor['y'], $row['x'], $row['y']);
|
||||
|
||||
$rows[$dist] = $row;
|
||||
@@ -277,7 +277,7 @@
|
||||
<?php
|
||||
|
||||
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']);
|
||||
|
||||
$rows[$dist] = $row;
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
include("GameEngine/Village.php");
|
||||
$start = $generator->pageLoadTimeStart();
|
||||
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'])) {
|
||||
$_SESSION['wid'] = $_GET['newdid'];
|
||||
$database->query("UPDATE ".TB_PREFIX."users SET village_select=".$_GET['newdid']." WHERE id=".$session->uid);
|
||||
header("Location: ".$_SERVER['PHP_SELF']);
|
||||
}else{
|
||||
$building->procBuild($_GET);
|
||||
} else {
|
||||
$building->procBuild($_GET);
|
||||
}
|
||||
?>
|
||||
<!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
|
||||
|
||||
$return=mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5");
|
||||
$users=(!empty($return))? mysql_num_rows($return):0;
|
||||
$return=mysqli_query($link,"SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5");
|
||||
$users=(!empty($return))? mysqli_num_rows($return):0;
|
||||
echo $users;
|
||||
?></td>
|
||||
</tr>
|
||||
@@ -139,8 +139,8 @@ include ("GameEngine/Lang/".LANG.".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");
|
||||
$active=(!empty($return))? mysql_num_rows($return):0;
|
||||
$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))? mysqli_num_rows($return):0;
|
||||
echo $active;
|
||||
|
||||
?></td>
|
||||
@@ -155,8 +155,8 @@ include ("GameEngine/Lang/".LANG.".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");
|
||||
$online=(!empty($return))? mysql_num_rows($return):0;
|
||||
$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))? mysqli_num_rows($return):0;
|
||||
echo $online;
|
||||
|
||||
?></td>
|
||||
|
||||
@@ -206,14 +206,6 @@ define("SQL_DB", "%SDB%");
|
||||
// ***** Database - Table Prefix
|
||||
define("TB_PREFIX", "%PREFIX%");
|
||||
|
||||
// ***** Database type
|
||||
// 0 = MYSQL
|
||||
// 1 = MYSQLi
|
||||
// default: 1
|
||||
define("DB_TYPE", %CONNECTT%);
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// **** EXTRA SETTINGS **** //
|
||||
////////////////////////////////////
|
||||
|
||||
@@ -17,39 +17,5 @@ class MYSQLi_DB {
|
||||
return mysqli_query($this->connection, $query);
|
||||
}
|
||||
};
|
||||
class MYSQL_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;
|
||||
}
|
||||
$database = new MYSQLi_DB;
|
||||
?>
|
||||
|
||||
@@ -6,12 +6,12 @@ $gameinstall = 1;
|
||||
include ("../../GameEngine/Admin/database.php");
|
||||
include ("../../GameEngine/Lang/" . LANG . ".php");
|
||||
|
||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
mysql_select_db(SQL_DB);
|
||||
mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
mysqli_select_db(SQL_DB);
|
||||
|
||||
if(isset($_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);
|
||||
$uid = 5;
|
||||
$status = $database->getVillageState($wid);
|
||||
|
||||
@@ -5,19 +5,11 @@
|
||||
$gameinstall = 1;
|
||||
include ("../../GameEngine/config.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->populateOasis();
|
||||
$database->populateOasisUnits2();
|
||||
|
||||
|
||||
|
||||
|
||||
header("Location: ../index.php?s=6");
|
||||
|
||||
?>
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php include("templates/script.tpl");
|
||||
|
||||
if(!isset($_GET['s'])) {
|
||||
$_GET['s']=0;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,6 @@ class Process {
|
||||
$text = preg_replace("'%SPASS%'", $_POST['spass'], $text);
|
||||
$text = preg_replace("'%SDB%'", $_POST['sdb'], $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("'%ANAME%'", $_POST['aname'], $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><span class="f9 c6">Beginners protection length:</span></td><td>
|
||||
<select name="beginner">
|
||||
<option value="0">No protection</option>
|
||||
<option value="7200">2 hours</option>
|
||||
<option value="10800">3 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">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">Type:</span></td><td><select name="connectt">
|
||||
<option value="0" selected="selected">MYSQL</option>
|
||||
<option value="1">MYSQLi</option>
|
||||
</select></td></tr>
|
||||
<td><span class="f9 c6">Type:</span></td><td>MYSQLi (MYSQL is deprecated)</td></tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
|
||||
+10
-12
@@ -12,9 +12,8 @@
|
||||
|
||||
include_once("GameEngine/Account.php");
|
||||
$max_per_pass = 1000;
|
||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
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 attemp!");
|
||||
|
||||
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 (@$_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'] = "[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'];
|
||||
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++) {
|
||||
if($i > 5){
|
||||
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
|
||||
{
|
||||
$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 ($_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
|
||||
{
|
||||
$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;
|
||||
}
|
||||
|
||||
@@ -257,5 +256,4 @@ if (isset($_GET['send']) && isset($_GET['from']))
|
||||
<?php include("Templates/footer.tpl"); ?>
|
||||
<div id="ce"></div>
|
||||
</body>
|
||||
</html>
|
||||
<?php mysql_close(); ?>
|
||||
</html>
|
||||
+1
-1
@@ -15,7 +15,7 @@ include("GameEngine/Village.php");
|
||||
$start = $generator->pageLoadTimeStart();
|
||||
$message->procMessage($_POST);
|
||||
if($_GET['t'] == 1){
|
||||
$automation->isWinner();
|
||||
$automation->isWinner();
|
||||
}
|
||||
if(isset($_GET['newdid'])) {
|
||||
$_SESSION['wid'] = $_GET['newdid'];
|
||||
|
||||
+31
-33
@@ -79,53 +79,51 @@ if(isset($_GET['newdid'])) {
|
||||
<?php
|
||||
if(isset($_GET['id'])) {
|
||||
switch($_GET['id']) {
|
||||
case 31:
|
||||
include("Templates/Ranking/player_attack.tpl");
|
||||
break;
|
||||
case 31:
|
||||
include("Templates/Ranking/player_attack.tpl");
|
||||
break;
|
||||
case 32:
|
||||
include("Templates/Ranking/player_defend.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/player_defend.tpl");
|
||||
break;
|
||||
case 7:
|
||||
include("Templates/Ranking/player_top10.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/player_top10.tpl");
|
||||
break;
|
||||
case 2:
|
||||
include("Templates/Ranking/villages.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/villages.tpl");
|
||||
break;
|
||||
case 4:
|
||||
include("Templates/Ranking/alliance.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/alliance.tpl");
|
||||
break;
|
||||
case 8:
|
||||
include("Templates/Ranking/heroes.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/heroes.tpl");
|
||||
break;
|
||||
case 11:
|
||||
include("Templates/Ranking/player_1.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/player_1.tpl");
|
||||
break;
|
||||
case 12:
|
||||
include("Templates/Ranking/player_2.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/player_2.tpl");
|
||||
break;
|
||||
case 13:
|
||||
include("Templates/Ranking/player_3.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/player_3.tpl");
|
||||
break;
|
||||
case 41:
|
||||
include("Templates/Ranking/alliance_attack.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/alliance_attack.tpl");
|
||||
break;
|
||||
case 42:
|
||||
include("Templates/Ranking/alliance_defend.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/alliance_defend.tpl");
|
||||
break;
|
||||
case 43:
|
||||
include("Templates/Ranking/ally_top10.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/ally_top10.tpl");
|
||||
break;
|
||||
case 0:
|
||||
include("Templates/Ranking/general.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/general.tpl");
|
||||
break;
|
||||
case 1:
|
||||
default:
|
||||
include("Templates/Ranking/overview.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/overview.tpl");
|
||||
break;
|
||||
case 99:
|
||||
default:
|
||||
include("Templates/Ranking/ww.tpl");
|
||||
break;
|
||||
include("Templates/Ranking/ww.tpl");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
+10
-13
@@ -11,16 +11,14 @@
|
||||
|
||||
include_once("GameEngine/Account.php");
|
||||
$max_per_pass = 1000;
|
||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
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 (mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users WHERE access = 9 AND id = ".$session->uid)) != '1') die("Hacking attempt!");
|
||||
|
||||
if(isset($_GET['del'])){
|
||||
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
|
||||
$result=mysql_query($query) or die (mysql_error());
|
||||
for ($i=0; $row=mysql_fetch_row($result); $i++) {
|
||||
$updateattquery = mysql_query("UPDATE ".TB_PREFIX."users SET ok = '0' WHERE id = '".$row[0]."'")
|
||||
or die(mysql_error());
|
||||
$result=mysqli_query($GLOBALS['link'],$query) or die (mysqli_error());
|
||||
for ($i=0; $row=mysqli_fetch_row($result); $i++) {
|
||||
$updateattquery = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET ok = '0' WHERE id = '".$row[0]."'")
|
||||
or die(mysqli_error());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,10 +45,10 @@ if (@isset($_POST['confirm']))
|
||||
fwrite($fh, $text);
|
||||
|
||||
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
|
||||
$result=mysql_query($query) or die (mysql_error());
|
||||
for ($i=0; $row=mysql_fetch_row($result); $i++) {
|
||||
$updateattquery = mysql_query("UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'")
|
||||
or die(mysql_error());
|
||||
$result=mysqli_query($GLOBALS['link'],$query) or die (mysqli_error());
|
||||
for ($i=0; $row=mysqli_fetch_row($result); $i++) {
|
||||
$updateattquery = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'")
|
||||
or die(mysqli_error());
|
||||
}
|
||||
$done = true;
|
||||
} else { die("<br/><br/><br/>wrong"); }
|
||||
@@ -184,5 +182,4 @@ System Message was sent
|
||||
<?php include("Templates/footer.tpl"); ?>
|
||||
<div id="ce"></div>
|
||||
</body>
|
||||
</html>
|
||||
<?php mysql_close(); ?>
|
||||
</html>
|
||||
@@ -202,7 +202,7 @@ function fd(url,gd,hd,id){
|
||||
switch(kd){
|
||||
case'application/json':
|
||||
if (jd.responseText.indexOf('[]') < 0) {
|
||||
gd((jd.responseText==''?null:eval('('+jd.responseText+')')));
|
||||
gd(jd.responseText==''?null:eval('('+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") . "
|
||||
ORDER BY totalpop DESC, totalvillages DESC, username ASC";
|
||||
|
||||
$result = (mysql_query($q));
|
||||
while($row = mysql_fetch_assoc($result))
|
||||
$result = (mysqli_query($GLOBALS['link'],$q));
|
||||
while($row = mysqli_fetch_assoc($result))
|
||||
{
|
||||
$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
|
||||
ORDER BY " . TB_PREFIX . "users.apall DESC, pop DESC, username ASC";
|
||||
|
||||
$result = mysql_query($q) or die(mysql_error());
|
||||
while($row = mysql_fetch_assoc($result))
|
||||
$result = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error());
|
||||
while($row = mysqli_fetch_assoc($result))
|
||||
{
|
||||
$attacker[] = $row;
|
||||
}
|
||||
@@ -105,8 +105,8 @@ $q = "
|
||||
FROM " . TB_PREFIX . "users
|
||||
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";
|
||||
$result = mysql_query($q) or die(mysql_error());
|
||||
while($row = mysql_fetch_assoc($result))
|
||||
$result = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error());
|
||||
while($row = mysqli_fetch_assoc($result))
|
||||
{
|
||||
$defender[] = $row;
|
||||
}
|
||||
@@ -120,29 +120,29 @@ $q = "
|
||||
}
|
||||
|
||||
## 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);
|
||||
|
||||
$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);
|
||||
|
||||
$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);
|
||||
|
||||
$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);
|
||||
|
||||
$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);
|
||||
|
||||
$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);
|
||||
|
||||
$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);
|
||||
|
||||
$sql = mysql_query("SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
|
||||
$winner = mysql_num_rows($sql);
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
|
||||
$winner = mysqli_num_rows($sql);
|
||||
|
||||
if($winner!=0){
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user