mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Some replacements
+Replaced all $GLOBALS['link'] with $database->dblink -Removed Templates/links.tpl from build.php (it's already in Templates/menu.tpl)
This commit is contained in:
@@ -158,7 +158,7 @@ class Account {
|
||||
{
|
||||
global $database;
|
||||
$q = "SELECT act, username, password, email, tribe, location FROM ".TB_PREFIX."activate where act = '".$database->escape($_POST['id'])."'";
|
||||
$result = mysqli_query($GLOBALS['link'],$q);
|
||||
$result = mysqli_query($database->dblink,$q);
|
||||
$dbarray = mysqli_fetch_array($result);
|
||||
if($dbarray['act'] == $_POST['id']) {
|
||||
$uid = $database->register($dbarray['username'],$dbarray['password'],$dbarray['email'],$dbarray['tribe'],"");
|
||||
@@ -186,7 +186,7 @@ class Account {
|
||||
private function Unreg() {
|
||||
global $database;
|
||||
$q = "SELECT password, username FROM ".TB_PREFIX."activate where id = ".(int) $_POST['id'];
|
||||
$result = mysqli_query($GLOBALS['link'],$q);
|
||||
$result = mysqli_query($database->dblink,$q);
|
||||
$dbarray = mysqli_fetch_array($result);
|
||||
if(password_verify($_POST['pw'], $dbarray['password'])) {
|
||||
$database->unreg($dbarray['username']);
|
||||
|
||||
+111
-108
@@ -99,8 +99,9 @@ class Automation {
|
||||
}
|
||||
|
||||
public function isWinner() {
|
||||
global $database;
|
||||
// check whether someone already built a level 100 Wonder of the World
|
||||
$q = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."fdata WHERE f99 = 100 and f99t = 40"), MYSQLI_ASSOC);
|
||||
$q = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."fdata WHERE f99 = 100 and f99t = 40"), MYSQLI_ASSOC);
|
||||
if($q['Total'] > 0)
|
||||
{
|
||||
header('Location: winner.php');
|
||||
@@ -178,7 +179,7 @@ class Automation {
|
||||
}
|
||||
$this->recountCP($vid);
|
||||
$q = "UPDATE ".TB_PREFIX."vdata set pop = $popTot where wref = $vid";
|
||||
mysqli_query($GLOBALS['link'],$q);
|
||||
mysqli_query($database->dblink,$q);
|
||||
$owner = $database->getVillageField($vid,"owner");
|
||||
$this->procClimbers($owner);
|
||||
|
||||
@@ -201,7 +202,7 @@ class Automation {
|
||||
}
|
||||
|
||||
$q = "UPDATE ".TB_PREFIX."vdata set cp = $popTot where wref = $vid";
|
||||
mysqli_query($GLOBALS['link'],$q);
|
||||
mysqli_query($database->dblink,$q);
|
||||
|
||||
return $popTot;
|
||||
|
||||
@@ -669,7 +670,7 @@ class Automation {
|
||||
|
||||
//now can't be more than one winner if ww to level 100 is build by 2 users or more on same time
|
||||
if ($indi['type'] == 40 && $indi['level'] == 100) {
|
||||
mysqli_query($GLOBALS['link'],"TRUNCATE ".TB_PREFIX."bdata");
|
||||
mysqli_query($database->dblink,"TRUNCATE ".TB_PREFIX."bdata");
|
||||
}
|
||||
|
||||
// TODO: find out what exactly these conditions are for
|
||||
@@ -875,7 +876,7 @@ class Automation {
|
||||
}
|
||||
|
||||
// get the capital village from the natars
|
||||
$query = mysqli_query($GLOBALS['link'],'SELECT `wref` FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = 3 and `capital` = 1 LIMIT 1') or die(mysqli_error($database->dblink));
|
||||
$query = mysqli_query($database->dblink,'SELECT `wref` FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = 3 and `capital` = 1 LIMIT 1') or die(mysqli_error($database->dblink));
|
||||
$row = mysqli_fetch_assoc($query);
|
||||
|
||||
// start the attacks
|
||||
@@ -883,8 +884,8 @@ class Automation {
|
||||
|
||||
// -.-
|
||||
$vid = (int) $vid;
|
||||
mysqli_query($GLOBALS['link'],'INSERT INTO `' . TB_PREFIX . 'ww_attacks` (`vid`, `attack_time`) VALUES (' . $vid . ', ' . $endtime . ')');
|
||||
mysqli_query($GLOBALS['link'],'INSERT INTO `' . TB_PREFIX . 'ww_attacks` (`vid`, `attack_time`) VALUES (' . $vid . ', ' . ($endtime + 1) . ')');
|
||||
mysqli_query($database->dblink,'INSERT INTO `' . TB_PREFIX . 'ww_attacks` (`vid`, `attack_time`) VALUES (' . $vid . ', ' . $endtime . ')');
|
||||
mysqli_query($database->dblink,'INSERT INTO `' . TB_PREFIX . 'ww_attacks` (`vid`, `attack_time`) VALUES (' . $vid . ', ' . ($endtime + 1) . ')');
|
||||
|
||||
// wave 1
|
||||
$ref = $database->addAttack($row['wref'], 0, $units[0][0], $units[0][1], 0, $units[0][2], $units[0][3], $units[0][4], $units[0][5], 0, 0, 0, 3, 0, 0, 0, 0, 20, 20, 0, 20, 20, 20, 20);
|
||||
@@ -896,11 +897,13 @@ class Automation {
|
||||
}
|
||||
|
||||
private function checkWWAttacks() {
|
||||
$query = mysqli_query($GLOBALS['link'],'SELECT vid, attack_time FROM `' . TB_PREFIX . 'ww_attacks` WHERE `attack_time` <= ' . time());
|
||||
global $database;
|
||||
|
||||
$query = mysqli_query($database->dblink,'SELECT vid, attack_time FROM `' . TB_PREFIX . 'ww_attacks` WHERE `attack_time` <= ' . time());
|
||||
while ($row = mysqli_fetch_assoc($query))
|
||||
{
|
||||
// delete the attack
|
||||
$query3 = mysqli_query($GLOBALS['link'],'DELETE FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . (int) $row['vid'] . ' AND `attack_time` = ' . (int) $row['attack_time']);
|
||||
$query3 = mysqli_query($database->dblink,'DELETE FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . (int) $row['vid'] . ' AND `attack_time` = ' . (int) $row['attack_time']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4618,7 +4621,7 @@ class Automation {
|
||||
|
||||
$villunits = $unitData[$hdata['wref']];
|
||||
if($hdata['trainingtime'] < time() && $hdata['inrevive'] == 1){
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".(int) $hdata['wref']."");
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".(int) $hdata['wref']."");
|
||||
|
||||
$columns[] = 'dead';
|
||||
$columnValues[] = 0;
|
||||
@@ -4637,7 +4640,7 @@ class Automation {
|
||||
}
|
||||
|
||||
if($hdata['trainingtime'] < time() && $hdata['intraining'] == 1){
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".(int) $hdata['wref']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".(int) $hdata['wref']);
|
||||
|
||||
$columns[] = 'dead';
|
||||
$columnValues[] = 0;
|
||||
@@ -4673,7 +4676,7 @@ class Automation {
|
||||
}
|
||||
|
||||
if (count($lastUpdateIDs)) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET lastupdate = $timeNow WHERE heroid IN(".implode(', ', $lastUpdateIDs).")");
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET lastupdate = $timeNow WHERE heroid IN(".implode(', ', $lastUpdateIDs).")");
|
||||
}
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/updatehero.txt")) {
|
||||
@@ -4685,11 +4688,11 @@ class Automation {
|
||||
|
||||
// by SlimShady95, aka Manuel Mannhardt < manuel_mannhardt@web.de > UPDATED FROM songeriux < haroldas.snei@gmail.com >
|
||||
private function updateStore() {
|
||||
global $bid10, $bid38, $bid11, $bid39;
|
||||
global $database, $bid10, $bid38, $bid11, $bid39;
|
||||
|
||||
$result = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'fdata`');
|
||||
$result = mysqli_query($database->dblink,'SELECT * FROM `' . TB_PREFIX . 'fdata`');
|
||||
|
||||
mysqli_begin_transaction($GLOBALS['link']);
|
||||
mysqli_begin_transaction($database->dblink);
|
||||
while ($row = mysqli_fetch_assoc($result))
|
||||
{
|
||||
$ress = $crop = 0;
|
||||
@@ -4733,9 +4736,9 @@ class Automation {
|
||||
$crop = STORAGE_BASE;
|
||||
}
|
||||
|
||||
mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'vdata` SET `maxstore` = ' . (int) $ress . ', `maxcrop` = ' . (int) $crop . ' WHERE `wref` = ' . (int) $row['vref']);
|
||||
mysqli_query($database->dblink,'UPDATE `' . TB_PREFIX . 'vdata` SET `maxstore` = ' . (int) $ress . ', `maxcrop` = ' . (int) $crop . ' WHERE `wref` = ' . (int) $row['vref']);
|
||||
}
|
||||
mysqli_commit($GLOBALS['link']);
|
||||
mysqli_commit($database->dblink);
|
||||
}
|
||||
|
||||
private function oasisResourcesProduce() {
|
||||
@@ -4771,7 +4774,7 @@ class Automation {
|
||||
|
||||
// continue...
|
||||
foreach($array as $user) {
|
||||
$numusers = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE id = ".(int) $user['invited']), MYSQLI_ASSOC);
|
||||
$numusers = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE id = ".(int) $user['invited']), MYSQLI_ASSOC);
|
||||
if($numusers['Total'] > 0){
|
||||
$varray = count($database->getProfileVillages($user['id']));
|
||||
if($varray > 1){
|
||||
@@ -5145,7 +5148,7 @@ class Automation {
|
||||
$climbers = $ranking->getRank();
|
||||
if(count($ranking->getRank()) > 0){
|
||||
$q = "SELECT week FROM ".TB_PREFIX."medal order by week DESC LIMIT 0, 1";
|
||||
$result = mysqli_query($GLOBALS['link'],$q);
|
||||
$result = mysqli_query($database->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$row=mysqli_fetch_assoc($result);
|
||||
$week=($row['week']+1);
|
||||
@@ -5194,7 +5197,7 @@ class Automation {
|
||||
$climbers = $ranking->getRank();
|
||||
if(count($ranking->getRank()) > 0){
|
||||
$q = "SELECT week FROM ".TB_PREFIX."medal order by week DESC LIMIT 0, 1";
|
||||
$result = mysqli_query($GLOBALS['link'],$q);
|
||||
$result = mysqli_query($database->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$row=mysqli_fetch_assoc($result);
|
||||
$week=($row['week']+1);
|
||||
@@ -5316,7 +5319,7 @@ class Automation {
|
||||
|
||||
public static function updateMax($leader) {
|
||||
global $bid18, $database;
|
||||
$q = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM " . TB_PREFIX . "alidata where leader = ". (int) $leader), MYSQLI_ASSOC);
|
||||
$q = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM " . TB_PREFIX . "alidata where leader = ". (int) $leader), MYSQLI_ASSOC);
|
||||
if ($q['Total'] > 0) {
|
||||
$villages = $database->getVillagesID2($leader);
|
||||
$max = 0;
|
||||
@@ -5349,13 +5352,13 @@ class Automation {
|
||||
global $database,$session;
|
||||
$herodata=$database->getHero($session->uid,1);
|
||||
if ($herodata[0]['dead']==1){
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET hero = 0 WHERE vref = ".(int) $session->villages[0]."");
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET hero = 0 WHERE vref = ".(int) $session->villages[0]."");
|
||||
}
|
||||
if($herodata[0]['trainingtime'] <= time()) {
|
||||
if($herodata[0]['trainingtime'] != 0) {
|
||||
if($herodata[0]['dead'] == 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET trainingtime = '0' WHERE heroid = " . $herodata[0]['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".(int) $session->villages[0]);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET trainingtime = '0' WHERE heroid = " . $herodata[0]['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".(int) $session->villages[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5372,7 +5375,7 @@ class Automation {
|
||||
//we may give away ribbons
|
||||
$giveMedal = false;
|
||||
$q = "SELECT lastgavemedal FROM ".TB_PREFIX."config";
|
||||
$result = mysqli_query($GLOBALS['link'],$q);
|
||||
$result = mysqli_query($database->dblink,$q);
|
||||
if($result) {
|
||||
$row=mysqli_fetch_assoc($result);
|
||||
$stime = strtotime(START_DATE)-strtotime(date('m/d/Y'))+strtotime(START_TIME);
|
||||
@@ -5391,7 +5394,7 @@ class Automation {
|
||||
//determine which week we are
|
||||
|
||||
$q = "SELECT week FROM ".TB_PREFIX."medal order by week DESC LIMIT 0, 1";
|
||||
$result = mysqli_query($GLOBALS['link'],$q);
|
||||
$result = mysqli_query($database->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$row=mysqli_fetch_assoc($result);
|
||||
$week=($row['week']+1);
|
||||
@@ -5402,7 +5405,7 @@ class Automation {
|
||||
//Do same for ally week
|
||||
|
||||
$q = "SELECT week FROM ".TB_PREFIX."allimedal order by week DESC LIMIT 0, 1";
|
||||
$result = mysqli_query($GLOBALS['link'],$q);
|
||||
$result = mysqli_query($database->dblink,$q);
|
||||
if(mysqli_num_rows($result)) {
|
||||
$row=mysqli_fetch_assoc($result);
|
||||
$allyweek=($row['week']+1);
|
||||
@@ -5412,67 +5415,67 @@ class Automation {
|
||||
|
||||
|
||||
//Attackers of the week
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id, ap FROM ".TB_PREFIX."users ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, ap FROM ".TB_PREFIX."users ORDER BY ap DESC, id DESC Limit 10");
|
||||
$i=0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$i++;
|
||||
$img="t2_".($i)."";
|
||||
$quer="insert into ".TB_PREFIX."medal (userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", 1, ".($i).", ".(int) $week.", '".$row['ap']."', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
//Defender of the week
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id, dp FROM ".TB_PREFIX."users ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, dp FROM ".TB_PREFIX."users ORDER BY dp DESC, id DESC Limit 10");
|
||||
$i=0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$i++;
|
||||
$img="t3_".($i)."";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '2', ".($i).", '".(int) $week."', '".$row['dp']."', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
//Climbers of the week
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id, Rc FROM ".TB_PREFIX."users ORDER BY Rc DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, Rc FROM ".TB_PREFIX."users ORDER BY Rc DESC, id DESC Limit 10");
|
||||
$i=0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$i++;
|
||||
$img="t1_".($i)."";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '3', ".($i).", '".(int) $week."', '".$row['Rc']."', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
//Rank climbers of the week
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id, clp FROM ".TB_PREFIX."users ORDER BY clp DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, clp FROM ".TB_PREFIX."users ORDER BY clp DESC Limit 10");
|
||||
$i=0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$i++;
|
||||
$img="t6_".($i)."";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '10', ".($i).", '".(int) $week."', '".$row['clp']."', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
//Robbers of the week
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id, RR FROM ".TB_PREFIX."users ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, RR FROM ".TB_PREFIX."users ORDER BY RR DESC, id DESC Limit 10");
|
||||
$i=0;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
$i++;
|
||||
$img="t4_".($i)."";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '4', ".($i).", '".(int) $week."', '".$row['RR']."', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
//Part of the bonus for top 10 attack + defense out
|
||||
//Top10 attackers
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY ap DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
//Top 10 defenders
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY dp DESC, id DESC Limit 10");
|
||||
while($row2 = mysqli_fetch_array($result2)){
|
||||
if($row['id']==$row2['id']){
|
||||
|
||||
$query3="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 5";
|
||||
$result3=mysqli_query($GLOBALS['link'],$query3);
|
||||
$result3=mysqli_query($database->dblink,$query3);
|
||||
$row3=mysqli_fetch_row($result3);
|
||||
|
||||
//Look what color the ribbon must have
|
||||
@@ -5490,7 +5493,7 @@ class Automation {
|
||||
break;
|
||||
}
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '5', '0', '".(int) $week."', '".$tekst."', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5498,11 +5501,11 @@ class Automation {
|
||||
|
||||
//you stand for 3rd / 5th / 10th time in the top 3 strikers
|
||||
//top10 attackers
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY ap DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 1 AND plaats<=3";
|
||||
$result1=mysqli_query($GLOBALS['link'],$query1);
|
||||
$result1=mysqli_query($database->dblink,$query1);
|
||||
$row1=mysqli_fetch_row($result1);
|
||||
|
||||
|
||||
@@ -5510,29 +5513,29 @@ class Automation {
|
||||
if($row1[0]=='3'){
|
||||
$img="t120_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '6', '0', '".(int) $week."', 'Three', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//4x at present as it is so 5th medal (silver)
|
||||
if($row1[0]=='5'){
|
||||
$img="t121_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '6', '0', '".(int) $week."', 'Five', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//9x at present as it is so 10th medal (gold)
|
||||
if($row1[0]=='10'){
|
||||
$img="t122_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '6', '0', '".(int) $week."', 'Ten', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
}
|
||||
//you stand for 3rd / 5th / 10th time in the top 10 attackers
|
||||
//top10 attackers
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY ap DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 1 AND plaats<=10";
|
||||
$result1=mysqli_query($GLOBALS['link'],$query1);
|
||||
$result1=mysqli_query($database->dblink,$query1);
|
||||
$row1=mysqli_fetch_row($result1);
|
||||
|
||||
|
||||
@@ -5540,29 +5543,29 @@ class Automation {
|
||||
if($row1[0]=='3'){
|
||||
$img="t130_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '12', '0', '".(int) $week."', 'Three', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//4x in gestaan, dit is 5e dus lintje (zilver)
|
||||
if($row1[0]=='5'){
|
||||
$img="t131_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '12', '0', '".(int) $week."', 'Five', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//9x at present as it is so 10th medal (gold)
|
||||
if($row1[0]=='10'){
|
||||
$img="t132_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '12', '0', '".(int) $week."', 'Ten', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
}
|
||||
//je staat voor 3e / 5e / 10e keer in de top 3 verdedigers
|
||||
//Pak de top10 verdedigers
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY dp DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 2 AND plaats<=3";
|
||||
$result1=mysqli_query($GLOBALS['link'],$query1);
|
||||
$result1=mysqli_query($database->dblink,$query1);
|
||||
$row1=mysqli_fetch_row($result1);
|
||||
|
||||
|
||||
@@ -5570,29 +5573,29 @@ class Automation {
|
||||
if($row1[0]=='3'){
|
||||
$img="t140_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '7', '0', '".(int) $week."', 'Three', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//4x in gestaan, dit is 5e dus lintje (zilver)
|
||||
if($row1[0]=='5'){
|
||||
$img="t141_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '7', '0', '".(int) $week."', 'Five', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//9x at present as it is so 10th medal (gold)
|
||||
if($row1[0]=='10'){
|
||||
$img="t142_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '7', '0', '".(int) $week."', 'Ten', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
}
|
||||
//je staat voor 3e / 5e / 10e keer in de top 3 verdedigers
|
||||
//Pak de top10 verdedigers
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY dp DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 2 AND plaats<=10";
|
||||
$result1=mysqli_query($GLOBALS['link'],$query1);
|
||||
$result1=mysqli_query($database->dblink,$query1);
|
||||
$row1=mysqli_fetch_row($result1);
|
||||
|
||||
|
||||
@@ -5600,30 +5603,30 @@ class Automation {
|
||||
if($row1[0]=='3'){
|
||||
$img="t150_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '13', '0', '".(int) $week."', 'Three', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//4x in gestaan, dit is 5e dus lintje (zilver)
|
||||
if($row1[0]=='5'){
|
||||
$img="t151_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '13', '0', '".(int) $week."', 'Five', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//9x at present as it is so 10th medal (gold)
|
||||
if($row1[0]=='10'){
|
||||
$img="t152_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '13', '0', '".(int) $week."', 'Ten', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//je staat voor 3e / 5e / 10e keer in de top 3 klimmers
|
||||
//Pak de top10 klimmers
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users ORDER BY Rc DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY Rc DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 3 AND plaats<=3";
|
||||
$result1=mysqli_query($GLOBALS['link'],$query1);
|
||||
$result1=mysqli_query($database->dblink,$query1);
|
||||
$row1=mysqli_fetch_row($result1);
|
||||
|
||||
|
||||
@@ -5631,28 +5634,28 @@ class Automation {
|
||||
if($row1[0]=='3'){
|
||||
$img="t100_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '8', '0', '".(int) $week."', 'Three', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//4x in gestaan, dit is 5e dus lintje (zilver)
|
||||
if($row1[0]=='5'){
|
||||
$img="t101_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '8', '0', '".(int) $week."', 'Five', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//9x at present as it is so 10th medal (gold)
|
||||
if($row1[0]=='10'){
|
||||
$img="t102_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '8', '0', '".(int) $week."', 'Ten', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
}
|
||||
//je staat voor 3e / 5e / 10e keer in de top 3 klimmers
|
||||
//Pak de top10 klimmers
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users ORDER BY Rc DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY Rc DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 3 AND plaats<=10";
|
||||
$result1=mysqli_query($GLOBALS['link'],$query1);
|
||||
$result1=mysqli_query($database->dblink,$query1);
|
||||
$row1=mysqli_fetch_row($result1);
|
||||
|
||||
|
||||
@@ -5660,29 +5663,29 @@ class Automation {
|
||||
if($row1[0]=='3'){
|
||||
$img="t110_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '14', '0', '".(int) $week."', 'Three', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//4x in gestaan, dit is 5e dus lintje (zilver)
|
||||
if($row1[0]=='5'){
|
||||
$img="t111_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '14', '0', '".(int) $week."', 'Five', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//9x at present as it is so 10th medal (gold)
|
||||
if($row1[0]=='10'){
|
||||
$img="t112_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '14', '0', '".(int) $week."', 'Ten', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
}
|
||||
|
||||
//je staat voor 3e / 5e / 10e keer in de top 3 klimmers
|
||||
//Pak de top3 rank climbers
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY clp DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 10 AND plaats<=3";
|
||||
$result1=mysqli_query($GLOBALS['link'],$query1);
|
||||
$result1=mysqli_query($database->dblink,$query1);
|
||||
$row1=mysqli_fetch_row($result1);
|
||||
|
||||
|
||||
@@ -5690,28 +5693,28 @@ class Automation {
|
||||
if($row1[0]=='3'){
|
||||
$img="t200_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '11', '0', '".(int) $week."', 'Three', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//4x in gestaan, dit is 5e dus lintje (zilver)
|
||||
if($row1[0]=='5'){
|
||||
$img="t201_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '11', '0', '".(int) $week."', 'Five', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//9x at present as it is so 10th medal (gold)
|
||||
if($row1[0]=='10'){
|
||||
$img="t202_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '11', '0', '".(int) $week."', 'Ten', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
}
|
||||
//je staat voor 3e / 5e / 10e keer in de top 10klimmers
|
||||
//Pak de top3 rank climbers
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY clp DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 10 AND plaats<=10";
|
||||
$result1=mysqli_query($GLOBALS['link'],$query1);
|
||||
$result1=mysqli_query($database->dblink,$query1);
|
||||
$row1=mysqli_fetch_row($result1);
|
||||
|
||||
|
||||
@@ -5719,29 +5722,29 @@ class Automation {
|
||||
if($row1[0]=='3'){
|
||||
$img="t210_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '16', '0', '".(int) $week."', 'Three', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//4x in gestaan, dit is 5e dus lintje (zilver)
|
||||
if($row1[0]=='5'){
|
||||
$img="t211_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '16', '0', '".(int) $week."', 'Five', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//9x at present as it is so 10th medal (gold)
|
||||
if($row1[0]=='10'){
|
||||
$img="t212_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '16', '0', '".(int) $week."', 'Ten', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
}
|
||||
|
||||
//je staat voor 3e / 5e / 10e keer in de top 10 overvallers
|
||||
//Pak de top10 overvallers
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY RR DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 4 AND plaats<=3";
|
||||
$result1=mysqli_query($GLOBALS['link'],$query1);
|
||||
$result1=mysqli_query($database->dblink,$query1);
|
||||
$row1=mysqli_fetch_row($result1);
|
||||
|
||||
|
||||
@@ -5749,28 +5752,28 @@ class Automation {
|
||||
if($row1[0]=='3'){
|
||||
$img="t160_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '9', '0', '".(int) $week."', 'Three', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//4x in gestaan, dit is 5e dus lintje (zilver)
|
||||
if($row1[0]=='5'){
|
||||
$img="t161_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '9', '0', '".(int) $week."', 'Five', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//9x at present as it is so 10th medal (gold)
|
||||
if($row1[0]=='10'){
|
||||
$img="t162_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '9', '0', '".(int) $week."', 'Ten', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
}
|
||||
//je staat voor 3e / 5e / 10e keer in de top 10 overvallers
|
||||
//Pak de top10 overvallers
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users ORDER BY RR DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
$query1="SELECT Count(*) FROM ".TB_PREFIX."medal WHERE userid=".(int) $row['id']." AND categorie = 4 AND plaats<=10";
|
||||
$result1=mysqli_query($GLOBALS['link'],$query1);
|
||||
$result1=mysqli_query($database->dblink,$query1);
|
||||
$row1=mysqli_fetch_row($result1);
|
||||
|
||||
|
||||
@@ -5778,78 +5781,78 @@ class Automation {
|
||||
if($row1[0]=='3'){
|
||||
$img="t170_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '15', '0', '".(int) $week."', 'Three', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//4x in gestaan, dit is 5e dus lintje (zilver)
|
||||
if($row1[0]=='5'){
|
||||
$img="t171_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '15', '0', '".(int) $week."', 'Five', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
//9x at present as it is so 10th medal (gold)
|
||||
if($row1[0]=='10'){
|
||||
$img="t172_1";
|
||||
$quer="insert into ".TB_PREFIX."medal(userid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '15', '0', '".(int) $week."', 'Ten', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
}
|
||||
|
||||
//Put all true dens to 0
|
||||
$query="SELECT id FROM ".TB_PREFIX."users ORDER BY id+0 DESC";
|
||||
$result=mysqli_query($GLOBALS['link'],$query);
|
||||
$result=mysqli_query($database->dblink,$query);
|
||||
$userIDs = [];
|
||||
for ($i=0; $row=mysqli_fetch_row($result); $i++){
|
||||
$userIDs[] = (int) $row[0];
|
||||
}
|
||||
|
||||
if (count($userIDs)) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET ap=0, dp=0,Rc=0,clp=0, RR=0 WHERE id IN(".implode(', ', $userIDs).")");
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users SET ap=0, dp=0,Rc=0,clp=0, RR=0 WHERE id IN(".implode(', ', $userIDs).")");
|
||||
}
|
||||
|
||||
//Start alliance Medals wooot
|
||||
|
||||
//Aanvallers v/d Week
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id, ap FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, ap FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
|
||||
$i=0; while($row = mysqli_fetch_array($result)){
|
||||
$i++; $img="a2_".($i)."";
|
||||
$quer="insert into ".TB_PREFIX."allimedal(allyid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '1', ".($i).", '".$allyweek."', '".$row['ap']."', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
//Verdediger v/d Week
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id, dp FROM ".TB_PREFIX."alidata ORDER BY dp DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, dp FROM ".TB_PREFIX."alidata ORDER BY dp DESC Limit 10");
|
||||
$i=0; while($row = mysqli_fetch_array($result)){
|
||||
$i++; $img="a3_".($i)."";
|
||||
$quer="insert into ".TB_PREFIX."allimedal(allyid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '2', ".($i).", '".$allyweek."', '".$row['dp']."', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
//Overvallers v/d Week
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id, RR FROM ".TB_PREFIX."alidata ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, RR FROM ".TB_PREFIX."alidata ORDER BY RR DESC, id DESC Limit 10");
|
||||
$i=0; while($row = mysqli_fetch_array($result)){
|
||||
$i++; $img="a4_".($i)."";
|
||||
$quer="insert into ".TB_PREFIX."allimedal(allyid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '4', ".($i).", '".$allyweek."', '".$row['RR']."', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
//Rank climbers of the week
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT id, clp FROM ".TB_PREFIX."alidata ORDER BY clp DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT id, clp FROM ".TB_PREFIX."alidata ORDER BY clp DESC Limit 10");
|
||||
$i=0; while($row = mysqli_fetch_array($result)){
|
||||
$i++; $img="a1_".($i)."";
|
||||
$quer="insert into ".TB_PREFIX."allimedal(allyid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '3', ".($i).", '".$allyweek."', '".$row['clp']."', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
|
||||
//Pak de top10 verdedigers
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."alidata ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."alidata ORDER BY dp DESC, id DESC Limit 10");
|
||||
while($row2 = mysqli_fetch_array($result2)){
|
||||
if($row['id']==$row2['id']){
|
||||
|
||||
$query3="SELECT Count(*) FROM ".TB_PREFIX."allimedal WHERE allyid=".(int) $row['id']." AND categorie = 5";
|
||||
$result3=mysqli_query($GLOBALS['link'],$query3);
|
||||
$result3=mysqli_query($database->dblink,$query3);
|
||||
$row3=mysqli_fetch_row($result3);
|
||||
|
||||
//Look what color the ribbon must have
|
||||
@@ -5867,14 +5870,14 @@ class Automation {
|
||||
break;
|
||||
}
|
||||
$quer="insert into ".TB_PREFIX."allimedal(allyid, categorie, plaats, week, points, img) values(".(int) $row['id'].", '5', '0', '".$allyweek."', '".$tekst."', '".$img."')";
|
||||
$resul=mysqli_query($GLOBALS['link'],$quer);
|
||||
$resul=mysqli_query($database->dblink,$quer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$query="SELECT id FROM ".TB_PREFIX."alidata ORDER BY id+0 DESC";
|
||||
$result=mysqli_query($GLOBALS['link'],$query);
|
||||
$result=mysqli_query($database->dblink,$query);
|
||||
|
||||
$aliIDs = [];
|
||||
for ($i=0; $row=mysqli_fetch_row($result); $i++){
|
||||
@@ -5882,7 +5885,7 @@ class Automation {
|
||||
}
|
||||
|
||||
if (count($aliIDs)) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."alidata SET ap=0, dp=0,RR=0,clp=0 WHERE id IN(".implode(', ', $aliIDs).")");
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."alidata SET ap=0, dp=0,RR=0,clp=0 WHERE id IN(".implode(', ', $aliIDs).")");
|
||||
}
|
||||
|
||||
$q = "UPDATE ".TB_PREFIX."config SET lastgavemedal=".$time;
|
||||
@@ -5931,7 +5934,7 @@ class Automation {
|
||||
$effect = rand(1,6);
|
||||
break;
|
||||
}
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."artefacts SET kind = ". (int) $kind. ", bad_effect = $bad_effect, effect2 = $effect, lastupdate = $time WHERE id = ".(int) $artefact['id']);
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."artefacts SET kind = ". (int) $kind. ", bad_effect = $bad_effect, effect2 = $effect, lastupdate = $time WHERE id = ".(int) $artefact['id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -687,7 +687,7 @@ class Battle {
|
||||
|
||||
if (isset($units['Att_unit']['hero']) && $units['Att_unit']['hero'] >0){
|
||||
|
||||
$_result=mysqli_query($GLOBALS['link'],"select heroid, health from " . TB_PREFIX . "hero where `dead`='0' and `heroid`=".(int) $atkhero['heroid']);
|
||||
$_result=mysqli_query($database->dblink,"select heroid, health from " . TB_PREFIX . "hero where `dead`='0' and `heroid`=".(int) $atkhero['heroid']);
|
||||
$fdb = mysqli_fetch_array($_result);
|
||||
$hero_id=(int) $fdb['heroid'];
|
||||
$hero_health=$fdb['health'];
|
||||
@@ -696,9 +696,9 @@ class Battle {
|
||||
if ($hero_health<=$damage_health or $damage_health>90){
|
||||
//hero die
|
||||
$result['casualties_attacker']['11'] = 1;
|
||||
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `dead` = 1, `health` = 0 where `heroid`=".(int) $hero_id);
|
||||
mysqli_query($database->dblink,"update " . TB_PREFIX . "hero set `dead` = 1, `health` = 0 where `heroid`=".(int) $hero_id);
|
||||
}else{
|
||||
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `health`=`health`-".(int) $damage_health." where `heroid`=".(int) $hero_id);
|
||||
mysqli_query($database->dblink,"update " . TB_PREFIX . "hero set `health`=`health`-".(int) $damage_health." where `heroid`=".(int) $hero_id);
|
||||
}
|
||||
}
|
||||
unset($_result,$fdb,$hero_id,$hero_health,$damage_health);
|
||||
@@ -706,7 +706,7 @@ class Battle {
|
||||
|
||||
if (isset($units['Def_unit']['hero']) && $units['Def_unit']['hero'] >0){
|
||||
|
||||
$_result=mysqli_query($GLOBALS['link'],"select heroid, health from " . TB_PREFIX . "hero where `dead`='0' and `heroid`=".(int) $defenderhero['heroid']);
|
||||
$_result=mysqli_query($database->dblink,"select heroid, health from " . TB_PREFIX . "hero where `dead`='0' and `heroid`=".(int) $defenderhero['heroid']);
|
||||
$fdb = mysqli_fetch_array($_result);
|
||||
$hero_id=(int) $fdb['heroid'];
|
||||
$hero_health=$fdb['health'];
|
||||
@@ -714,10 +714,10 @@ class Battle {
|
||||
if ($hero_health<=$damage_health or $damage_health>90){
|
||||
//hero die
|
||||
$result['deadherodef'] = 1;
|
||||
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `dead` = 1, `health` = 0 where `heroid`=".(int) $hero_id);
|
||||
mysqli_query($database->dblink,"update " . TB_PREFIX . "hero set `dead` = 1, `health` = 0 where `heroid`=".(int) $hero_id);
|
||||
}else{
|
||||
$result['deadherodef'] = 0;
|
||||
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `health`=`health`-".(int) $damage_health." where `heroid`=".(int) $hero_id);
|
||||
mysqli_query($database->dblink,"update " . TB_PREFIX . "hero set `health`=`health`-".(int) $damage_health." where `heroid`=".(int) $hero_id);
|
||||
}
|
||||
}
|
||||
unset($_result,$fdb,$hero_id,$hero_health,$damage_health);
|
||||
@@ -729,7 +729,7 @@ class Battle {
|
||||
if(!empty($heroarray)) { reset($heroarray); }
|
||||
$battleHeroesCache[$defenders['from']] = $this->getBattleHero($database->getVillageField($defenders['from'],"owner"));
|
||||
$heroarraydefender = $battleHeroesCache[$defenders['from']];
|
||||
$_result=mysqli_query($GLOBALS['link'],"select heroid, health from " . TB_PREFIX . "hero where `dead`='0' and `heroid`=".(int) $heroarraydefender['heroid']);
|
||||
$_result=mysqli_query($database->dblink,"select heroid, health from " . TB_PREFIX . "hero where `dead`='0' and `heroid`=".(int) $heroarraydefender['heroid']);
|
||||
$fdb = mysqli_fetch_array($_result);
|
||||
$hero_id=(int) $fdb['heroid'];
|
||||
$hero_health=$fdb['health'];
|
||||
@@ -737,10 +737,10 @@ class Battle {
|
||||
if ($hero_health<=$damage_health or $damage_health>90){
|
||||
//hero die
|
||||
$result['deadheroref'][$defenders['id']] = 1;
|
||||
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `dead` = 1, `health` = 0 where `heroid`=".(int) $hero_id);
|
||||
mysqli_query($database->dblink,"update " . TB_PREFIX . "hero set `dead` = 1, `health` = 0 where `heroid`=".(int) $hero_id);
|
||||
}else{
|
||||
$result['deadheroref'][$defenders['id']] = 0;
|
||||
mysqli_query($GLOBALS['link'],"update " . TB_PREFIX . "hero set `health`=`health`-".(int) $damage_health." where `heroid`=".(int) $hero_id);
|
||||
mysqli_query($database->dblink,"update " . TB_PREFIX . "hero set `health`=`health`-".(int) $damage_health." where `heroid`=".(int) $hero_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -363,7 +363,7 @@ if (!isset($SAJAX_INCLUDED)) {
|
||||
$alliance = $database->escape($session->alliance);
|
||||
$now = time();
|
||||
echo $q = "INSERT into ".TB_PREFIX."chat (id_user,name,alli,date,msg) values ($id_user,'$name','$alliance','$now','$msg')";
|
||||
mysqli_query($GLOBALS['link'],$q);
|
||||
mysqli_query($database->dblink,$q);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ if (!isset($SAJAX_INCLUDED)) {
|
||||
global $session,$database;
|
||||
|
||||
$alliance = $database->escape($session->alliance);
|
||||
$query = mysqli_query($GLOBALS['link'],"select id_user, name, date, msg from ".TB_PREFIX."chat where alli='$alliance' order by id desc limit 0,13");
|
||||
$query = mysqli_query($database->dblink,"select id_user, name, date, msg 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>";
|
||||
|
||||
@@ -244,7 +244,7 @@ class Message {
|
||||
|
||||
for($i = 1; $i <= 10; $i++) {
|
||||
if ( isset( $post[ 'n' . $i ] ) ) {
|
||||
$message1 = mysqli_query( $GLOBALS['link'], "SELECT target, owner FROM " . TB_PREFIX . "mdata where id = " . (int) $post[ 'n' . $i ] . "" );
|
||||
$message1 = mysqli_query( $database->dblink, "SELECT target, owner FROM " . TB_PREFIX . "mdata where id = " . (int) $post[ 'n' . $i ] . "" );
|
||||
$message = mysqli_fetch_array( $message1 );
|
||||
|
||||
if ( $message['target'] == $session->uid && $message['owner'] == $session->uid ) {
|
||||
@@ -407,16 +407,16 @@ class Message {
|
||||
// Vulnerability closed by Shadow
|
||||
|
||||
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".(time() - 60);
|
||||
$res = mysqli_fetch_array(mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink). " query ".$q), MYSQLI_ASSOC);
|
||||
$res = mysqli_fetch_array(mysqli_query($database->dblink,$q) or die(mysqli_error($database->dblink). " query ".$q), MYSQLI_ASSOC);
|
||||
$flood = $res['Total'];
|
||||
if($flood > 5)
|
||||
return; //flood
|
||||
|
||||
// Vulnerability closed by Shadow
|
||||
|
||||
$allmembersQ = mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users WHERE alliance='".$session->alliance."'");
|
||||
$allmembersQ = mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE alliance='".$session->alliance."'");
|
||||
$userally = $database->getUserField($session->uid,"alliance",0);
|
||||
$permission=mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT opt7 FROM ".TB_PREFIX."ali_permission WHERE uid='".$session->uid."'"));
|
||||
$permission=mysqli_fetch_array(mysqli_query($database->dblink,"SELECT opt7 FROM ".TB_PREFIX."ali_permission WHERE uid='".$session->uid."'"));
|
||||
|
||||
if(WORD_CENSOR) {
|
||||
$topic = $this->wordCensor($topic);
|
||||
@@ -505,7 +505,7 @@ class Message {
|
||||
|
||||
if ($security_check) {
|
||||
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."mdata WHERE owner='".$session->uid."' AND time > ".(time() - 60);
|
||||
$res = mysqli_fetch_array(mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink). " query ".$q), MYSQLI_ASSOC);
|
||||
$res = mysqli_fetch_array(mysqli_query($database->dblink,$q) or die(mysqli_error($database->dblink). " query ".$q), MYSQLI_ASSOC);
|
||||
$flood = $res['Total'];
|
||||
if($flood > 5)
|
||||
return; //flood
|
||||
|
||||
@@ -473,7 +473,7 @@ class Units {
|
||||
// If is a WW village you can target on WW , if is not a WW village catapults will target randomly.
|
||||
// Like it says : Exceptions are the WW which can always be targeted and the treasure chamber which can always be targeted, except with the unique artifact.
|
||||
// Fixed by Advocaite and Shadow
|
||||
$q = mysqli_fetch_array( mysqli_query( $GLOBALS['link'], "SELECT Count(*) as Total FROM " . TB_PREFIX . "fdata WHERE f99t = '40' AND vref = " . (int) $data['to_vid'] ), MYSQLI_ASSOC );
|
||||
$q = mysqli_fetch_array( mysqli_query( $database->dblink, "SELECT Count(*) as Total FROM " . TB_PREFIX . "fdata WHERE f99t = '40' AND vref = " . (int) $data['to_vid'] ), MYSQLI_ASSOC );
|
||||
$isThere = $q['Total'];
|
||||
if ( $isThere > 0 ) {
|
||||
$iswwvilla = 1;
|
||||
@@ -575,7 +575,7 @@ class Units {
|
||||
if ( $checkexist or $checkoexist ) {
|
||||
$database->addMovement( 3, $village->wid, $data['to_vid'], $reference, time(), ( $time + time() ) );
|
||||
if ( ( $database->hasBeginnerProtection( $village->wid ) == 1 ) && ( $checkexist ) ) {
|
||||
mysqli_query( $GLOBALS['link'], "UPDATE " . TB_PREFIX . "users SET protect = 0 WHERE id = " . (int) $session->uid );
|
||||
mysqli_query( $database->dblink, "UPDATE " . TB_PREFIX . "users SET protect = 0 WHERE id = " . (int) $session->uid );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ $query2 = "SELECT
|
||||
where ".TB_PREFIX."wdata.id IN ($maparray)
|
||||
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
||||
|
||||
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error($database->dblink));
|
||||
$result2 = mysqli_query($database->dblink,$query2) or die(mysqli_error($database->dblink));
|
||||
|
||||
$i=0;
|
||||
//Load coor array
|
||||
|
||||
@@ -99,7 +99,7 @@ $query2 = "SELECT
|
||||
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
||||
|
||||
//echo $query2;
|
||||
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error($database->dblink));
|
||||
$result2 = mysqli_query($database->dblink,$query2) or die(mysqli_error($database->dblink));
|
||||
|
||||
$i=0;
|
||||
$i2=0;
|
||||
|
||||
@@ -80,7 +80,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst']= 3;
|
||||
//Give Reward
|
||||
if(!$session->plus){
|
||||
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`='".$user_sanitized."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$user_sanitized."'") or die(mysqli_error($database->dblink));
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||
$plus+=86400;
|
||||
@@ -161,7 +161,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst']= 11;
|
||||
//Give Reward
|
||||
if(!$session->plus){
|
||||
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`='".$user_sanitized."'") or die(mysqli_error());
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$user_sanitized."'") or die(mysqli_error());
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||
$plus+=172800;
|
||||
@@ -348,7 +348,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst_time'] = time()+$skipp_time;
|
||||
//Give Reward
|
||||
if(!$session->plus){
|
||||
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`='".$user_sanitized."'") or die(mysqli_error());
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$user_sanitized."'") or die(mysqli_error());
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||
$plus+=86400;
|
||||
@@ -411,7 +411,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst']= 97;
|
||||
//Give Reward 20 gold + 2 days plus
|
||||
if(!$session->plus){
|
||||
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`='".$user_sanitized."'") or die(mysqli_error());
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$user_sanitized."'") or die(mysqli_error());
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||
$plus+=172800;
|
||||
|
||||
@@ -77,7 +77,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst']= 3;
|
||||
//Give Reward
|
||||
if(!$session->plus){
|
||||
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`='".$user_sanitized."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$user_sanitized."'") or die(mysqli_error($database->dblink));
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||
$plus+=86400;
|
||||
@@ -162,7 +162,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst']= 11;
|
||||
//Give Reward
|
||||
if(!$session->plus){
|
||||
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`='".$user_sanitized."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$user_sanitized."'") or die(mysqli_error($database->dblink));
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus','username');
|
||||
$plus+=172800;
|
||||
@@ -330,7 +330,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst_time'] = time()+$skipp_time;
|
||||
//Give Reward
|
||||
if(!$session->plus){
|
||||
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`='".$user_sanitized."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$user_sanitized."'") or die(mysqli_error($database->dblink));
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus',1);
|
||||
$plus+=86400;
|
||||
@@ -393,7 +393,7 @@ if (isset($qact)){
|
||||
$_SESSION['qst']= 97;
|
||||
//Give Reward 20 gold + 2 days plus
|
||||
if(!$session->plus){
|
||||
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`='".$user_sanitized."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$user_sanitized."'") or die(mysqli_error($database->dblink));
|
||||
} else {
|
||||
$plus=$database->getUserField($_SESSION['username'],'plus',1);
|
||||
$plus+=172800;
|
||||
|
||||
@@ -9,13 +9,13 @@ if($session->access!=BANNED){
|
||||
$displayarray = $database->getUserArray($session->uid,1);
|
||||
$forumcat = $database->ForumCat(htmlspecialchars($displayarray['alliance']));
|
||||
$ally = $session->alliance;
|
||||
$public = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 1"), MYSQLI_ASSOC);
|
||||
$public = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 1"), MYSQLI_ASSOC);
|
||||
$public1 = $public['Total'];
|
||||
$cofederation = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 2"), MYSQLI_ASSOC);
|
||||
$cofederation = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 2"), MYSQLI_ASSOC);
|
||||
$cofederation1 = $cofederation['Total'];
|
||||
$alliance = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 0"), MYSQLI_ASSOC);
|
||||
$alliance = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 0"), MYSQLI_ASSOC);
|
||||
$alliance1 = $alliance['Total'];
|
||||
$closed = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 3"), MYSQLI_ASSOC);
|
||||
$closed = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."forum_cat WHERE alliance = $ally AND forum_area = 3"), MYSQLI_ASSOC);
|
||||
$closed1 = $closed['Total'];
|
||||
if($public1 != 0){
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 = mysqli_query($GLOBALS['link'],"SELECT * FROM $prefix WHERE ally = ".(int) $session->alliance." AND $limit ORDER BY time DESC LIMIT 20");
|
||||
$sql = mysqli_query($database->dblink,"SELECT * FROM $prefix WHERE ally = ".(int) $session->alliance." AND $limit ORDER BY time DESC LIMIT 20");
|
||||
$query = mysqli_num_rows($sql);
|
||||
$outputList = '';
|
||||
$name = 1;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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 = mysqli_query($GLOBALS['link'],"SELECT * FROM $prefix WHERE ally = ".(int) $session->alliance." AND $limit ORDER BY time DESC LIMIT 20");
|
||||
$sql = mysqli_query($database->dblink,"SELECT * FROM $prefix WHERE ally = ".(int) $session->alliance." AND $limit ORDER BY time DESC LIMIT 20");
|
||||
$query = mysqli_num_rows($sql);
|
||||
$outputList = '';
|
||||
$name = 1;
|
||||
|
||||
@@ -28,7 +28,7 @@ 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 = mysqli_query($GLOBALS['link'],"SELECT * FROM $prefix WHERE ally = ".(int) $session->alliance." AND $limit ORDER BY time DESC LIMIT 20");
|
||||
$sql = mysqli_query($database->dblink,"SELECT * FROM $prefix WHERE ally = ".(int) $session->alliance." AND $limit ORDER BY time DESC LIMIT 20");
|
||||
$query = mysqli_num_rows($sql);
|
||||
$outputList = '';
|
||||
$name = 1;
|
||||
|
||||
+10
-10
@@ -5,33 +5,33 @@ if(time() - (!empty($_SESSION['time_p']) ? $_SESSION['time_p'] : 0) > 5) {
|
||||
}
|
||||
|
||||
if($_POST AND $_GET['action'] == 'change_capital') {
|
||||
$pass = mysqli_escape_string($GLOBALS['link'],$_POST['pass']);
|
||||
$query = mysqli_query($GLOBALS['link'],'SELECT password FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . (int) $session->uid);
|
||||
$pass = mysqli_escape_string($database->dblink,$_POST['pass']);
|
||||
$query = mysqli_query($database->dblink,'SELECT password FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . (int) $session->uid);
|
||||
$data = mysqli_fetch_assoc($query);
|
||||
if(password_verify($pass, $data['password'])) {
|
||||
$query1 = mysqli_query($GLOBALS['link'],'SELECT wref FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' .(int) $session->uid . ' AND `capital` = 1');
|
||||
$query1 = mysqli_query($database->dblink,'SELECT wref FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' .(int) $session->uid . ' AND `capital` = 1');
|
||||
$data1 = mysqli_fetch_assoc($query1);
|
||||
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'fdata` WHERE `vref` = ' . (int) $data1['wref']);
|
||||
$query2 = mysqli_query($database->dblink,'SELECT * FROM `' . TB_PREFIX . 'fdata` WHERE `vref` = ' . (int) $data1['wref']);
|
||||
$data2 = mysqli_fetch_assoc($query2);
|
||||
if($data2['vref'] != $village->wid) {
|
||||
for($i = 1; $i<=18; ++$i) {
|
||||
if($data2['f' . $i] > 10) {
|
||||
$query2 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . '` = 10 WHERE `vref` = ' . (int) $data2['vref']) or die(mysqli_error($database->dblink));
|
||||
$query2 = mysqli_query($database->dblink,'UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . '` = 10 WHERE `vref` = ' . (int) $data2['vref']) or die(mysqli_error($database->dblink));
|
||||
}
|
||||
}
|
||||
for($i=19; $i<=40; ++$i) {
|
||||
if($data2['f' . $i . 't'] == 34) {
|
||||
$query3 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . (int) $data2['vref']) or die(mysqli_error($database->dblink));
|
||||
$query3 = mysqli_query($database->dblink,'UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . (int) $data2['vref']) or die(mysqli_error($database->dblink));
|
||||
}
|
||||
}
|
||||
|
||||
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 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . (int) $village->wid) or die(mysqli_error($database->dblink));
|
||||
$query3 = mysqli_query($database->dblink,'UPDATE `' . TB_PREFIX . 'fdata` SET `f' . $i . 't` = 0, `f' . $i . '` = 0 WHERE `vref` = ' . (int) $village->wid) or die(mysqli_error($database->dblink));
|
||||
}
|
||||
}
|
||||
$query3 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 0 WHERE `wref` = ' . (int) $data1['wref']);
|
||||
$query4 = mysqli_query($GLOBALS['link'],'UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 1 WHERE `wref` = ' . (int) $village->wid);
|
||||
$query3 = mysqli_query($database->dblink,'UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 0 WHERE `wref` = ' . (int) $data1['wref']);
|
||||
$query4 = mysqli_query($database->dblink,'UPDATE `' . TB_PREFIX . 'vdata` SET `capital` = 1 WHERE `wref` = ' . (int) $village->wid);
|
||||
}
|
||||
} else {
|
||||
$error = '<br /><font color="red">'.LOGIN_PW_ERROR.'</font><br />';
|
||||
@@ -67,7 +67,7 @@ else{
|
||||
?>
|
||||
|
||||
<?php
|
||||
$query = mysqli_query($GLOBALS['link'],'SELECT wref FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . (int) $session->uid . ' AND `capital` = 1');
|
||||
$query = mysqli_query($database->dblink,'SELECT wref FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . (int) $session->uid . ' AND `capital` = 1');
|
||||
$data = mysqli_fetch_assoc($query);
|
||||
if($data['wref'] == $village->wid) {
|
||||
?>
|
||||
|
||||
+12
-12
@@ -14,8 +14,8 @@ function getDistance($coorx1, $coory1, $coorx2, $coory2) {
|
||||
return round($dist, 1);
|
||||
}
|
||||
?>
|
||||
<div class="gid27">
|
||||
<body>
|
||||
<div class="gid27">
|
||||
<table id="own" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -83,7 +83,7 @@ Treasury <b>' . $reqlvl . '</b>, Effect <b>' . $effect . '</b>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
$count = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM " . TB_PREFIX . "artefacts"), MYSQLI_ASSOC);
|
||||
$count = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM " . TB_PREFIX . "artefacts"), MYSQLI_ASSOC);
|
||||
$count = $count['Total'];
|
||||
if($count == 0) {
|
||||
echo '<td colspan="4" class="none">'.NO_ARTIFACTS_AREA.'</td>';
|
||||
@@ -103,18 +103,18 @@ if($count == 0) {
|
||||
|
||||
unset($reqlvl);
|
||||
unset($effect);
|
||||
$arts = mysqli_query($GLOBALS['link'],"SELECT type, vref, id, name, size, owner, effect FROM " . TB_PREFIX . "artefacts");
|
||||
$arts = mysqli_query($database->dblink,"SELECT type, vref, id, name, size, owner, effect FROM " . TB_PREFIX . "artefacts");
|
||||
$rows = array();
|
||||
while($row = mysqli_fetch_array($arts)) {
|
||||
$query = mysqli_query($GLOBALS['link'],'SELECT x, y FROM `' . TB_PREFIX . 'wdata` WHERE `id` = ' . (int) $row['vref']);
|
||||
$coor2 = mysqli_fetch_assoc($query);
|
||||
|
||||
|
||||
$dist = round(getDistance($coor['x'], $coor['y'], $coor2['x'], $coor2['y']),1);
|
||||
|
||||
$rows[$dist] = $row;
|
||||
|
||||
}
|
||||
$query = mysqli_query($database->dblink,'SELECT x, y FROM `' . TB_PREFIX . 'wdata` WHERE `id` = ' . (int) $row['vref']);
|
||||
$coor2 = mysqli_fetch_assoc($query);
|
||||
|
||||
|
||||
$dist = round(getDistance($coor['x'], $coor['y'], $coor2['x'], $coor2['y']),1);
|
||||
|
||||
$rows[$dist] = $row;
|
||||
|
||||
}
|
||||
ksort($rows);
|
||||
foreach($rows as $row) {
|
||||
$wref = $village->wid;
|
||||
|
||||
+11
-11
@@ -31,14 +31,14 @@
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
$count = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM " . TB_PREFIX . "artefacts"), MYSQLI_ASSOC);
|
||||
$count = $count['Total'];
|
||||
$count = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM " . TB_PREFIX . "artefacts"), MYSQLI_ASSOC);
|
||||
$count = $count['Total'];
|
||||
if($count == 0) {
|
||||
echo '<td colspan="4" class="none">'.NO_ARTIFACTS.'</td>';
|
||||
} else {
|
||||
|
||||
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 1");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 2");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 3");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 4");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -117,7 +117,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 5");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -136,7 +136,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 6");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 7");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -174,7 +174,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 8");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -188,7 +188,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 1 AND type = 8");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
|
||||
+17
-17
@@ -31,13 +31,13 @@
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
$count = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM " . TB_PREFIX . "artefacts"), MYSQLI_ASSOC);
|
||||
$count = $count['Total'];
|
||||
$count = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM " . TB_PREFIX . "artefacts"), MYSQLI_ASSOC);
|
||||
$count = $count['Total'];
|
||||
if($count == 0) {
|
||||
echo '<td colspan="4" class="none">'.NO_ARTIFACTS.'</td>';
|
||||
} else {
|
||||
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 1");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 1");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 2");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 2");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 3");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 3");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -139,7 +139,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 4");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 4");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -172,7 +172,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 5");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -186,7 +186,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 5");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -205,7 +205,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 6");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -219,7 +219,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 6");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -238,7 +238,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 2 AND type = 7");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -252,7 +252,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 7");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
@@ -271,7 +271,7 @@
|
||||
|
||||
unset($artefact);
|
||||
unset($row);
|
||||
$artefact = mysqli_query($GLOBALS['link'],"SELECT type, id, name, effect, vref, owner FROM `" . TB_PREFIX . "artefacts` WHERE size = 3 AND type = 8");
|
||||
$artefact = mysqli_query($database->dblink,"SELECT type, id, name, effect, vref, owner 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>';
|
||||
|
||||
+17
-17
@@ -14,7 +14,7 @@ global $database;
|
||||
|
||||
if (isset($_POST['name']) && !empty($_POST['name'])) {
|
||||
$_POST['name'] = $database->escape(stripslashes($_POST['name']));
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `name`='".$_POST['name']."' where `uid`='".$database->escape($session->uid)."' AND dead = 0") or die("ERROR:".mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."hero SET `name`='".$_POST['name']."' where `uid`='".$database->escape($session->uid)."' AND dead = 0") or die("ERROR:".mysqli_error($database->dblink));
|
||||
$hero_info['name'] = $_POST['name'];
|
||||
echo "".NAME_CHANGED."";
|
||||
}
|
||||
@@ -172,12 +172,12 @@ if (isset($_POST['name']) && !empty($_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){
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = '".(($hero_info['level']*5)+5)."' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `points` = '".(($hero_info['level']*5)+5)."' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `attack` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `defence` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `regeneration` = '0' WHERE `heroid` = " . $hero_info['heroid']);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
@@ -185,40 +185,40 @@ if (isset($_POST['name']) && !empty($_POST['name'])) {
|
||||
}
|
||||
if($_GET['add'] == "off" && $hero_info['attack'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `attack` = `attack` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "deff" && $hero_info['defence'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `defence` = `defence` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "obonus" && $hero_info['attackbonus'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `attackbonus` = `attackbonus` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "dbonus" && $hero_info['defencebonus'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `defencebonus` = `defencebonus` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
if($_GET['add'] == "reg" && $hero_info['regeneration'] < 100) {
|
||||
if($hero_info['points'] > 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `regeneration` = `regeneration` + 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET `points` = `points` - 1 WHERE `heroid` = " . $hero_info['heroid']);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -197,8 +197,8 @@
|
||||
|
||||
if(isset($_GET['revive']) && $_GET['revive'] == 1 && isset($_GET['hid']) && $_GET['hid'] == $hero_datarow['heroid'] && $hero_datarow['inrevive'] == 0 && $hero_datarow['intraining'] == 0 && $hero_datarow['dead'] == 1){
|
||||
if($session->access != BANNED){
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".(int) $training_time2."', `wref` = '".(int) $village->wid."' WHERE `heroid` = ".(int) $_GET['hid']." AND `uid` = '".(int) $session->uid."'");
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".(int) $training_time2."', `wref` = '".(int) $village->wid."' WHERE `heroid` = ".(int) $_GET['hid']." AND `uid` = '".(int) $session->uid."'");
|
||||
mysqli_query($database->dblink,"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $wood.",
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
|
||||
//check if there is unit needed in the village
|
||||
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".(int) $village->wid."");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".(int) $village->wid."");
|
||||
$units_array = mysqli_fetch_array($result);
|
||||
|
||||
$count_hero = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM " . TB_PREFIX . "hero WHERE `uid` = " . $database->escape($session->uid) . ""), MYSQLI_ASSOC);
|
||||
$count_hero = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM " . TB_PREFIX . "hero WHERE `uid` = " . $database->escape($session->uid) . ""), MYSQLI_ASSOC);
|
||||
$count_hero = $count_hero['Total'];
|
||||
|
||||
if ($count_hero < 3) {
|
||||
@@ -667,9 +667,9 @@ $output.="<tr>
|
||||
if($session->access != BANNED){
|
||||
if($count_hero < 3){
|
||||
$unitID = $_GET['train'];
|
||||
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 (".$database->escape($session->uid).", " . (int) $village->wid . ", 0, ".$unitID.", '".$database->escape($session->username)."', 0, 5, 0, 0, 100, 0, 0, 0, 0, ".round((time() + (${'u'.$unitID}['time'] / SPEED)*3)).", 50, 1)");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "units SET `u$unitID` = `u$unitID` - 1 WHERE `vref` = " . (int) $village->wid);
|
||||
mysqli_query($GLOBALS['link'],"
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."hero (`uid`, `wref`, `regeneration`, `unit`, `name`, `level`, `points`, `experience`, `dead`, `health`, `attack`, `defence`, `attackbonus`, `defencebonus`, `trainingtime`, `autoregen`, `intraining`) VALUES (".$database->escape($session->uid).", " . (int) $village->wid . ", 0, ".$unitID.", '".$database->escape($session->username)."', 0, 5, 0, 0, 100, 0, 0, 0, 0, ".round((time() + (${'u'.$unitID}['time'] / SPEED)*3)).", 50, 1)");
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET `u$unitID` = `u$unitID` - 1 WHERE `vref` = " . (int) $village->wid);
|
||||
mysqli_query($database->dblink,"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) ${'u'.$unitID}['wood'].",
|
||||
|
||||
@@ -119,7 +119,7 @@ $query2 = "SELECT
|
||||
|
||||
//$query2;
|
||||
|
||||
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error($database->dblink));
|
||||
$result2 = mysqli_query($database->dblink,$query2) or die(mysqli_error($database->dblink));
|
||||
|
||||
$targetalliance = array();
|
||||
$neutralarray = array();
|
||||
|
||||
@@ -130,7 +130,7 @@ $query2 = "SELECT
|
||||
ORDER BY FIND_IN_SET(".TB_PREFIX."wdata.id,'$maparray2')";
|
||||
|
||||
//echo $query2;
|
||||
$result2 = mysqli_query($GLOBALS['link'],$query2) or die(mysqli_error($database->dblink));
|
||||
$result2 = mysqli_query($database->dblink,$query2) or die(mysqli_error($database->dblink));
|
||||
|
||||
$targetalliance = array();
|
||||
$neutralarray = array();
|
||||
|
||||
+10
-10
@@ -2,7 +2,7 @@
|
||||
<?php
|
||||
$basearray = $database->getMInfo($_GET['d']);
|
||||
$uinfo = $database->getVillage($basearray['id']);
|
||||
$oasis1 = mysqli_query($GLOBALS['link'],'SELECT conqured, owner FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysqli_real_escape_string($GLOBALS['link'],$_GET['d']));
|
||||
$oasis1 = mysqli_query($database->dblink,'SELECT conqured, owner FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysqli_real_escape_string($database->dblink,$_GET['d']));
|
||||
$oasis = mysqli_fetch_assoc($oasis1);
|
||||
$access=$session->access;
|
||||
$oasislink = '';
|
||||
@@ -167,7 +167,7 @@ if($session->uid == $database->getVillage($_GET['d'])){
|
||||
}
|
||||
$toWref = $_GET['d'];
|
||||
if($session->alliance!=0){
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time 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 = mysqli_fetch_array($result)){
|
||||
@@ -191,7 +191,7 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
|
||||
<?php }
|
||||
}else{
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time 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 = mysqli_fetch_array($result)){
|
||||
@@ -266,7 +266,7 @@ if($session->uid == $database->getVillage($_GET['d'])){
|
||||
}
|
||||
$toWref = $_GET['d'];
|
||||
if($session->alliance!=0){
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time 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 = mysqli_fetch_array($result)){
|
||||
@@ -290,7 +290,7 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
|
||||
<?php }
|
||||
}else{
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time 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 = mysqli_fetch_array($result)){
|
||||
@@ -392,7 +392,7 @@ if($session->uid == $database->getVillage($_GET['d'])){
|
||||
}
|
||||
$toWref = $_GET['d'];
|
||||
if($session->alliance!=0){
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE $limit AND ally = ".$session->alliance." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time 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 = mysqli_fetch_array($result)){
|
||||
@@ -416,7 +416,7 @@ if($type==18 or $type==19 or $type==20 or $type==21 or $type==22){
|
||||
|
||||
<?php }
|
||||
}else{
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT data, ntype, id, topic, time FROM ".TB_PREFIX."ndata WHERE $limit AND uid = ".$session->uid." AND toWref = ".$toWref." ORDER BY time DESC Limit 5");
|
||||
$result = mysqli_query($database->dblink,"SELECT data, ntype, id, topic, time 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 = mysqli_fetch_array($result)){
|
||||
@@ -508,12 +508,12 @@ if($type==18 or $type==19 or $type==20 or $type==21){
|
||||
<td class="none">
|
||||
<?php
|
||||
if($basearray['fieldtype'] == 0){
|
||||
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysqli_escape_string($GLOBALS['link'],$_GET['d']));
|
||||
$query1 = mysqli_query($database->dblink,'SELECT * FROM `' . TB_PREFIX . 'odata` WHERE `wref` = ' . mysqli_escape_string($database->dblink,$_GET['d']));
|
||||
}else{
|
||||
$query1 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysqli_real_escape_string($GLOBALS['link'],$_GET['d']));
|
||||
$query1 = mysqli_query($database->dblink,'SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysqli_real_escape_string($database->dblink,$_GET['d']));
|
||||
}
|
||||
$data1 = mysqli_fetch_assoc($query1);
|
||||
$query2 = mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
|
||||
$query2 = mysqli_query($database->dblink,'SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
|
||||
$data2 = mysqli_fetch_assoc($query2);
|
||||
if($data2['access']=='0' or ($data2['access']== MULTIHUNTER && $data2['id'] == 5) or (!ADMIN_ALLOW_INCOMING_RAIDS && $data2['access']=='9')) {
|
||||
echo "» ".SENDTROOP." (".BAN.")";
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<th class="sent"><a href="nachrichten.php?o=1">Sent</a></th>
|
||||
</tr></thead><tfoot><tr><th>
|
||||
<?php
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT plus FROM ".TB_PREFIX."users WHERE `id`='".(int) $session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT plus FROM ".TB_PREFIX."users WHERE `id`='".(int) $session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$date2=strtotime("NOW");
|
||||
if ($golds['plus'] <= $date2) { ?>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<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 = mysqli_query($GLOBALS['link'],"SELECT plus FROM ".TB_PREFIX."users WHERE `id`='".(int) $session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT plus FROM ".TB_PREFIX."users WHERE `id`='".(int) $session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$date2=strtotime("NOW");
|
||||
if ($golds['plus'] <= $date2) { ?>
|
||||
|
||||
@@ -12,7 +12,7 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
|
||||
</tr>
|
||||
</thead><tfoot>
|
||||
<tr><th><?php
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT plus FROM ".TB_PREFIX."users WHERE `id`='".(int) $session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT plus FROM ".TB_PREFIX."users WHERE `id`='".(int) $session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$date2=strtotime("NOW");
|
||||
if ($golds['plus'] <= $date2) { ?>
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<?php
|
||||
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||
if($session->access != BANNED && $session->gold >= 5){
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT gold, b2 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT gold, b2 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$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($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b2 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
} else {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b2 = '".($golds['b2']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b2 = '".($golds['b2']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
}
|
||||
$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($database->dblink));
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Clay')") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Clay')") or die(mysqli_error($database->dblink));
|
||||
} 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($database->dblink));
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Clay')") or die(mysqli_error($database->dblink));
|
||||
}
|
||||
}
|
||||
header("Location: plus.php?id=3");
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<?php
|
||||
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||
if($session->access != BANNED && $session->gold >= 5){
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT gold, b3 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT gold, b3 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$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($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b3 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
} else {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b3 = '".($golds['b3']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b3 = '".($golds['b3']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
}
|
||||
$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($database->dblink));
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Iron')") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Iron')") or die(mysqli_error($database->dblink));
|
||||
} 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($database->dblink));
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Iron')") or die(mysqli_error($database->dblink));
|
||||
}
|
||||
}
|
||||
header("Location: plus.php?id=3");
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<?php
|
||||
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||
if($session->access != BANNED && $session->gold >= 5){
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT gold, b4 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT gold, b4 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$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($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b4 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
} else {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b4 = '".($golds['b4']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b4 = '".($golds['b4']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
}
|
||||
$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($database->dblink));
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Crop')") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Crop')") or die(mysqli_error($database->dblink));
|
||||
} 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($database->dblink));
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Crop')") or die(mysqli_error($database->dblink));
|
||||
}
|
||||
}
|
||||
header("Location: plus.php?id=3");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!---<?php
|
||||
/*include("Templates/Plus/pmenu.tpl");
|
||||
$MyVilId = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||
$MyVilId = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||
$uuVilid = mysqli_fetch_array($MyVilId);
|
||||
$totalR = ($uuVilid['6']+$uuVilid['7']+$uuVilid['8']+$uuVilid['10']);
|
||||
$quart = ($totalR / 4);
|
||||
@@ -21,10 +21,10 @@
|
||||
<td align="center">
|
||||
<?php
|
||||
if($session->sit == 0) {
|
||||
/* $MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
/* $MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
|
||||
$MyId = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyId = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$uuid = mysqli_fetch_array($MyId);
|
||||
|
||||
echo "<input type='text' name='T1' size='6' value=".$quart."></td>";
|
||||
@@ -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>";
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-1)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-1)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
*/
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<?php
|
||||
////////////// made by alq0rsan /////////////////////////
|
||||
if($session->access != BANNED){
|
||||
$MyVilId = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||
$MyVilId = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."vdata WHERE `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||
$uuVilid = mysqli_fetch_array($MyVilId);
|
||||
|
||||
$totalT = ($T1+$T2+$T3+$T4);
|
||||
$totalR = ($uuVilid['6']+$uuVilid['7']+$uuVilid['8']+$uuVilid['10']);
|
||||
|
||||
$goldlog = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."gold_fin_log"), MYSQLI_ASSOC) or die(mysqli_error($database->dblink));
|
||||
$goldlog = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."gold_fin_log"), MYSQLI_ASSOC) or die(mysqli_error($database->dblink));
|
||||
|
||||
if($totalT <= $totalR) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set wood = '".$T1."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set clay = '".$T2."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set iron = '".$T3."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."vdata set crop = '".$T4."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-3)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".($goldlog['Total']+1)."', '".$village->wid."', 'trade 1:1')") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."vdata set wood = '".$T1."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."vdata set clay = '".$T2."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."vdata set iron = '".$T3."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."vdata set crop = '".$T4."' where `wref`='".$village->wid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-3)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".($goldlog['Total']+1)."', '".$village->wid."', 'trade 1:1')") or die(mysqli_error($database->dblink));
|
||||
echo "done";
|
||||
} else {
|
||||
echo "failed";
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".($goldlog['Total']+1)."', '".$village->wid."', 'Failed trade 1:1')") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log VALUES ('".($goldlog['Total']+1)."', '".$village->wid."', 'Failed trade 1:1')") or die(mysqli_error($database->dblink));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
////////////// made by alq0rsan /////////////////////////
|
||||
if($session->access != BANNED){
|
||||
if($session->gold >= 100 && $session->sit == 0 && $session->goldclub == 0) {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set goldclub = 1, gold = gold - 100 where `id`='".$session->uid."'");
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set goldclub = 1, gold = gold - 100 where `id`='".$session->uid."'");
|
||||
}
|
||||
header("Location: plus.php?id=3");
|
||||
exit;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
|
||||
include("Templates/Plus/pmenu.tpl");
|
||||
|
||||
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
|
||||
$today = date("mdHi");
|
||||
@@ -60,7 +60,7 @@ $date2=strtotime("NOW");
|
||||
}else
|
||||
if ($datetimep <= $date2) {
|
||||
print "Your PLUS advantage has ended.<br>";
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = '0' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = '0' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
} else {
|
||||
|
||||
$holdtotmin=(($datetimep-$date2)/60);
|
||||
@@ -87,7 +87,7 @@ $holdmr=intval($holdtotmin-(($holdhr*60)+($holdtotday*1440)));
|
||||
<td class="act">
|
||||
|
||||
<?php
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
@@ -464,7 +464,7 @@ if (mysqli_num_rows($MyGold)) {
|
||||
<td class="act">
|
||||
|
||||
<?php
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
|
||||
if (mysqli_num_rows($MyGold)) {
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<?php
|
||||
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||
if($session->access != BANNED && $session->gold >= 10){
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT gold, plus FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT gold, plus FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$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($database->dblink));
|
||||
mysqli_query($database->dblink,"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($database->dblink));
|
||||
} else {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set plus = '".($golds['plus']+PLUS_TIME)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set plus = '".($golds['plus']+PLUS_TIME)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
}
|
||||
$done1 = " Plus Account";
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-10)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Plus Account')") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-10)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Plus Account')") or die(mysqli_error($database->dblink));
|
||||
} 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($database->dblink));
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed Plus Account')") or die(mysqli_error($database->dblink));
|
||||
}
|
||||
}
|
||||
header("Location: plus.php?id=3");
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<?php
|
||||
////////////// made by alq0rsan, improved by evader /////////////////////////
|
||||
if($session->access != BANNED && $session->gold >= 5){
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT gold, b1 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT gold, b1 FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$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($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b1 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
} else {
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set b1 = '".($golds['b1']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set b1 = '".($golds['b1']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
}
|
||||
$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($database->dblink));
|
||||
mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Lumber')") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = ".($session->gold-5)." where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', '+25% Production: Lumber')") or die(mysqli_error($database->dblink));
|
||||
} 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($database->dblink));
|
||||
mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."gold_fin_log (wid,log) VALUES ('".$village->wid."', 'Failed +25% Production: Lumber')") or die(mysqli_error($database->dblink));
|
||||
}
|
||||
}
|
||||
header("Location: plus.php?id=3");
|
||||
|
||||
@@ -32,8 +32,8 @@ echo <<<EOT
|
||||
EOT;
|
||||
}else{
|
||||
|
||||
$account = mysqli_real_escape_string($GLOBALS['link'],$_POST['username']);
|
||||
$reward = mysqli_real_escape_string($GLOBALS['link'],$_POST['reward']);
|
||||
$account = mysqli_real_escape_string($database->dblink,$_POST['username']);
|
||||
$reward = mysqli_real_escape_string($database->dblink,$_POST['reward']);
|
||||
$valid=TRUE;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ EOT;
|
||||
$plusTime = 604800; // 7 days
|
||||
$time = time();
|
||||
$giveplus = ($time + $plustime);
|
||||
$accountCheck = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'"), MYSQLI_ASSOC) or die(mysqli_error($database->dblink));
|
||||
$accountCheck = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'"), MYSQLI_ASSOC) or die(mysqli_error($database->dblink));
|
||||
if($accountCheck['Total'] <= 0){
|
||||
echo "<b>ERROR:</b><br />";
|
||||
echo "The account name you entered does not exist.";
|
||||
@@ -60,7 +60,7 @@ EOT;
|
||||
if(!$valid) break;
|
||||
$valid=TRUE;
|
||||
|
||||
$plusCheck = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$plusCheck = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$pluss = mysqli_fetch_array($plusCheck);
|
||||
|
||||
switch($reward){
|
||||
@@ -102,17 +102,17 @@ echo' Please select the option you wish to activate or extend.<br>';
|
||||
|
||||
if(mysqli_num_rows($plusCheck) > 0){
|
||||
if($time > $pluss[$key] ){
|
||||
$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($database->dblink));
|
||||
$editplus = mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` + ('".$time."'+'".$plusTime."'), `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
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 = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` +'".$plusTime."', `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$editplus = mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users SET `{$key}`= `{$key}` +'".$plusTime."', `gold` = `gold` - {$gldz} WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
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 = mysqli_query($GLOBALS['link'],"INSERT INTO ".TB_PREFIX."users (`username`,`{$key}`, `gold`) VALUES ('".$session->username."', ('".$time."'+'".$plusTime."'),`gold` - {$gldz})") or die(mysqli_error($database->dblink));
|
||||
$insertplus = mysqli_query($database->dblink,"INSERT INTO ".TB_PREFIX."users (`username`,`{$key}`, `gold`) VALUES ('".$session->username."', ('".$time."'+'".$plusTime."'),`gold` - {$gldz})") or die(mysqli_error($database->dblink));
|
||||
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>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
echo "Row ".$i;
|
||||
}
|
||||
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY ap DESC, id DESC Limit 1");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY ap DESC, id DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -66,8 +66,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$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");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"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>
|
||||
@@ -120,8 +120,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$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");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"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">
|
||||
@@ -173,8 +173,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$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");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"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>
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
| Copyright: TravianX Project All rights reserved |
|
||||
\** --------------------------------------------------- **/
|
||||
|
||||
$tribe1 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 1"), MYSQLI_ASSOC);
|
||||
$tribe2 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 2"), MYSQLI_ASSOC);
|
||||
$tribe3 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 3"), MYSQLI_ASSOC);
|
||||
$tribe1 = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 1"), MYSQLI_ASSOC);
|
||||
$tribe2 = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 2"), MYSQLI_ASSOC);
|
||||
$tribe3 = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 3"), MYSQLI_ASSOC);
|
||||
$tribes = array($tribe1['Total'], $tribe2['Total'], $tribe3['Total']);
|
||||
$users = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5"), MYSQLI_ASSOC);
|
||||
$users = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5"), MYSQLI_ASSOC);
|
||||
$users = $users['Total'];
|
||||
?>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<th>Active players</th>
|
||||
|
||||
<td><?php
|
||||
$active = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE timestamp > ".(time() - (3600*24))." AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
$active = mysqli_num_rows(mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE timestamp > ".(time() - (3600*24))." AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
echo $active; ?></td>
|
||||
</tr>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<th>Players online</th>
|
||||
|
||||
<td><?php
|
||||
$online = mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE timestamp > ".(time() - (60*10))." AND tribe!=0 AND tribe!=4 AND tribe!=5");
|
||||
$online = mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE timestamp > ".(time() - (60*10))." AND tribe!=0 AND tribe!=4 AND tribe!=5");
|
||||
if (!empty($online)) {
|
||||
echo mysqli_fetch_assoc($online)['Total'];
|
||||
} else {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
echo "Row ".$i;
|
||||
}
|
||||
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY ap DESC, id DESC Limit 1");
|
||||
$result = mysqli_query($database->dblink,"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($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY ap DESC, id DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -67,8 +67,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$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");
|
||||
$result = mysqli_query($database->dblink,"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($database->dblink,"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>
|
||||
@@ -121,8 +121,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$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");
|
||||
$result = mysqli_query($database->dblink,"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($database->dblink,"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">
|
||||
@@ -173,8 +173,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$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");
|
||||
$result = mysqli_query($database->dblink,"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($database->dblink,"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>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (WW == True)
|
||||
{
|
||||
$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
|
||||
$result = mysqli_query($database->dblink,"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
|
||||
@@ -27,7 +27,7 @@ if (WW == True)
|
||||
while ($row = mysqli_fetch_array($result))
|
||||
{
|
||||
$ally = $database->getAlliance($row['alliance']);
|
||||
$query = @mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vref'] . ' ORDER BY `attack_time` ASC LIMIT 1');
|
||||
$query = @mysqli_query($database->dblink,'SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vref'] . ' ORDER BY `attack_time` ASC LIMIT 1');
|
||||
$row2 = @mysqli_fetch_assoc($query);
|
||||
?>
|
||||
<tr>
|
||||
|
||||
@@ -138,7 +138,7 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
}
|
||||
if ($enforce['hero']>0){
|
||||
$qh = "SELECT unit FROM ".TB_PREFIX."hero WHERE uid = ".(int) $to['owner']." AND dead = 0";
|
||||
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||
$resulth = mysqli_query($database->dblink,$qh);
|
||||
$hero_f=mysqli_fetch_array($resulth);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
|
||||
@@ -139,7 +139,7 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
}
|
||||
if ($enforce['hero']>0){
|
||||
$qh = "SELECT unit FROM ".TB_PREFIX."hero WHERE uid = ".(int) $to['owner']." AND dead = 0";
|
||||
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||
$resulth = mysqli_query($database->dblink,$qh);
|
||||
$hero_f=mysqli_fetch_array($resulth);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
|
||||
@@ -138,7 +138,7 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
}
|
||||
if ($enforce['hero']>0){
|
||||
$qh = "SELECT unit FROM ".TB_PREFIX."hero WHERE uid = ".(int) $to['owner']." AND dead = 0";
|
||||
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||
$resulth = mysqli_query($database->dblink,$qh);
|
||||
$hero_f=mysqli_fetch_array($resulth);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
|
||||
@@ -139,7 +139,7 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
}
|
||||
if ($enforce['hero']>0){
|
||||
$qh = "SELECT unit FROM ".TB_PREFIX."hero WHERE uid = ".(int) $to['owner']." AND dead = 0";
|
||||
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||
$resulth = mysqli_query($database->dblink,$qh);
|
||||
$hero_f=mysqli_fetch_array($resulth);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
|
||||
@@ -138,7 +138,7 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
}
|
||||
if ($enforce['hero']>0){
|
||||
$qh = "SELECT unit FROM ".TB_PREFIX."hero WHERE uid = ".(int) $to['owner']." AND dead = 0";
|
||||
$resulth = mysqli_query($GLOBALS['link'],$qh);
|
||||
$resulth = mysqli_query($database->dblink,$qh);
|
||||
$hero_f=mysqli_fetch_array($resulth);
|
||||
$hero_unit=$hero_f['unit'];
|
||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
$sql = "SELECT id, towref, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10 FROM ".TB_PREFIX."raidlist WHERE lid = ".$database->escape((int) $lid)." order by id asc";
|
||||
$array = $database->query_return($sql);
|
||||
foreach($array as $row){
|
||||
$sql1 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."units WHERE vref = ".(int) $getFLData['wref']));
|
||||
$sql1 = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."units WHERE vref = ".(int) $getFLData['wref']));
|
||||
$sid = $row['id'];
|
||||
$wref = $row['towref'];
|
||||
$t1 = $row['t1'];$t2 = $row['t2'];$t3 = $row['t3'];$t4 = $row['t4'];$t5 = $row['t5'];
|
||||
|
||||
@@ -9,7 +9,7 @@ if(isset($_GET['t'])==99 && isset($_POST['action'])=='addList' && $_POST['did']!
|
||||
exit;
|
||||
}
|
||||
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT id, name, owner, wref FROM ".TB_PREFIX."farmlist WHERE owner = ".(int) $session->uid." ORDER BY wref DESC");
|
||||
$sql = mysqli_query($database->dblink,"SELECT id, name, owner, wref FROM ".TB_PREFIX."farmlist WHERE owner = ".(int) $session->uid." ORDER BY wref DESC");
|
||||
$query = mysqli_num_rows($sql);
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$lid = $row["id"];
|
||||
@@ -51,7 +51,7 @@ while($row = mysqli_fetch_array($sql)){
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
$sql2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".(int) $lid." ORDER BY distance ASC");
|
||||
$sql2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".(int) $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>';
|
||||
@@ -193,7 +193,7 @@ $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 = mysqli_query($GLOBALS['link'],"SELECT ntype, data, time, id FROM ".TB_PREFIX."ndata WHERE $limits AND toWref = ".(int) $towref." AND uid = ".(int) $session->uid." ORDER BY time DESC Limit 1");
|
||||
$getnotice = mysqli_query($database->dblink,"SELECT ntype, data, time, id FROM ".TB_PREFIX."ndata WHERE $limits AND toWref = ".(int) $towref." AND uid = ".(int) $session->uid." ORDER BY time DESC Limit 1");
|
||||
if(mysqli_num_rows($getnotice) > 0){
|
||||
while($row2 = mysqli_fetch_array($getnotice)){
|
||||
$dataarray = explode(",",$row2['data']);
|
||||
@@ -316,7 +316,7 @@ if(!$database->getVilFarmlist($village->wid)){
|
||||
{
|
||||
Travian.Game.RaidList.setData({
|
||||
<?php
|
||||
$result = mysqli_query($GLOBALS['link'],'SELECT id FROM '.TB_PREFIX.'farmlist WHERE wref = '.(int) $village->wid.'');
|
||||
$result = mysqli_query($database->dblink,'SELECT id FROM '.TB_PREFIX.'farmlist WHERE wref = '.(int) $village->wid.'');
|
||||
$query1 = mysqli_num_rows($result);
|
||||
$NUM1 = 1;
|
||||
while($row = mysqli_fetch_array($result)){
|
||||
@@ -327,7 +327,7 @@ $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 = mysqli_query($GLOBALS['link'],'SELECT * FROM '.TB_PREFIX.'raidlist WHERE lid = '.(int) $lid.'');
|
||||
$result3 = mysqli_query($database->dblink,'SELECT * FROM '.TB_PREFIX.'raidlist WHERE lid = '.(int) $lid.'');
|
||||
$query2 = mysqli_num_rows($result3);
|
||||
$NUM2 = 1;
|
||||
while($row3 = mysqli_fetch_array($result3)){
|
||||
|
||||
@@ -86,7 +86,7 @@ $vdata = $database->getVillage($Wref);
|
||||
<select name="lid">
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT id, name, owner, wref FROM ".TB_PREFIX."farmlist WHERE owner = ".(int) $session->uid." ORDER BY name ASC");
|
||||
$sql = mysqli_query($database->dblink,"SELECT id, name, owner, wref FROM ".TB_PREFIX."farmlist WHERE owner = ".(int) $session->uid." ORDER BY name ASC");
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$lid = $row["id"];
|
||||
$lname = $row["name"];
|
||||
@@ -124,7 +124,7 @@ $lvname = $database->getVillageField($row["wref"], 'name');
|
||||
$getwref = "SELECT towref FROM ".TB_PREFIX."raidlist WHERE lid = ".$database->escape((int) $_GET['lid'])."";
|
||||
$arraywref = $database->query_return($getwref);
|
||||
echo '<option value="">Select village</option>';
|
||||
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],$getwref)) != 0){
|
||||
if(mysqli_num_rows(mysqli_query($database->dblink,$getwref)) != 0){
|
||||
foreach($arraywref as $row){
|
||||
$towref = $row["towref"];
|
||||
$tocoor = $database->getCoor($towref);
|
||||
|
||||
@@ -93,7 +93,7 @@ $lid2 = $getlid['lid'];
|
||||
<td>
|
||||
<select onchange="getTargetsByLid();" id="lid" name="lid">
|
||||
<?php
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT id, name, owner, wref FROM ".TB_PREFIX."farmlist WHERE owner = ".(int) $session->uid." ORDER BY name ASC");
|
||||
$sql = mysqli_query($database->dblink,"SELECT id, name, owner, wref FROM ".TB_PREFIX."farmlist WHERE owner = ".(int) $session->uid." ORDER BY name ASC");
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$lid = $row["id"];
|
||||
$lname = $row["name"];
|
||||
@@ -130,7 +130,7 @@ $lvname = $database->getVillageField($row["wref"], 'name');
|
||||
$getwref = "SELECT id, towref FROM ".TB_PREFIX."raidlist WHERE lid = ".(int) $lid2;
|
||||
$arraywref = $database->query_return($getwref);
|
||||
echo '<option value="">Select village</option>';
|
||||
if(mysqli_num_rows(mysqli_query($GLOBALS['link'],$getwref)) != 0){
|
||||
if(mysqli_num_rows(mysqli_query($database->dblink,$getwref)) != 0){
|
||||
foreach($arraywref as $row){
|
||||
$towref = $row["towref"];
|
||||
$tocoor = $database->getCoor($towref);
|
||||
|
||||
@@ -196,7 +196,7 @@ if(isset($_GET['o'])) {
|
||||
|
||||
if ($prisoner['t11']>0){
|
||||
$p_qh = "SELECT unit FROM ".TB_PREFIX."hero WHERE uid = ".(int) $p_owner." AND dead = 0";
|
||||
$p_resulth = mysqli_query($GLOBALS['link'],$p_qh);
|
||||
$p_resulth = mysqli_query($database->dblink,$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'];
|
||||
@@ -224,7 +224,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");
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."hero SET `dead` = '1', `health` = '0' WHERE `uid` = '".$p_owner."' AND dead = 0");
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."hero SET `dead` = '1', `health` = '0' WHERE `uid` = '".$p_owner."' AND dead = 0");
|
||||
}
|
||||
$database->modifyUnit($prisoner['wref'],array("99o"),array($troops),array(0));
|
||||
$database->deletePrisoners($prisoner['id']);
|
||||
|
||||
@@ -74,11 +74,11 @@ $automation->isWinner();
|
||||
<?php
|
||||
if ($amount == 199) {
|
||||
// Statement retrieve Gold Package A
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$goldnow = $golds['6'] + 60;
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$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">
|
||||
@@ -122,11 +122,11 @@ $golds1 = mysqli_fetch_array($MyGold);
|
||||
}
|
||||
if ($amount == 499) {
|
||||
// Statement retrieve Gold Package B
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$goldnow = $golds['6'] + 120;
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$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">
|
||||
@@ -169,11 +169,11 @@ $golds1 = mysqli_fetch_array($MyGold);
|
||||
}
|
||||
if ($amount == 999) {
|
||||
// Statement retrieve Gold Package C
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$goldnow = $golds['6'] + 360;
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$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">
|
||||
@@ -216,11 +216,11 @@ $golds1 = mysqli_fetch_array($MyGold);
|
||||
}
|
||||
if ($amount == 1999) {
|
||||
// Statement retrieve Gold Package D
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$goldnow = $golds['6'] + 1000;
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$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">
|
||||
@@ -263,11 +263,11 @@ $golds1 = mysqli_fetch_array($MyGold);
|
||||
}
|
||||
if ($amount == 4999) {
|
||||
// Statement retrieve Gold Package E
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
$goldnow = $golds['6'] + 2000;
|
||||
mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set gold = '".$goldnow."' where `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$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">
|
||||
@@ -309,7 +309,7 @@ $golds1 = mysqli_fetch_array($MyGold);
|
||||
}
|
||||
if ($amount == 0)
|
||||
{
|
||||
$MyGold = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$MyGold = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error($database->dblink));
|
||||
$golds = mysqli_fetch_array($MyGold);
|
||||
?>
|
||||
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ if(isset($_GET['s'])){
|
||||
|
||||
if(isset($_GET['fid'])){
|
||||
$fid = preg_replace("/[^0-9]/","",$_GET['fid']);
|
||||
$forum = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".(int) $fid."");
|
||||
$forum = mysqli_query($database->dblink,"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".(int) $fid."");
|
||||
$forum_type = mysqli_fetch_array($forum);
|
||||
if($forum_type['forum_name'] != "" && $forum_type['forum_area'] == 0){
|
||||
if($forum_type['alliance'] != $session->alliance){
|
||||
@@ -40,7 +40,7 @@ if(isset($_GET['fid'])){
|
||||
}
|
||||
}else if(isset($_GET['fid2'])){
|
||||
$fid = preg_replace("/[^0-9]/","",$_GET['fid2']);
|
||||
$forum = mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".(int) $fid."");
|
||||
$forum = mysqli_query($database->dblink,"SELECT * FROM " . TB_PREFIX . "forum_cat WHERE id = ".(int) $fid."");
|
||||
if (!empty($forum)) {
|
||||
$forum_type = mysqli_fetch_array($forum);
|
||||
if($forum_type['forum_name'] != "" && $forum_type['forum_area'] != 1){
|
||||
|
||||
@@ -296,7 +296,7 @@ if ( isset( $_GET['mode'] ) && $_GET['mode'] == 'troops' && isset( $_GET['cancel
|
||||
$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 = mysqli_fetch_array( mysqli_query( $GLOBALS['link'], $q2 ) );
|
||||
$lastid = mysqli_fetch_array( mysqli_query( $database->dblink, $q2 ) );
|
||||
$newid = $lastid['id'] + 1;
|
||||
$q2 = "INSERT INTO " . TB_PREFIX . "send values ($newid,0,0,0,0,0)";
|
||||
$database->query( $q2 );
|
||||
@@ -417,7 +417,6 @@ exit;
|
||||
include("Templates/multivillage.tpl");
|
||||
include("Templates/quest.tpl");
|
||||
include("Templates/news.tpl");
|
||||
include("Templates/links.tpl");
|
||||
?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
+13
-13
@@ -126,7 +126,7 @@ if(isset($_POST['password']) && $_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)";
|
||||
mysqli_query($GLOBALS['link'],$q);
|
||||
mysqli_query($database->dblink,$q);
|
||||
unset($q);
|
||||
$uid = $database->getUserField($username, 'id', 1);
|
||||
$arrayXY=array();
|
||||
@@ -175,18 +175,18 @@ if(isset($_POST['password']) && $_POST['password'] != ""){
|
||||
|
||||
$wid = $database->getVillage($uid, 2);
|
||||
$q = "UPDATE " . TB_PREFIX . "vdata SET pop = 834 WHERE owner = ".(int) $uid;
|
||||
mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,$q) or die(mysqli_error($database->dblink));
|
||||
$q2 = "UPDATE " . TB_PREFIX . "users SET access = 2 WHERE id = ".(int) $uid;
|
||||
mysqli_query($GLOBALS['link'],$q2) or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,$q2) or die(mysqli_error($database->dblink));
|
||||
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 = " . (int) $wid['wref'] . "";
|
||||
mysqli_query($GLOBALS['link'],$q3) or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,$q3) or die(mysqli_error($database->dblink));
|
||||
$q4 = "UPDATE " . TB_PREFIX . "users SET desc2 = '$desc' WHERE id = ".(int) $uid;
|
||||
mysqli_query($GLOBALS['link'],$q4) or die(mysqli_error($database->dblink));
|
||||
mysqli_query($database->dblink,$q4) or die(mysqli_error($database->dblink));
|
||||
|
||||
/**
|
||||
* SCOUTING ALL PLAYERS FIX BY MisterX
|
||||
@@ -252,22 +252,22 @@ if(isset($_POST['password']) && $_POST['password'] != ""){
|
||||
$database->addUnits($wid);
|
||||
$database->addTech($wid);
|
||||
$database->addABTech($wid);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET pop = 163 WHERE wref = ".(int) $wid);
|
||||
mysqli_query($GLOBALS['link'],"UPDATE " . TB_PREFIX . "vdata SET name = '$village_name' WHERE wref = ".(int) $wid);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "vdata SET pop = 163 WHERE wref = ".(int) $wid);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "vdata SET name = '$village_name' WHERE wref = ".(int) $wid);
|
||||
if(SPEED > 3) {
|
||||
$speed = 5;
|
||||
} else {
|
||||
$speed = SPEED;
|
||||
}
|
||||
if($size == 1) {
|
||||
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 = " . (int) $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 = ".(int) $wid);
|
||||
mysqli_query($database->dblink,"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 = " . (int) $wid . "");
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 10, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = ".(int) $wid);
|
||||
} elseif($size == 2) {
|
||||
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 = " . (int) $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 = ".(int) $wid);
|
||||
mysqli_query($database->dblink,"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 = " . (int) $wid . "");
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 20, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = ".(int) $wid);
|
||||
} elseif($size == 3) {
|
||||
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 = " . (int) $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 = ".(int) $wid);
|
||||
mysqli_query($database->dblink,"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 = " . (int) $wid . "");
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 20, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = ".(int) $wid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -135,9 +135,9 @@ $start_timer = $generator->pageLoadTimeStart();
|
||||
<?php
|
||||
|
||||
define('PREFIX', TB_PREFIX);
|
||||
$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");
|
||||
$type15 = mysqli_query($database->dblink,"SELECT id,x,y,occupied FROM ".PREFIX."wdata WHERE fieldtype = 6");
|
||||
$type9 = mysqli_query($database->dblink,"SELECT id,x,y,occupied FROM ".PREFIX."wdata WHERE fieldtype = 1");
|
||||
$type_both = mysqli_query($database->dblink,"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'];
|
||||
|
||||
+3
-3
@@ -17,7 +17,7 @@ AccessLogger::logRequest();
|
||||
|
||||
$max_per_pass = 1000;
|
||||
|
||||
if (mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users WHERE access = 9 AND id = ".(int) $session->uid)) != '1') die("Hacking attemp!");
|
||||
if (mysqli_num_rows(mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE access = 9 AND id = ".(int) $session->uid)) != '1') die("Hacking attemp!");
|
||||
|
||||
if (@$_POST['submit'] == "Send")
|
||||
{
|
||||
@@ -52,7 +52,7 @@ if (isset($_GET['send']) && isset($_GET['from']))
|
||||
$_SESSION['m_subject'] = $database->escape($_SESSION['m_subject']);
|
||||
$_SESSION['m_message'] = $database->escape($_SESSION['m_message']);
|
||||
|
||||
$users_count = mysqli_fetch_assoc(mysqli_query($GLOBALS['link'],"SELECT count(*) as count FROM ".TB_PREFIX."users WHERE id != 0"));
|
||||
$users_count = mysqli_fetch_assoc(mysqli_query($database->dblink,"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`,`deltarget`,`delowner`,`alliance`,`player`,`coor`,`report`) VALUES ";
|
||||
@@ -78,7 +78,7 @@ if (isset($_GET['send']) && isset($_GET['from']))
|
||||
$sql .= "($i, 0, '{$_SESSION['m_subject']}', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time().",0,0,0,0,0,0),";
|
||||
}
|
||||
}
|
||||
mysqli_query($GLOBALS['link'],$sql);
|
||||
mysqli_query($database->dblink,$sql);
|
||||
if (($users_count - $_GET['from']) > $max_per_pass) {
|
||||
header("Location: massmessage.php?send=true&from=",$_GET['from'] + $max_per_pass);
|
||||
exit;
|
||||
|
||||
+10
-10
@@ -41,7 +41,7 @@ if(isset($_GET['newdid'])) {
|
||||
else {
|
||||
$building->procBuild($_GET);
|
||||
}
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
|
||||
$sql = mysqli_query($database->dblink,"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
|
||||
$winner = mysqli_num_rows($sql);
|
||||
|
||||
if($winner!=0){
|
||||
@@ -67,7 +67,7 @@ else {
|
||||
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
|
||||
ORDER BY totalpop DESC, totalvillages DESC, username ASC";
|
||||
|
||||
$result = (mysqli_query($GLOBALS['link'],$q));
|
||||
$result = (mysqli_query($database->dblink,$q));
|
||||
while($row = mysqli_fetch_assoc($result))
|
||||
{
|
||||
$datas[] = $row;
|
||||
@@ -96,7 +96,7 @@ else {
|
||||
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 = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink));
|
||||
$result = mysqli_query($database->dblink,$q) or die(mysqli_error($database->dblink));
|
||||
while($row = mysqli_fetch_assoc($result))
|
||||
{
|
||||
$attacker[] = $row;
|
||||
@@ -123,7 +123,7 @@ else {
|
||||
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 = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink));
|
||||
$result = mysqli_query($database->dblink,$q) or die(mysqli_error($database->dblink));
|
||||
while($row = mysqli_fetch_assoc($result))
|
||||
{
|
||||
$defender[] = $row;
|
||||
@@ -138,25 +138,25 @@ else {
|
||||
}
|
||||
|
||||
## Get WW Winner Details
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
|
||||
$sql = mysqli_query($database->dblink,"SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
|
||||
$vref = mysqli_result($sql, 0);
|
||||
|
||||
$winningvillagename = $database->getVillage($vref)['name'];
|
||||
$owner = $database->getVillage($vref)['owner'];
|
||||
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT username FROM ".TB_PREFIX."users WHERE id = '$owner'")or die(mysqli_error($database->dblink));
|
||||
$sql = mysqli_query($database->dblink,"SELECT username FROM ".TB_PREFIX."users WHERE id = '$owner'")or die(mysqli_error($database->dblink));
|
||||
$username = mysqli_result($sql, 0);
|
||||
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT alliance FROM ".TB_PREFIX."users WHERE id = '$owner'")or die(mysqli_error($database->dblink));
|
||||
$sql = mysqli_query($database->dblink,"SELECT alliance FROM ".TB_PREFIX."users WHERE id = '$owner'")or die(mysqli_error($database->dblink));
|
||||
$allianceid = mysqli_result($sql, 0);
|
||||
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT name, tag FROM ".TB_PREFIX."alidata WHERE id = '$allianceid'")or die(mysqli_error($database->dblink));
|
||||
$sql = mysqli_query($database->dblink,"SELECT name, tag FROM ".TB_PREFIX."alidata WHERE id = '$allianceid'")or die(mysqli_error($database->dblink));
|
||||
$winningalliance = mysqli_result($sql, 0);
|
||||
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT tag FROM ".TB_PREFIX."alidata WHERE id = '$allianceid'")or die(mysqli_error($database->dblink));
|
||||
$sql = mysqli_query($database->dblink,"SELECT tag FROM ".TB_PREFIX."alidata WHERE id = '$allianceid'")or die(mysqli_error($database->dblink));
|
||||
$winningalliancetag = mysqli_result($sql, 0);
|
||||
|
||||
$sql = mysqli_query($GLOBALS['link'],"SELECT ww_lastupdate FROM ".TB_PREFIX."fdata WHERE vref = '$vref'");
|
||||
$sql = mysqli_query($database->dblink,"SELECT ww_lastupdate FROM ".TB_PREFIX."fdata WHERE vref = '$vref'");
|
||||
$finishconstruction = mysqli_result($sql, 0);
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
Reference in New Issue
Block a user