Big Cleanup

1) Removed unnecessary files
2) Trailling spaces (no all though)
3)  Some space to tab conversion
This commit is contained in:
Neranjen
2012-06-18 05:06:05 +05:30
parent e081116620
commit 786cbf1f8e
195 changed files with 23522 additions and 23537 deletions
+1 -1
View File
@@ -101,4 +101,4 @@ mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'C
header("Location: ../../../Admin/admin.php?p=addTroops&did=".$id."&d");
?>
?>
+18 -18
View File
@@ -16,30 +16,30 @@ mysql_select_db(SQL_DB);
$id = $_POST['id'];
$amt = $_POST['vill_amount'];
for($i=1;$i<=$amt;$i++) {
$kid = rand(1,4);
$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);
$kid = rand(1,4);
$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);
$q = "UPDATE ".TB_PREFIX."units SET u41 = u41 + '150000', u42 = u42 + '150000', u43 = u43 + '150000', u44 = u44 + '150000', u45 = u45 + '150000', u46 = u46 + '150000', u47 = u47 + '150000', u48 = u48 + '150000' , u49 = u49 + '150000', u50 = u50 + '150000' 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->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
$q = "UPDATE ".TB_PREFIX."units SET u41 = u41 + '150000', u42 = u42 + '150000', u43 = u43 + '150000', u44 = u44 + '150000', u45 = u45 + '150000', u46 = u46 + '150000', u47 = u47 + '150000', u48 = u48 + '150000' , u49 = u49 + '150000', u50 = u50 + '150000' 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');
}
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$id,'Added <b>$amt</b> WW Buildingplan Villages',".time().")");
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");
+18 -18
View File
@@ -16,29 +16,29 @@ mysql_select_db(SQL_DB);
$id = $_POST['id'];
$amt = $_POST['vill_amount'];
for($i=1;$i<=$amt;$i++) {
$kid = rand(1,4);
$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);
$kid = rand(1,4);
$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 + '150000', u42 = u42 + '150000', u43 = u43 + '150000', u44 = u44 + '150000', u45 = u45 + '150000', u46 = u46 + '150000', u47 = u47 + '150000', u48 = u48 + '150000' , u49 = u49 + '150000', u50 = u50 + '150000' WHERE vref = '".$wid."'";
mysql_query($q);
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
$q = "UPDATE ".TB_PREFIX."units SET u41 = u41 + '150000', u42 = u42 + '150000', u43 = u43 + '150000', u44 = u44 + '150000', u45 = u45 + '150000', u46 = u46 + '150000', u47 = u47 + '150000', u48 = u48 + '150000' , u49 = u49 + '150000', u50 = u50 + '150000' WHERE vref = '".$wid."'";
mysql_query($q);
}
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$id,'Added <b>$amt</b> WW Villages',".time().")");
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");
+2 -2
View File
@@ -9,8 +9,8 @@
## ##
#################################################################################
include ("../../Database.php");
include ("../../Admin/database.php");
include ("../../Database.php");
include ("../../Admin/database.php");
include ("../../config.php");
$database->populateOasisUnitsLow();
+81 -81
View File
@@ -23,87 +23,87 @@ $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']."'
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."");
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="userCount.php" server="D:/wamp/www/New/" local="129157402737451172" remote="129157402730000000" />
</dwsync>
+45 -45
View File
@@ -1,13 +1,13 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename admin.php ##
## --------------------------------------------------------------------------- ##
## 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");
@@ -24,9 +24,9 @@ function aktiv() {this.srcElement.className='fl1'; }
<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>
<meta http-equiv="imagetoolbar" content="no">
</head>
<body>
<script language="javascript">
function aktiv() {this.srcElement.className='fl1'; }
@@ -46,16 +46,16 @@ if(conf){return true;}else{return false;}
<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
<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>
@@ -63,43 +63,43 @@ if(conf){return true;}else{return false;}
<a href="#"></a><a href="#"></a>
<a href="?p=server_info">Server Info</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');
}
<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)){
if(file_exists($filename)){
include($filename);
}else{
include('../Templates/Admin/404.tpl');
include('../Templates/Admin/404.tpl');
}
}
}else{
+163 -163
View File
@@ -27,9 +27,9 @@ class adm_DB {
var $connection;
function adm_DB(){
global $database;
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());
mysql_select_db(SQL_DB, $this->connection) or die(mysql_error());
}
function Login($username,$password){
@@ -49,40 +49,40 @@ class adm_DB {
function recountPopUser($uid){
global $database;
$villages = $database->getProfileVillages($uid);
for ($i = 0; $i <= count($villages)-1; $i++) {
$vid = $villages[$i]['wref'];
$this->recountPop($vid);
}
for ($i = 0; $i <= count($villages)-1; $i++) {
$vid = $villages[$i]['wref'];
$this->recountPop($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);
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 buildingPOP($f,$lvl){
$name = "bid".$f;
global $$name;
$name = "bid".$f;
global $$name;
$popT = 0;
$dataarray = $$name;
for ($i = 0; $i <= $lvl; $i++) {
$popT += $dataarray[$i]['pop'];
}
return $popT;
$dataarray = $$name;
for ($i = 0; $i <= $lvl; $i++) {
$popT += $dataarray[$i]['pop'];
}
return $popT;
}
function getWref($x,$y) {
$q = "SELECT id FROM ".TB_PREFIX."wdata where x = $x and y = $y";
$q = "SELECT id FROM ".TB_PREFIX."wdata where x = $x and y = $y";
$result = mysql_query($q, $this->connection);
$r = mysql_fetch_array($result);
return $r['id'];
@@ -92,199 +92,199 @@ class adm_DB {
global $database;
$wid = $this->getWref($post['x'],$post['y']);
$uid = $post['uid'];
$status = $database->getVillageState($wid);
$status = 0;
if($status == 0){
$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->setFieldTaken($wid);
$database->addVillage($wid,$uid,'new village','0');
$database->addResourceFields($wid,$database->getVillageType($wid));
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
}
$database->addABTech($wid);
}
}
function Punish($post){
global $database;
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);
$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);
}
}
}
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);
}
}
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);
}
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);
$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);
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']);
}
$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);
$q = "DELETE FROM ".TB_PREFIX."users WHERE `id` = $uid;";
mysql_query($q, $this->connection);
}
function CheckPass($password,$uid){
$q = "SELECT password FROM ".TB_PREFIX."users where id = '$uid' and access = ".ADMIN;
}
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)) {
if($dbarray['password'] == md5($password)) {
return true;
}else{
return false;
}
}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){
$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";
$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);
}
$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 = $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);
$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;
global $database;
$name = $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 = $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);
$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 = $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);
}
$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);
$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);
$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);
$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);
$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);
$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);
//$q = "SELECT * FROM ".TB_PREFIX."banlist";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
/***************************
@@ -316,5 +316,5 @@ class adm_DB {
};
$admin = new adm_DB;
include("function.php");
include("function.php");
?>
+88 -88
View File
@@ -9,97 +9,97 @@
## ##
#################################################################################
class funct {
function CheckLogin(){
if($_SESSION['access'] >= MULTIHUNTER and $_SESSION['id']){
return true;
}else{
return false;
}
}
function Act($get){
global $admin,$database;
class funct {
switch($get['action']){
case recountPop:
$admin->recountPop($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(preg_match("/^[0-9]+$/",$get['uid'])){
//if(eregi("^[0-9]*+$",$get['uid'])){
$get['uid'] = $get['uid'];
}else{
$get['uid'] = $database->getUserField($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 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']);
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(preg_match("/^[0-9]+$/",$get['uid'])){
//if(eregi("^[0-9]*+$",$get['uid'])){
$get['uid'] = $get['uid'];
}else{
$get['uid'] = $database->getUserField($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;
}
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";
}
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'] = '';
function LogOut(){
$_SESSION['access'] = '';
$_SESSION['id'] = '';
}
public function procResType($ref) {
@@ -150,16 +150,16 @@ class funct {
}
return $build;
}
};
$funct = new funct;
if($funct->CheckLogin()){
if($_GET['action']){
$funct->Act($_GET);
$funct->Act($_GET);
}
if($_POST['action']){
$funct->Act2($_POST);
$funct->Act2($_POST);
}
}
if($_POST['action']=='login'){
+1 -1
View File
@@ -1,6 +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.
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%