finish hero_full.php

This commit is contained in:
yi12345
2013-06-16 10:38:34 +03:00
commit 98e94af807
2800 changed files with 115529 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
+104
View File
@@ -0,0 +1,104 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename addTroops.php ##
## Developed by: Dzoki & Advocatie ##
## License: TravianX Project ##
## Thanks to: Dzoki & itay2277 (edit troops) ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
include_once("../../Account.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$id = $_POST['id'];
$village = $database->getVillage($id);
$user = $database->getUserArray($village['owner'],1);
$coor = $database->getCoor($village['wref']);
$varray = $database->getProfileVillages($village['owner']);
$type = $database->getVillageType($village['wref']);
$fdata = $database->getResourceLevel($village['wref']);
$units = $database->getUnit($village['wref']);
$u1 = $_POST['u1'];
$u2 = $_POST['u2'];
$u3 = $_POST['u3'];
$u4 = $_POST['u4'];
$u5 = $_POST['u5'];
$u6 = $_POST['u6'];
$u7 = $_POST['u7'];
$u8 = $_POST['u8'];
$u9 = $_POST['u9'];
$u10 = $_POST['u10'];
////////////////////
$u11 = $_POST['u11'];
$u12 = $_POST['u12'];
$u13 = $_POST['u13'];
$u14 = $_POST['u14'];
$u15 = $_POST['u15'];
$u16 = $_POST['u16'];
$u17 = $_POST['u17'];
$u18 = $_POST['u18'];
$u19 = $_POST['u19'];
$u20 = $_POST['u20'];
////////////////////
$u21 = $_POST['u21'];
$u22 = $_POST['u22'];
$u23 = $_POST['u23'];
$u24 = $_POST['u24'];
$u25 = $_POST['u25'];
$u26 = $_POST['u26'];
$u27 = $_POST['u27'];
$u28 = $_POST['u28'];
$u29 = $_POST['u29'];
$u30 = $_POST['u30'];
////////////////////
$u31 = $_POST['u31'];
$u32 = $_POST['u32'];
$u33 = $_POST['u33'];
$u34 = $_POST['u34'];
$u35 = $_POST['u35'];
$u36 = $_POST['u36'];
$u37 = $_POST['u37'];
$u38 = $_POST['u38'];
$u39 = $_POST['u39'];
$u40 = $_POST['u40'];
////////////////////
$u41 = $_POST['u41'];
$u42 = $_POST['u42'];
$u43 = $_POST['u43'];
$u44 = $_POST['u44'];
$u45 = $_POST['u45'];
$u46 = $_POST['u46'];
$u47 = $_POST['u47'];
$u48 = $_POST['u48'];
$u49 = $_POST['u49'];
$u50 = $_POST['u50'];
if($user['tribe'] == 1){
$q = "UPDATE ".TB_PREFIX."units SET u1 = $u1, u2 = $u2, u3 = $u3, u4 = $u4, u5 = $u5, u6 = $u6, u7 = $u7, u8 = $u8, u9 = $u9, u10 = $u10 WHERE vref = $id";
mysql_query($q);
} else if($user['tribe'] == 2){
$q = "UPDATE ".TB_PREFIX."units SET u11 = '$u11', u12 = '$u12', u13 = '$u13', u14 = '$u14', u15 = '$u15', u16 = '$u16', u17 = '$u17', u18 = '$u18', u19 = '$u19', u20 = '$u20' WHERE vref = $id";
mysql_query($q);
} else if($user['tribe'] == 3){
$q = "UPDATE ".TB_PREFIX."units SET u21 = '$u21', u22 = '$u22', u23 = '$u23', u24 = '$u24', u25 = '$u25', u26 = '$u26', u27 = '$u27', u28 = '$u28', u29 = '$u29', u30 = '$u30' WHERE vref = $id";
mysql_query($q);
} else if($user['tribe'] == 4){
$q = "UPDATE ".TB_PREFIX."units SET u31 = '$u31', u32 = '$u32', u33 = '$u33', u34 = '$u34', u35 = '$u35', u36 = '$u36', u37 = '$u37', u38 = '$u38', u39 = '$u39', u40 = '$u40' WHERE vref = $id";
mysql_query($q);
} else if($user['tribe'] == 5){
$q = "UPDATE ".TB_PREFIX."units SET u41 = '$u41', u42 = '$u42', u43 = '$u43', u44 = '$u44', u45 = '$u45', u46 = '$u46', u47 = '$u47', u48 = '$u48', u49 = '$u49', u50 = '$u50' WHERE vref = $id";
mysql_query($q);
}
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Changed troop anmount in village <a href=\'admin.php?p=village&did=$id\'>$id</a> ',".time().")");
header("Location: ../../../Admin/admin.php?p=addTroops&did=".$id."&d");
?>
+29
View File
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename cp.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$id = $_POST['id'];
$admid = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$admid."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET cp = cp + ".$_POST['cp']." WHERE id = ".$id."");
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+30
View File
@@ -0,0 +1,30 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename delallymedal.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$delete = $_POST['medalid'];
$aid = $_POST['aid'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."allimedal set del = 1 WHERE id = ".$delete."");
header("Location: ../../../Admin/admin.php?p=alliance&aid=".$aid."");
?>
@@ -0,0 +1,30 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename deletemedalsbyuser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$allyid = $_POST['allyid'];
$aid = $_POST['aid'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."allimedal set del = 1 WHERE allyid = ".$aid."");
header("Location: ../../../Admin/admin.php?p=alliance&aid=".$aid."");
?>
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename deletemedalsbyweek.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$deleteweek = $_POST['deleteweek'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."allimedal set del = 1 WHERE week = ".$deleteweek."");
header("Location: ../../../Admin/admin.php?p=delallymedal");
?>
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename deletemedalsbyuser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$userid = $_POST['userid'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."medal set del = 1 WHERE userid = ".$userid."");
header("Location: ../../../Admin/admin.php?p=player&uid=".$userid."");
?>
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename deletemedalsbyweek.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$deleteweek = $_POST['medalweek'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."medal set del = 1 WHERE week = ".$deleteweek."");
header("Location: ../../../Admin/admin.php?p=delmedal");
?>
+33
View File
@@ -0,0 +1,33 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['uid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$access = $_POST['access'];
mysql_query("UPDATE ".TB_PREFIX."users SET
access = ".$access."
WHERE id = ".$id."") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+110
View File
@@ -0,0 +1,110 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editBuildings.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."fdata SET
f1 = '".$_POST['id1level']."',
f1t = '".$_POST['id1gid']."',
f2 = '".$_POST['id2level']."',
f2t = '".$_POST['id2gid']."',
f3 = '".$_POST['id3level']."',
f3t = '".$_POST['id3gid']."',
f4 = '".$_POST['id4level']."',
f4t = '".$_POST['id4gid']."',
f5 = '".$_POST['id5level']."',
f5t = '".$_POST['id5gid']."',
f6 = '".$_POST['id6level']."',
f6t = '".$_POST['id6gid']."',
f7 = '".$_POST['id7level']."',
f7t = '".$_POST['id7gid']."',
f8 = '".$_POST['id8level']."',
f8t = '".$_POST['id8gid']."',
f9 = '".$_POST['id9level']."',
f9t = '".$_POST['id9gid']."',
f10 = '".$_POST['id10level']."',
f10t = '".$_POST['id10gid']."',
f11 = '".$_POST['id11level']."',
f11t = '".$_POST['id11gid']."',
f12 = '".$_POST['id12level']."',
f12t = '".$_POST['id12gid']."',
f13 = '".$_POST['id13level']."',
f13t = '".$_POST['id13gid']."',
f14 = '".$_POST['id14level']."',
f14t = '".$_POST['id14gid']."',
f15 = '".$_POST['id15level']."',
f15t = '".$_POST['id15gid']."',
f16 = '".$_POST['id16level']."',
f16t = '".$_POST['id16gid']."',
f17 = '".$_POST['id17level']."',
f17t = '".$_POST['id17gid']."',
f18 = '".$_POST['id18level']."',
f18t = '".$_POST['id18gid']."',
f19 = '".$_POST['id19level']."',
f19t = '".$_POST['id19gid']."',
f20 = '".$_POST['id20level']."',
f20t = '".$_POST['id20gid']."',
f21 = '".$_POST['id21level']."',
f21t = '".$_POST['id21gid']."',
f22 = '".$_POST['id22level']."',
f22t = '".$_POST['id22gid']."',
f23 = '".$_POST['id23level']."',
f23t = '".$_POST['id23gid']."',
f24 = '".$_POST['id24level']."',
f24t = '".$_POST['id24gid']."',
f25 = '".$_POST['id25level']."',
f25t = '".$_POST['id25gid']."',
f26 = '".$_POST['id26level']."',
f26t = '".$_POST['id26gid']."',
f27 = '".$_POST['id27level']."',
f27t = '".$_POST['id27gid']."',
f28 = '".$_POST['id28level']."',
f28t = '".$_POST['id28gid']."',
f29 = '".$_POST['id29level']."',
f29t = '".$_POST['id29gid']."',
f30 = '".$_POST['id30level']."',
f30t = '".$_POST['id30gid']."',
f31 = '".$_POST['id31level']."',
f31t = '".$_POST['id31gid']."',
f32 = '".$_POST['id32level']."',
f32t = '".$_POST['id32gid']."',
f33 = '".$_POST['id33level']."',
f33t = '".$_POST['id33gid']."',
f34 = '".$_POST['id34level']."',
f34t = '".$_POST['id34gid']."',
f35 = '".$_POST['id35level']."',
f35t = '".$_POST['id35gid']."',
f36 = '".$_POST['id36level']."',
f36t = '".$_POST['id36gid']."',
f37 = '".$_POST['id37level']."',
f37t = '".$_POST['id37gid']."',
f38 = '".$_POST['id38level']."',
f38t = '".$_POST['id38gid']."',
f39 = '".$_POST['id39level']."',
f39t = '".$_POST['id39gid']."',
f40 = '".$_POST['id40level']."',
f40t = '".$_POST['id40gid']."'
WHERE vref = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?action=recountPop&did=".$id."");
?>
+32
View File
@@ -0,0 +1,32 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET
apall = '".$_POST['off']."',
dpall = '".$_POST['def']."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+32
View File
@@ -0,0 +1,32 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['uid'];
$pass = md5($_POST['newpw']);
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET
password = '".$pass."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+70
View File
@@ -0,0 +1,70 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$pdur = $_POST['plus'] * 86400;
$b1dur = $_POST['wood'] * 86400;
$b2dur = $_POST['clay'] * 86400;
$b3dur = $_POST['iron'] * 86400;
$b4dur = $_POST['crop'] * 86400;
$sql1 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$id."");
$user = mysql_fetch_array($sql1);
if($user['plus'] < time()){
if($pdur > 1){ $plus = (time() + $pdur); } else { $plus = time(); }
}else{
if($pdur > 1){ $plus = ($user['plus'] + $pdur); } else { $plus = $user['plus']; }
}
if($user['b1'] < time()){
if($b1dur > 1){ $wood = (time() + $b1dur); } else { $wood = time(); }
}else{
if($b1dur > 1){ $wood = ($user['b1'] + $b1dur); } else { $wood = $user['b1']; }
}
if($user['b2'] < time()){
if($b2dur > 1){ $clay = (time() + $b2dur); } else { $clay = time(); }
}else{
if($b2dur > 1){ $clay = ($user['b2'] + $b2dur); } else { $clay = $user['b2']; }
}
if($user['b3'] < time()){
if($b3dur > 1){ $iron = (time() + $b3dur); } else { $iron = time(); }
}else{
if($b3dur > 1){ $iron = ($user['b3'] + $b3dur); } else { $iron = $user['b3']; }
}
if($user['b4'] < time()){
if($b4dur > 1){ $crop = (time() + $b4dur); } else { $crop = time(); }
}else{
if($b4dur > 1){ $crop = ($user['b4'] + $b4dur); } else { $crop = $user['b4']; }
}
mysql_query("UPDATE ".TB_PREFIX."users SET
plus = '".$plus."',
b1 = '".$wood."',
b2 = '".$clay."',
b3 = '".$iron."',
b4 = '".$crop."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+34
View File
@@ -0,0 +1,34 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$dur = $_POST['protect'] * 86400;
$protection = (time() + $dur);
mysql_query("UPDATE ".TB_PREFIX."users SET
protect = '".$protection."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+36
View File
@@ -0,0 +1,36 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editResources.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['did'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."vdata SET
wood = '".$_POST['wood']."',
clay = '".$_POST['clay']."',
iron = '".$_POST['iron']."',
crop = '".$_POST['crop']."',
maxstore = '".$_POST['maxstore']."',
maxcrop = '".$_POST['maxcrop']."'
WHERE wref = '".$id."'") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=village&did=".$id."");
?>
+32
View File
@@ -0,0 +1,32 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET
sit1 = '".$_POST['sitter1']."',
sit2 = '".$_POST['sitter2']."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+36
View File
@@ -0,0 +1,36 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET
email = '".$_POST['email']."',
tribe = ".$_POST['tribe'].",
location = '".$_POST['location']."',
desc1 = '".$_POST['desc1']."',
desc2 = '".$_POST['desc2']."',
quest = '".$_POST['quest']."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+29
View File
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename deletemedalsbyuser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$uid = $_POST['uid'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET username = '".$_POST['username']."' WHERE id = ".$uid."");
header("Location: ../../../Admin/admin.php?p=player&uid=".$uid."");
?>
@@ -0,0 +1,31 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['did'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."vdata SET
owner = '".$_POST['newowner']."'
WHERE wref = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$_POST['newowner']."");
?>
+33
View File
@@ -0,0 +1,33 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET
ap = '".$_POST['off']."',
dp = '".$_POST['def']."',
RR = '".$_POST['res']."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+44
View File
@@ -0,0 +1,44 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceBan.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$sql = "SELECT id FROM ".TB_PREFIX."users ORDER BY ID DESC LIMIT 1";
$loops = mysql_result(mysql_query($sql), 0);
$plusdur = $_POST['plus'] * 86400;
for($i = 0; $i < $loops + 1; $i++)
{
$query = "SELECT * FROM ".TB_PREFIX."users WHERE id = ".$i."";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
if($row['plus'] < time()) { $plusbefore = time(); $addplus = $plusbefore + $plusdur; } elseif($row['plus'] > time()) { $plusbefore = $row['plus']; $addplus = $plusbefore + $plusdur; }
mysql_query("UPDATE ".TB_PREFIX."users SET
plus = '".$addplus."'
WHERE id = '".$row['id']."'");
}
}
header("Location: ../../../Admin/admin.php?p=givePlus&g");
?>
+53
View File
@@ -0,0 +1,53 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceBan.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$sql = "SELECT id FROM ".TB_PREFIX."users ORDER BY ID DESC LIMIT 1";
$loops = mysql_result(mysql_query($sql), 0);
$wood = $_POST['wood'] * 86400;
$clay = $_POST['clay'] * 86400;
$iron = $_POST['iron'] * 86400;
$crop = $_POST['crop'] * 86400;
for($i = 0; $i < $loops + 1; $i++)
{
$query = "SELECT * FROM ".TB_PREFIX."users WHERE id = ".$i."";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
if($row['b1'] < time()) { $b1before = time(); $addb1 = $b1before + $wood; } elseif($row['b1'] > time()) { $b1before = $row['b1']; $addb1 = $b1before + $wood; }
if($row['b2'] < time()) { $b2before = time(); $addb2 = $b1before + $clay; } elseif($row['b2'] > time()) { $b2before = $row['b2']; $addb2 = $b1before + $clay; }
if($row['b3'] < time()) { $b3before = time(); $addb3 = $b1before + $iron; } elseif($row['b3'] > time()) { $b3before = $row['b3']; $addb3 = $b1before + $iron; }
if($row['b4'] < time()) { $b4before = time(); $addb4 = $b1before + $crop; } elseif($row['b4'] > time()) { $b4before = $row['b4']; $addb4 = $b1before + $crop; }
mysql_query("UPDATE ".TB_PREFIX."users SET
b1 = '".$addb1."',
b2 = '".$addb2."',
b3 = '".$addb3."',
b4 = '".$addb4."'
WHERE id = '".$row['id']."'");
}
}
header("Location: ../../../Admin/admin.php?p=givePlusRes&g");
?>
+31
View File
@@ -0,0 +1,31 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename gold_1.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
error_reporting(E_ALL);
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$q = "UPDATE ".TB_PREFIX."users SET gold = gold + ".$_POST['gold']." WHERE id != '0'";
mysql_query($q) or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=maintenenceResetPlusBonus&g");
?>
+31
View File
@@ -0,0 +1,31 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename gold.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
error_reporting(E_ALL);
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$q = "UPDATE ".TB_PREFIX."users SET gold = gold + ".$_POST['gold']." WHERE id != '0'";
mysql_query($q) or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=gold&g");
?>
+29
View File
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename gold_1.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET gold = gold + ".$_POST['gold']." WHERE id = ".$id."");
header("Location: ../../../Admin/admin.php?p=usergold&g");
?>
+51
View File
@@ -0,0 +1,51 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceBan.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$users = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users"));
$duration = $_POST['duration'] * 3600;
$start = $_POST['start'];
$startts = strtotime($start);
$endts = $startts + $duration;
$reason = $_POST['reason'];
$admin = $session;
$active = '1';
$access = '2';
$sql = "SELECT id FROM ".TB_PREFIX."users ORDER BY ID DESC LIMIT 1";
$loops = mysql_result(mysql_query($sql), 0);
for($i = 0; $i < $loops + 1; $i++)
{
$query = "SELECT * FROM ".TB_PREFIX."users WHERE id = ".$i." AND access = ".$access."";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
##mysql_query("INSERT INTO ".TB_PREFIX."banlist ".$row['id'].", ".$row['username'].", ".$reason.", ".$startts.", ".$endts.", ".$admin.", ".$active."");
mysql_query("INSERT INTO ".TB_PREFIX."banlist (`uid`, `name`, `reason`, `time`, `end`, `admin`, `active`) VALUES (".$row['id'].", '".$row['username']."' , '$reason', '$startts', '$endts', '$admin', '1')");
}
}
header("Location: ../../../Admin/admin.php?p=ban");
?>
@@ -0,0 +1,28 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceCleanBanData.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("TRUNCATE ".TB_PREFIX."banlist");
header("Location: ../../../Admin/admin.php?p=ban");
?>
@@ -0,0 +1,28 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceBan.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET gold = '0' WHERE id !=0");
header("Location: ../../../Admin/admin.php?p=maintenenceResetGold&g");
?>
@@ -0,0 +1,28 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceBan.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET plus = '0' WHERE id !=0");
header("Location: ../../../Admin/admin.php?p=resetPlusBonus&g");
?>
@@ -0,0 +1,28 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceBan.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET b1 = '0', b2 = '0', b3='0', b4='0' WHERE id !=0");
header("Location: ../../../Admin/admin.php?p=givePlus&g");
?>
+47
View File
@@ -0,0 +1,47 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceUnban.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$users = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users"));
$reason = $_POST['unbanreason'];
$admin = $session;
$active = '0';
$access = '2';
$actualend = time();
$sql = "SELECT id FROM ".TB_PREFIX."users ORDER BY ID DESC LIMIT 1";
$loops = mysql_result(mysql_query($sql), 0);
for($i = 0; $i < $loops + 1; $i++)
{
$query = "SELECT * FROM ".TB_PREFIX."users WHERE id = ".$i." AND access = ".$access."";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
mysql_query("UPDATE ".TB_PREFIX."banlist SET active = '".$active."', end = '".$actualend."' WHERE reason = '".$reason."'");
}
}
header("Location: ../../../Admin/admin.php?p=ban");
?>
+34
View File
@@ -0,0 +1,34 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename medals.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
#################################################################################
include_once("../../Account.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
if ($session->access < ADMIN) die("Access Denied: You are not Admin!");
$medalid = $_POST['medalid'];
$uid = $_POST['uid'];
mysql_query("UPDATE ".TB_PREFIX."medal set del = 1 WHERE id = ".$medalid."");
$name = mysql_query("SELECT name FROM ".TB_PREFIX."users WHERE id= ".$uid."");
$name = mysql_result($name, 0);
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$admid,'Deleted medal id [#".$medalid."] from the user <a href=\'admin.php?p=player&uid=$uid\'>$name</a> ',".time().")");
$deleteweek = $_POST['medalweek'];
mysql_query("UPDATE ".TB_PREFIX."medal set del = 1 WHERE week = ".$deleteweek."");
header("Location: ../../../Admin/admin.php?p=player&uid=".$uid."");
?>
@@ -0,0 +1,85 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename natarbuildingplan.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
include_once("../../Session.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$id = $_POST['id'];
$amt = $_POST['vill_amount'];
for($i=1;$i<=$amt;$i++) {
$kid = $_POST['kid'];
$wid = $database->generateBase($kid);
$database->setFieldTaken($wid);
$time = time();
$q = "insert into ".TB_PREFIX."vdata (`wref`,`owner`,`name`,`capital`,`pop`,`cp`,`celebration`,`type`,`wood`,`clay`,`iron`,`maxstore`,`crop`,`maxcrop`,`lastupdate`,`loyalty`,`exp1`,`exp2`,`exp3`,`created`) values ('$wid','3','WW Buildingplan',0,0,0,0,0,80000.00,80000.00,80000.00,80000,80000.00,80000,1314974534,100,0,0,0,1314968914)";
mysql_query($q) or die(mysql_error());
$q = "insert into ".TB_PREFIX."fdata (`vref`,`f1`,`f1t`,`f2`,`f2t`,`f3`,`f3t`,`f4`,`f4t`,`f5`,`f5t`,`f6`,`f6t`,`f7`,`f7t`,`f8`,`f8t`,`f9`,`f9t`,`f10`,`f10t`,`f11`,`f11t`,`f12`,`f12t`,`f13`,`f13t`,`f14`,`f14t`,`f15`,`f15t`,`f16`,`f16t`,`f17`,`f17t`,`f18`,`f18t`,`f19`,`f19t`,`f20`,`f20t`,`f21`,`f21t`,`f22`,`f22t`,`f23`,`f23t`,`f24`,`f24t`,`f25`,`f25t`,`f26`,`f26t`,`f27`,`f27t`,`f28`,`f28t`,`f29`,`f29t`,`f30`,`f30t`,`f31`,`f31t`,`f32`,`f32t`,`f33`,`f33t`,`f34`,`f34t`,`f35`,`f35t`,`f36`,`f36t`,`f37`,`f37t`,`f38`,`f38t`,`f39`,`f39t`,`f40`,`f40t`,`f99`,`f99t`,`wwname`) values ($wid,0,1,0,4,0,1,0,3,0,2,0,2,0,3,0,4,0,4,0,3,0,3,0,4,0,4,0,1,0,4,0,2,0,1,0,2,20,17,20,11,10,27,20,10,10,22,10,25,0,0,20,15,10,19,0,0,0,0,0,0,10,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,0,0,0,0,'World Wonder')";
mysql_query($q);
$pop = $automation->recountPop($wid);
$cp = $automation->recountPop($wid);
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
$speed = NATARS_UNITS;
$q = "UPDATE ".TB_PREFIX."units SET u41 = u41 + " . (1500 * $speed) . ", u42 = u42 + " . (1500 * $speed) . ", u43 = u43 + " . (1500 * $speed) . ", u44 = u44 + " . (1500 * $speed) . ", u45 = u45 + " . (1500 * $speed) . ", u46 = u46 + " . (1500 * $speed) . ", u47 = u47 + " . (1500 * $speed) . ", u48 = u48 + " . (1500 * $speed) . " , u49 = u49 + " . (1500 * $speed) . ", u50 = u50 + " . (1500 * $speed) . " WHERE vref = '".$wid."'";
mysql_query($q);
$desc = 'With this ancient construction plan you will able to build World Wonder to level 50. to build further, your alliance must hold at least two plans.';
$database->addArtefact($wid, 3, 11, 1, 'Ancient Construction Plan', $desc, '', 'typeww.gif');
}
$myFile = "../../../Templates/text.tpl";
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: templates/text.tpl");
$text = file_get_contents("../../../Templates/text_format.tpl");
$text = preg_replace("'%TEKST%'","World Wonder Construction Plans
Many moons ago the tribes of Travian were surprised by the unforeseen return of the Natars. This tribe from immemorial times surpassing all in wisdom, might and glory was about to trouble the free ones again. Thus they put all their efforts in preparing a last war against the Natars and vanquishing them forever. Many thought about the so-called 'Wonders of the World', a construction of many legends, as the only solution. It was told that it would render anyone invincible once completed. Ultimately making the constructors the rulers and conquerors of all known Travian.
However, it was also told that one would need construction plans to construct such a building. Due to this fact, the architects devised cunning plans about how to store these safely. After a while, one could see temple-like buildings in many a city and metropolis - the Treasure Chambers (Treasuries).
Sadly, no one - not even the wise and well versed - knew where to find these construction plans. The harder people tried to locate them, the more it seemed as if they where only legends.
Today, however, this last secret will be revealed. Deprivations and endeavors of the past will not have been in vain, as today scouts of several tribes have successfully obtained the whereabouts of the construction plans. Well guarded by the Natars, they lie hidden in several oases to be found all over Travian. Only the most valiant heroes will be able to secure such a plan and bring it home safely so that the construction can begin.
In the end, we will see whether the free tribes of Travian can once again outwit the Natars and vanquish them once and for all. Do not be so foolish as to assume that the Natars will leave without a fight, though!
To steal a set of Construction Plans from the Natars, the following things must happen:
- You must Attack the village (NOT Raid!)
- You must WIN the Attack
- You must DESTROY the Treasure Chamber (Treasury)
- Your Hero MUST be in that attack, as he is the only one who may carry the Construction Plans
- An empty level 10 Treasure Chamber (Treasury) MUST be in the village where that attack came from
NOTE: If the above criteria is not met during the attack, the next attack on that village which does meet the above criteria will take the Construction Plans.
To build a Treasure Chamber (Treasury), you will need a Main Building level 10 and the village MUST NOT be a Capital or contain a World Wonder.
To build a World Wonder, you must own the Construction Plans yourself (you = the World Wonder Village Owner) from level 0 to 50, and then from level 51 to 100 you will need an additional set of Construction Plans in your Alliance! Two sets of Construction Plans in the World Wonder Village Account will not work!" ,$text);
fwrite($fh, $text);
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
$result=mysql_query($query) or die (mysql_error());
for ($i=0; $row=mysql_fetch_row($result); $i++) {
$updateattquery = mysql_query("UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'")
or die(mysql_error());
}
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$id,'Added <b>$amt</b> WW Buildingplan Villages',".time().")");
header("Location: ../../../Admin/admin.php?p=natarbuildingplan&g");
?>
+45
View File
@@ -0,0 +1,45 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename natarend.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
include_once("../../Session.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$id = $_POST['id'];
$amt = $_POST['vill_amount'];
for($i=1;$i<=$amt;$i++) {
$kid = $_POST['kid'];
$wid = $database->generateBase($kid);
$database->setFieldTaken($wid);
$time = time();
$q = "insert into ".TB_PREFIX."vdata (`wref`,`owner`,`name`,`capital`,`pop`,`cp`,`celebration`,`type`,`wood`,`clay`,`iron`,`maxstore`,`crop`,`maxcrop`,`lastupdate`,`loyalty`,`exp1`,`exp2`,`exp3`,`created`,`natar`) values ('$wid','3','WW village',0,0,0,0,0,80000.00,80000.00,80000.00,80000,80000.00,80000,1314974534,100,0,0,0,$time,1)";
mysql_query($q) or die(mysql_error());
$q = "insert into ".TB_PREFIX."fdata (`vref`,`f1`,`f1t`,`f2`,`f2t`,`f3`,`f3t`,`f4`,`f4t`,`f5`,`f5t`,`f6`,`f6t`,`f7`,`f7t`,`f8`,`f8t`,`f9`,`f9t`,`f10`,`f10t`,`f11`,`f11t`,`f12`,`f12t`,`f13`,`f13t`,`f14`,`f14t`,`f15`,`f15t`,`f16`,`f16t`,`f17`,`f17t`,`f18`,`f18t`,`f19`,`f19t`,`f20`,`f20t`,`f21`,`f21t`,`f22`,`f22t`,`f23`,`f23t`,`f24`,`f24t`,`f25`,`f25t`,`f26`,`f26t`,`f27`,`f27t`,`f28`,`f28t`,`f29`,`f29t`,`f30`,`f30t`,`f31`,`f31t`,`f32`,`f32t`,`f33`,`f33t`,`f34`,`f34t`,`f35`,`f35t`,`f36`,`f36t`,`f37`,`f37t`,`f38`,`f38t`,`f39`,`f39t`,`f40`,`f40t`,`f99`,`f99t`,`wwname`) values ($wid,0,1,0,4,0,1,0,3,0,2,0,2,0,3,0,4,0,4,0,3,0,3,0,4,0,4,0,1,0,4,0,2,0,1,0,2,20,17,20,11,20,15,20,10,10,22,10,25,0,0,0,0,10,19,0,0,0,0,0,0,10,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,0,0,0,40,'World Wonder')";
mysql_query($q);
$pop = $automation->recountPop($wid);
$cp = $automation->recountPop($wid);
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
$q = "UPDATE ".TB_PREFIX."units SET u41 = u41 + " . (1500 * $speed) . ", u42 = u42 + " . (1500 * $speed) . ", u43 = u43 + " . (1500 * $speed) . ", u44 = u44 + " . (1500 * $speed) . ", u45 = u45 + " . (1500 * $speed) . ", u46 = u46 + " . (1500 * $speed) . ", u47 = u47 + " . (1500 * $speed) . ", u48 = u48 + " . (1500 * $speed) . " , u49 = u49 + " . (1500 * $speed) . ", u50 = u50 + " . (1500 * $speed) . " WHERE vref = '".$wid."'";
mysql_query($q);
}
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$id,'Added <b>$amt</b> WW Villages',".time().")");
header("Location: ../../../Admin/admin.php?p=natarend&g");
?>
+110
View File
@@ -0,0 +1,110 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editBuildings.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."fdata SET
f1 = '".$_POST['id1level']."',
f1t = '".$_POST['id1gid']."',
f2 = '".$_POST['id2level']."',
f2t = '".$_POST['id2gid']."',
f3 = '".$_POST['id3level']."',
f3t = '".$_POST['id3gid']."',
f4 = '".$_POST['id4level']."',
f4t = '".$_POST['id4gid']."',
f5 = '".$_POST['id5level']."',
f5t = '".$_POST['id5gid']."',
f6 = '".$_POST['id6level']."',
f6t = '".$_POST['id6gid']."',
f7 = '".$_POST['id7level']."',
f7t = '".$_POST['id7gid']."',
f8 = '".$_POST['id8level']."',
f8t = '".$_POST['id8gid']."',
f9 = '".$_POST['id9level']."',
f9t = '".$_POST['id9gid']."',
f10 = '".$_POST['id10level']."',
f10t = '".$_POST['id10gid']."',
f11 = '".$_POST['id11level']."',
f11t = '".$_POST['id11gid']."',
f12 = '".$_POST['id12level']."',
f12t = '".$_POST['id12gid']."',
f13 = '".$_POST['id13level']."',
f13t = '".$_POST['id13gid']."',
f14 = '".$_POST['id14level']."',
f14t = '".$_POST['id14gid']."',
f15 = '".$_POST['id15level']."',
f15t = '".$_POST['id15gid']."',
f16 = '".$_POST['id16level']."',
f16t = '".$_POST['id16gid']."',
f17 = '".$_POST['id17level']."',
f17t = '".$_POST['id17gid']."',
f18 = '".$_POST['id18level']."',
f18t = '".$_POST['id18gid']."',
f19 = '".$_POST['id19level']."',
f19t = '".$_POST['id19gid']."',
f20 = '".$_POST['id20level']."',
f20t = '".$_POST['id20gid']."',
f21 = '".$_POST['id21level']."',
f21t = '".$_POST['id21gid']."',
f22 = '".$_POST['id22level']."',
f22t = '".$_POST['id22gid']."',
f23 = '".$_POST['id23level']."',
f23t = '".$_POST['id23gid']."',
f24 = '".$_POST['id24level']."',
f24t = '".$_POST['id24gid']."',
f25 = '".$_POST['id25level']."',
f25t = '".$_POST['id25gid']."',
f26 = '".$_POST['id26level']."',
f26t = '".$_POST['id26gid']."',
f27 = '".$_POST['id27level']."',
f27t = '".$_POST['id27gid']."',
f28 = '".$_POST['id28level']."',
f28t = '".$_POST['id28gid']."',
f29 = '".$_POST['id29level']."',
f29t = '".$_POST['id29gid']."',
f30 = '".$_POST['id30level']."',
f30t = '".$_POST['id30gid']."',
f31 = '".$_POST['id31level']."',
f31t = '".$_POST['id31gid']."',
f32 = '".$_POST['id32level']."',
f32t = '".$_POST['id32gid']."',
f33 = '".$_POST['id33level']."',
f33t = '".$_POST['id33gid']."',
f34 = '".$_POST['id34level']."',
f34t = '".$_POST['id34gid']."',
f35 = '".$_POST['id35level']."',
f35t = '".$_POST['id35gid']."',
f36 = '".$_POST['id36level']."',
f36t = '".$_POST['id36gid']."',
f37 = '".$_POST['id37level']."',
f37t = '".$_POST['id37gid']."',
f38 = '".$_POST['id38level']."',
f38t = '".$_POST['id38gid']."',
f39 = '".$_POST['id39level']."',
f39t = '".$_POST['id39gid']."',
f40 = '".$_POST['id40level']."',
f40t = '".$_POST['id40gid']."'
WHERE vref = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?action=recountPop&did=".$id."");
?>
+31
View File
@@ -0,0 +1,31 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename renameVillage.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$did = $_POST['did'];
$name = $_POST['villagename'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$sql = "UPDATE ".TB_PREFIX."vdata SET name = '$name' WHERE wref = $did";
mysql_query($sql);
header("Location: ../../../Admin/admin.php?p=village&did=".$did."&name=".$name."");
?>
+31
View File
@@ -0,0 +1,31 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename sendMessage.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$query = "INSERT INTO ".TB_PREFIX."mdata (target, owner, topic, message, viewed, time) VALUES ('$uid', 1, '$topic', '$message', 0, '$time')";
mysql_query($query);
header("Location: ../../../Admin/admin.php?p=Newmessage&uid=".$uid."&msg=ok");
?>
+108
View File
@@ -0,0 +1,108 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename admin.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
session_start();
include("../GameEngine/Database.php");
include("../GameEngine/Admin/database.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link REL="shortcut icon" HREF="favicon.ico"/>
<title>Admin Control Panel - TravianX</title>
<link rel=stylesheet type="text/css" href="../img/admin/admin.css">
<link rel=stylesheet type="text/css" href="../img/admin/acp.css">
<link rel=stylesheet type="text/css" href="../img/../img.css">
<script src="mt-full.js?423cb" type="text/javascript"></script>
<script src="ajax.js" type="text/javascript"></script>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="imagetoolbar" content="no">
</head>
<body>
<script language="javascript">
function aktiv() {this.srcElement.className='fl1'; }
function inaktiv() {event.srcElement.className='fl2'; }
function del(e,id){
if(e == 'did'){ var conf = confirm('Dou you really want delete village id '+id+'?'); }
if(e == 'unban'){ var conf = confirm('Dou you really want unban player '+id+'?'); }
if(e == 'stopDel'){ var conf = confirm('Dou you really want stop deleting user '+id+'?'); }
if(conf){return true;}else{return false;}
}
</script>
<div id="ltop1">
<div style="position:relative; width:231px; height:100px; float:left;">
<img src="../img/x.gif" width="1" height="1">
</div>
<img class="fl2" src="../img/admin/x1.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"><img class="fl2" src="../img/admin/x2.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"><img class="fl2" src="../img/admin/x3.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"><img class="fl2" src="../img/admin/x4.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"><img class="fl2" src="../img/admin/x5.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"></div>
<div id="lmidall">
<div id="lmidlc">
<div id="lleft">
<a href="index.php"><img src="../img/en/a/travian0.gif" class="logo_plus" width="116" height="60" border="0"></a>
<table id="navi_table" cellspacing="0" cellpadding="0">
<tr>
<td class="menu">
<?php
if($funct->CheckLogin()){?>
<a href="admin.php">ACP Home</a>
<a href="<?php echo HOMEPAGE; ?>">Homepage</a>
<a href="#"></a><a href="#"></a>
<a href="?p=server_info">Server Info</a>
<a href="?p=online">Online users</a>
<a href="?p=search">Search</a>
<a href="?p=message">Msg/Rep</a>
<a href="?p=ban">Ban</a>
<a href="?p=config">Config</a>
<a href="?p=config_editor">Config Editor</a>
<a href="#"></a><a href="#"></a><a href="#"></a>
<a href="?action=logout">Logout</a>
<?php }?>
</td>
</tr>
</table></div>
<div id="lmid1">
<div id="lmid3">
<?php
if($funct->CheckLogin()){
if($_POST or $_GET){
if($_GET['p'] and $_GET['p']!="search"){
$filename = '../Templates/Admin/'.$_GET['p'].'.tpl';
if(file_exists($filename)){
include($filename);
}else{
include('../Templates/Admin/404.tpl');
}
}else{
include('../Templates/Admin/search.tpl');
}
if($_POST['p'] and $_POST['s']){
$filename = '../Templates/Admin/results_'.$_POST['p'].'.tpl';
if(file_exists($filename)){
include($filename);
}else{
include('../Templates/Admin/404.tpl');
}
}
}else{
include('../Templates/Admin/home.tpl');
}
}else{
+70
View File
@@ -0,0 +1,70 @@
var http_request = false;
function macheRequest(url, id)
{
http_request = false;
if (window.XMLHttpRequest)
{ // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType)
{
http_request.overrideMimeType('text/xml');
// zu dieser Zeile siehe weiter unten
}
}
else if (window.ActiveXObject)
{ // IE
try
{
http_request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
}
}
}
if (!http_request)
{
alert('Ende :( Kann keine XMLHTTP-Instanz erzeugen');
return false;
}
http_request.onreadystatechange = function()
{
alertInhalt2(id);
};
http_request.open('GET', url, true);
http_request.send(null);
}
function alertInhalt2(id)
{
if (http_request.readyState == 4)
{
if (http_request.status == 200)
{
// alert(http_request.responseText);
myElement = document.getElementById(id);
if (myElement != null)
{
myElement.innerHTML = http_request.responseText;
}
}
else
{
alert('Bei dem Request ist ein Problem aufgetreten.');
}
}
}
+348
View File
@@ -0,0 +1,348 @@
<?php
#################################################################################
## ##
## -= YOU MUST NOT REMOVE OR CHANGE THIS NOTICE =- ##
## ##
## --------------------------------------------------------------------------- ##
## ##
## Project: ZravianX ##
## Version: 2011.11.07 ##
## Filename: GameEngine/Admin/database.php ##
## Developed by: Dzoki ##
## Edited by: ZZJHONS ##
## License: Creative Commons BY-NC-SA 3.0 ##
## Copyright: ZravianX (c) 2011 - All rights reserved ##
## URLs: http://zravianx.zzjhons.com ##
## Source code: http://www.github.com/ZZJHONS/ZravianX ##
## ##
#################################################################################
if($gameinstall == 1){
include("../../GameEngine/config.php");
include("../../GameEngine/Data/buidata.php");
}else{
include("../GameEngine/config.php");
include("../GameEngine/Data/buidata.php");
}
class adm_DB {
var $connection;
function adm_DB(){
global $database;
$this->connection = mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
mysql_select_db(SQL_DB, $this->connection) or die(mysql_error());
}
function Login($username,$password){
$q = "SELECT password FROM ".TB_PREFIX."users where username = '$username' and access >= ".MULTIHUNTER;
$result = mysql_query($q, $this->connection);
$dbarray = mysql_fetch_array($result);
if($dbarray['password'] == md5($password)) {
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,'X','$username logged in (IP: <b>".$_SERVER['REMOTE_ADDR']."</b>)',".time().")");
return true;
}
else {
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,'X','<font color=\'red\'><b>IP: ".$_SERVER['REMOTE_ADDR']." tried to log in with username <u> $username</u> but access was denied!</font></b>',".time().")");
return false;
}
}
function recountPopUser($uid){
global $database;
$villages = $database->getProfileVillages($uid);
for ($i = 0; $i <= count($villages)-1; $i++) {
$vid = $villages[$i]['wref'];
$this->recountPop($vid);
$this->recountCP($vid);
}
}
function recountPop($vid){
global $database;
$fdata = $database->getResourceLevel($vid);
$popTot = 0;
for ($i = 1; $i <= 40; $i++) {
$lvl = $fdata["f".$i];
$building = $fdata["f".$i."t"];
if($building){
$popTot += $this->buildingPOP($building,$lvl);
}
}
$q = "UPDATE ".TB_PREFIX."vdata set pop = $popTot where wref = $vid";
mysql_query($q, $this->connection);
}
function recountCP($vid){
global $database;
$fdata = $database->getResourceLevel($vid);
$popTot = 0;
for ($i = 1; $i <= 40; $i++) {
$lvl = $fdata["f".$i];
$building = $fdata["f".$i."t"];
if($building){
$popTot += $this->buildingCP($building,$lvl);
}
}
$q = "UPDATE ".TB_PREFIX."vdata set cp = $popTot where wref = $vid";
mysql_query($q, $this->connection);
}
function buildingPOP($f,$lvl){
$name = "bid".$f;
global $$name;
$popT = 0;
$dataarray = $$name;
for ($i = 0; $i <= $lvl; $i++) {
$popT += $dataarray[$i]['pop'];
}
return $popT;
}
function buildingCP($f,$lvl){
$name = "bid".$f;
global $$name;
$popT = 0;
$dataarray = $$name;
for ($i = 0; $i <= $lvl; $i++) {
$popT += $dataarray[$i]['cp'];
}
return $popT;
}
function getWref($x,$y) {
$q = "SELECT id FROM ".TB_PREFIX."wdata where x = $x and y = $y";
$result = mysql_query($q, $this->connection);
$r = mysql_fetch_array($result);
return $r['id'];
}
function AddVillage($post){
global $database;
$wid = $this->getWref($post['x'],$post['y']);
$uid = $post['uid'];
$status = $database->getVillageState($wid);
$status = 0;
if($status == 0){
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Added new village <b><a href=\'admin.php?p=village&did=$wid\'>$wid</a></b> to user <b><a href=\'admin.php?p=player&uid=$uid\'>$uid</a></b>',".time().")");
$database->setFieldTaken($wid);
$database->addVillage($wid,$uid,'new village','0');
$database->addResourceFields($wid,$database->getVillageType($wid));
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
}
}
function Punish($post){
global $database;
$villages = $database->getProfileVillages($post['uid']);
$admid = $post['admid'];
$user = $database->getUserArray($post['uid'],1);
for ($i = 0; $i <= count($villages)-1; $i++) {
$vid = $villages[$i]['wref'];
if($post['punish']){
$popOld = $villages[$i]['pop'];
$proc = 100-$post['punish'];
$pop = floor(($popOld/100)*($proc));
if($pop <= 1 ){$pop = 2;}
$this->PunishBuilding($vid,$proc,$pop);
}
if($post['del_troop']){
if($user['tribe'] == 1) {
$unit = 1;
}else if($user['tribe'] == 2) {
$unit = 11;
}else if($user['tribe'] == 3) {
$unit = 21;
}
$this->DelUnits($villages[$i]['wref'],$unit);
}
if($post['clean_ware']){
$time = time();
$q = "UPDATE ".TB_PREFIX."vdata SET `wood` = '0', `clay` = '0', `iron` = '0', `crop` = '0', `lastupdate` = '$time' WHERE wref = $vid;";
mysql_query($q, $this->connection);
}
}
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Punished user: <a href=\'admin.php?p=player&uid=".$post['uid']."\'>".$post['uid']."</a> with <b>-".$post['punish']."%</b> population',".time().")");
}
function PunishBuilding($vid,$proc,$pop){
global $database;
$q = "UPDATE ".TB_PREFIX."vdata set pop = $pop where wref = $vid;";
mysql_query($q, $this->connection);
$fdata = $database->getResourceLevel($vid);
for ($i = 1; $i <= 40; $i++) {
if($fdata['f'.$i]>1){
$zm = ($fdata['f'.$i]/100)*$proc;
if($zm < 1){$zm = 1;}else{$zm = floor($zm);}
$q = "UPDATE ".TB_PREFIX."fdata SET `f$i` = '$zm' WHERE `vref` = $vid;";
mysql_query($q, $this->connection);
}
}
}
function DelUnits($vid,$unit){
for ($i = $unit; $i <= 9+$unit; $i++) {
$this->DelUnits2($vid,$unit);
}
}
function DelUnits2($vid,$unit){
$q = "UPDATE ".TB_PREFIX."units SET `u$unit` = '0' WHERE `vref` = $vid;";
mysql_query($q, $this->connection);
}
function DelPlayer($uid,$pass){
global $database;
$ID = $_SESSION['id'];//$database->getUserField($_SESSION['username'],'id',1);
if($this->CheckPass($pass,$ID)){
$villages = $database->getProfileVillages($uid);
for ($i = 0; $i <= count($villages)-1; $i++) {
$this->DelVillage($villages[$i]['wref']);
}
$name = $database->getUserField($uid,"username",0);
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$ID,'Deleted user <a>$name</a>',".time().")");
$q = "DELETE FROM ".TB_PREFIX."users WHERE `id` = $uid;";
mysql_query($q, $this->connection);
}
}
function getUserActive() {
$time = time() - (60*5);
$q = "SELECT * FROM ".TB_PREFIX."users where timestamp > $time and username != 'support'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function CheckPass($password,$uid){
$q = "SELECT password FROM ".TB_PREFIX."users where id = '$uid' and access = ".ADMIN;
$result = mysql_query($q, $this->connection);
$dbarray = mysql_fetch_array($result);
if($dbarray['password'] == md5($password)) {
return true;
}else{
return false;
}
}
function DelVillage($wref){
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `wref` = $wref and capital = 0";
$result = mysql_query($q, $this->connection);
if(mysql_num_rows($result) > 0){
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Deleted village <b>$wref</b>',".time().")");
$q = "DELETE FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."units WHERE `vref` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."bdata WHERE `wid` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."abdata WHERE `wid` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."fdata WHERE `vref` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."training WHERE `vref` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."movement WHERE `from` = $wref";
mysql_query($q, $this->connection);
$q = "UPDATE ".TB_PREFIX."wdata SET `occupied` = '0' WHERE `id` = $wref";
mysql_query($q, $this->connection);
}
}
function DelBan($uid,$id){
global $database;
$name = addslashes($database->getUserField($uid,"username",0));
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Unbanned user <a href=\'admin.php?p=player&uid=$uid\'>$name</a>',".time().")");
$q = "UPDATE ".TB_PREFIX."users SET `access` = '".USER."' WHERE `id` = $uid;";
mysql_query($q, $this->connection);
$q = "UPDATE ".TB_PREFIX."banlist SET `active` = '0' WHERE `id` = $id;";
mysql_query($q, $this->connection);
}
function AddBan($uid,$end,$reason){
global $database;
$name = addslashes($database->getUserField($uid,"username",0));
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Banned user <a href=\'admin.php?p=player&uid=$uid\'>$name</a>',".time().")");
$q = "UPDATE ".TB_PREFIX."users SET `access` = '0' WHERE `id` = $uid;";
mysql_query($q, $this->connection);
$time = time();
$admin = $_SESSION['id']; //$database->getUserField($_SESSION['username'],'id',1);
$name = addslashes($database->getUserField($uid,'username',0));
$q = "INSERT INTO ".TB_PREFIX."banlist (`uid`, `name`, `reason`, `time`, `end`, `admin`, `active`) VALUES ($uid, '$name' , '$reason', '$time', '$end', '$admin', '1');";
mysql_query($q, $this->connection);
}
function search_player($player){
$q = "SELECT id,username FROM ".TB_PREFIX."users WHERE `username` LIKE '%$player%' and username != 'support'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function search_email($email){
$q = "SELECT id,email FROM ".TB_PREFIX."users WHERE `email` LIKE '%$email%' and username != 'support'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function search_village($village){
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `name` LIKE '%$village%' or `wref` LIKE '%$village%'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function search_alliance($alliance){
$q = "SELECT * FROM ".TB_PREFIX."alidata WHERE `name` LIKE '%$alliance%' or `tag` LIKE '%$alliance%' or `id` LIKE '%$alliance%'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function search_ip($ip){
$q = "SELECT * FROM ".TB_PREFIX."login_log WHERE `ip` LIKE '%$ip%'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function search_banned(){
$q = "SELECT * FROM ".TB_PREFIX."banlist where active = '1'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function Del_banned(){
//$q = "SELECT * FROM ".TB_PREFIX."banlist";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
/***************************
Function to process MYSQLi->fetch_all (Only exist in MYSQL)
References: Result
***************************/
function mysql_fetch_all($result) {
$all = array();
if($result) {
while ($row = mysql_fetch_assoc($result)){ $all[] = $row; }
return $all;
}
}
function query_return($q) {
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
/***************************
Function to do free query
References: Query
***************************/
function query($query) {
return mysql_query($query, $this->connection);
}
};
$admin = new adm_DB;
include("function.php");
?>
+168
View File
@@ -0,0 +1,168 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename function.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class funct {
function CheckLogin(){
if($_SESSION['access'] >= MULTIHUNTER and $_SESSION['id']){
return true;
}else{
return false;
}
}
function Act($get){
global $admin,$database;
switch($get['action']){
case recountPop:
$admin->recountPop($get['did']);
$admin->recountCP($get['did']);
break;
case recountPopUsr:
$admin->recountPopUser($get['uid']);
break;
case StopDel:
//stop deleting
break;
case delVil:
$admin->DelVillage($get['did']);
break;
case delBan:
$admin->DelBan($get['uid'],$get['id']);
//remove ban
break;
case addBan:
if($get['time']){$end = time()+$get['time']; }else{$end = '';}
if(is_numeric($get['uid'])){
$get['uid'] = $get['uid'];
}else{
$get['uid'] = $database->getUserField(addslashes($get['uid']),'id',1);
}
$admin->AddBan($get['uid'],$end,$get['reason']);
//add ban
break;
case delOas:
//oaza
break;
case logout:
$this->LogOut();
break;
}
if($get['action'] == 'logout'){
header("Location: admin.php");
}else{
header("Location: ".$_SERVER['HTTP_REFERER']);
}
}
function Act2($post){
global $admin,$database;
switch($post['action']){
case DelPlayer:
$admin->DelPlayer($post['uid'],$post['pass']);
header("Location: ?p=search&msg=ursdel");
break;
case punish:
$admin->Punish($post);
header("Location: ".$_SERVER['HTTP_REFERER']);
break;
case addVillage:
$admin->AddVillage($post);
header("Location: ".$_SERVER['HTTP_REFERER']);
break;
}
}
function LogIN($username,$password){
global $admin,$database;
if($admin->Login($username,$password)){
//$_SESSION['username'] = $username;
$_SESSION['access'] = $database->getUserField($username,'access',1);
$_SESSION['id'] = $database->getUserField($username,'id',1);
header("Location: ".$_SERVER['HTTP_REFERER']);
//header("Location: admin.php");
}else{
echo "Error";
}
}
function LogOut(){
$_SESSION['access'] = '';
$_SESSION['id'] = '';
}
public function procResType($ref) {
global $session;
switch($ref) {
case 1: $build = "Woodcutter"; break;
case 2: $build = "Clay Pit"; break;
case 3: $build = "Iron Mine"; break;
case 4: $build = "Cropland"; break;
case 5: $build = "Sawmill"; break;
case 6: $build = "Brickyard"; break;
case 7: $build = "Iron Foundry"; break;
case 8: $build = "Grain Mill"; break;
case 9: $build = "Bakery"; break;
case 10: $build = "Warehouse"; break;
case 11: $build = "Granary"; break;
case 12: $build = "Blacksmith"; break;
case 13: $build = "Armoury"; break;
case 14: $build = "Tournament Square"; break;
case 15: $build = "Main Building"; break;
case 16: $build = "Rally Point"; break;
case 17: $build = "Marketplace"; break;
case 18: $build = "Embassy"; break;
case 19: $build = "Barracks"; break;
case 20: $build = "Stable"; break;
case 21: $build = "Workshop"; break;
case 22: $build = "Academy"; break;
case 23: $build = "Cranny"; break;
case 24: $build = "Town Hall"; break;
case 25: $build = "Residence"; break;
case 26: $build = "Palace"; break;
case 27: $build = "Treasury"; break;
case 28: $build = "Trade Office"; break;
case 29: $build = "Great Barracks"; break;
case 30: $build = "Great Stable"; break;
case 31: $build = "City Wall"; break;
case 32: $build = "Earth Wall"; break;
case 33: $build = "Palisade"; break;
case 34: $build = "Stonemason's Lodge"; break;
case 35: $build = "Brewery"; break;
case 36: $build = "Trapper"; break;
case 37: $build = "Hero's Mansion"; break;
case 38: $build = "Great Warehouse"; break;
case 39: $build = "Great Granary"; break;
case 40: $build = "Wonder of the World"; break;
case 41: $build = "Horse Drinking Trough"; break;
default: $build = "Error"; break;
}
return $build;
}
};
$funct = new funct;
if($funct->CheckLogin()){
if($_GET['action']){
$funct->Act($_GET);
}
if($_POST['action']){
$funct->Act2($_POST);
}
}
if($_POST['action']=='login'){
$funct->LogIN($_POST['name'],$_POST['pw']);
}
?>
+6
View File
@@ -0,0 +1,6 @@
Hello %USER%,
Thank you for registering on our server.
Since the %START% at %TIME% Romans, Gauls and Teutons attack each other on this game world. Right now, %PLAYERS% players in %ALLI% Alliances are fighting for supremacy.
Regards, %SERVER_NAME%