fix: a lot of MySQL calls in templates replaced by MySQLi ones

This commit is contained in:
Martin Ambrus
2017-08-28 23:56:59 +02:00
parent 814a904343
commit 92b9a7b043
75 changed files with 427 additions and 427 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ $noticeClass = array("Scout Report","Won as attacker without losses","Won as att
</tr>
</thead><tfoot>
<tr><th><?php
$MyGold = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysql_error());
$golds = mysql_fetch_array($MyGold);
$MyGold = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE `id`='".$session->uid."'") or die(mysqli_error());
$golds = mysqli_fetch_array($MyGold);
$date2=strtotime("NOW");
if ($golds['plus'] <= $date2) { ?>
<?php } else { ?>
+15 -15
View File
@@ -78,10 +78,10 @@ if($_GET['aid'])
<?php
error_reporting(0);
$sql = "SELECT * FROM ".TB_PREFIX."ali_permission WHERE alliance = ".$_GET['aid']."";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result))
{
$player = mysql_fetch_assoc(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$row['uid'].""));
$player = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE id = ".$row['uid'].""));
if($row['opt1'] == 1) { $position1 = "Assign To Position"; } else { $position1 = "No Assigning Positions"; }
if($row['opt2'] == 1) { $position2 = "Kick Players"; } else { $position2 = "No Kicking Players"; }
if($row['opt3'] == 1) { $position3 = "Change Alliance Description"; } else { $position3 = "No Changing Description"; }
@@ -236,8 +236,8 @@ if($_GET['aid'])
</thead>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."ali_log WHERE aid = ".$_GET['aid']."";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result))
{
echo '
<tr>
@@ -265,8 +265,8 @@ if($_GET['aid'])
</thead>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli1 = ".$_GET['aid']."";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result))
{
if($row['type'] == 1) { $type = 'Confederation Pact'; }
if($row['type'] == 2) { $type = 'Non Agression Pact'; }
@@ -274,7 +274,7 @@ if($_GET['aid'])
if($row['accepted'] == 0) { $accepted = "<img src=\"../../gpack/travian_default/img/a/del.gif\">"; }
if($row['accepted'] ==1) { $accepted = "<img src=\"../../gpack/travian_default/img/a/acc.gif\">"; }
$ally = mysql_fetch_assoc(mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = ".$row['alli2'].""));
$ally = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."alidata WHERE id = ".$row['alli2'].""));
echo '
<tr>
<td><a href="admin.php?p=alliance&aid='.$row['alli1'].'">'.$ally['tag'].'</a></td>
@@ -300,8 +300,8 @@ if($_GET['aid'])
</thead>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli2 = ".$_GET['aid']."";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result))
{
if($row['type'] == 1) { $type = 'Confederation Pact'; }
if($row['type'] == 2) { $type = 'Non Agression Pact'; }
@@ -309,7 +309,7 @@ if($_GET['aid'])
if($row['accepted'] == 0) { $accepted = "<img src=\"../../gpack/travian_default/img/a/del.gif\">"; }
if($row['accepted'] ==1) { $accepted = "<img src=\"../../gpack/travian_default/img/a/acc.gif\">"; }
$ally = mysql_fetch_assoc(mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = ".$row['alli1'].""));
$ally = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."alidata WHERE id = ".$row['alli1'].""));
echo '
<tr>
<td><a href="admin.php?p=alliance&aid='.$row['alli2'].'">'.$ally['tag'].'</a></td>
@@ -336,8 +336,8 @@ if($_GET['aid'])
</thead>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."diplomacy WHERE alli1 = ".$_GET['aid']." OR alli2 = ".$_GET['aid']." AND accepted = 1";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result))
{
if($row['type'] == 1) { $type = 'Confederation Pact'; }
if($row['type'] == 2) { $type = 'Non Agression Pact'; }
@@ -345,8 +345,8 @@ if($_GET['aid'])
if($row['accepted'] == 0) { $accepted = "<img src=\"../../gpack/travian_default/img/a/del.gif\">"; }
if($row['accepted'] == 1) { $accepted = "<img src=\"../../gpack/travian_default/img/a/acc.gif\">"; }
$ally1 = mysql_fetch_assoc(mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = ".$row['alli1'].""));
$ally2 = mysql_fetch_assoc(mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = ".$row['alli2'].""));
$ally1 = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."alidata WHERE id = ".$row['alli1'].""));
$ally2 = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."alidata WHERE id = ".$row['alli2'].""));
echo '
<tr>
<td><a href="admin.php?p=alliance&aid='.$row['alli1'].'">'.$ally1['tag'].'</a> & <a href="admin.php?p=alliance&aid='.$row['alli2'].'">'.$ally2['tag'].'</a></td>
+2 -2
View File
@@ -8,8 +8,8 @@
## ##
#################################################################################
$time = time();
$ban = mysql_query("SELECT * FROM ".TB_PREFIX."banlist WHERE `uid` = '".$session->uid."' and active = 1");
$ban1 = mysql_fetch_array($ban);
$ban = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."banlist WHERE `uid` = '".$session->uid."' and active = 1");
$ban1 = mysqli_fetch_array($ban);
?>
<p></br>
+12 -12
View File
@@ -12,8 +12,8 @@
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
include("../GameEngine/config.php");
$id = $_SESSION['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."allimedal");
$nummedals = mysql_num_rows($sql);
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."allimedal");
$nummedals = mysqli_num_rows($sql);
?>
@@ -36,11 +36,11 @@ $nummedals = mysql_num_rows($sql);
</thead>
<tbody>
<?php
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."allimedal");
$tot = mysql_num_rows($sql);
$sql = mysql_query("SELECT week FROM ".TB_PREFIX."allimedal ORDER BY week DESC LIMIT 1");
if(mysql_num_rows($sql) > 0){
$week = mysql_result($sql, 0);
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."allimedal");
$tot = mysqli_num_rows($sql);
$sql = mysqli_query($GLOBALS["link"], "SELECT week FROM ".TB_PREFIX."allimedal ORDER BY week DESC LIMIT 1");
if(mysqli_num_rows($sql) > 0){
$week = mysqli_result($sql, 0);
echo "<tr><td><center>$week</center></td><td><center>$tot</center></td></tr>";
}else{
echo "<tr><td><center>0</center></td><td><center>$tot</center></td></tr>";
@@ -75,8 +75,8 @@ $nummedals = mysql_num_rows($sql);
for($j = 0; $j<$week; $j++)
{
$newweek = $j+1;
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."allimedal WHERE week = $newweek");
$tot = mysql_num_rows($sql);
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."allimedal WHERE week = $newweek");
$tot = mysqli_num_rows($sql);
echo "<tr>
<td>$newweek</td>
<td>$tot</td>
@@ -111,8 +111,8 @@ $nummedals = mysql_num_rows($sql);
<tbody>
<?php
$query = "SELECT * FROM ".TB_PREFIX."allimedal ORDER BY id DESC";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
$result = mysqli_query($GLOBALS["link"], $query);
while($row = mysqli_fetch_array($result))
{
$i = $i + 1;
$titel="Bonus";
@@ -131,7 +131,7 @@ $nummedals = mysql_num_rows($sql);
$allyid = $row['allyid'];
$unq = "SELECT name FROM ".TB_PREFIX."alidata WHERE id = ".$allyid."";
$user = mysql_result(mysql_query($unq), 0);
$user = mysqli_result(mysqli_query($GLOBALS["link"], $unq), 0);
$allyname = $user;
$alliance = '<a href="admin.php?p=alliance&aid='.$allyid.'">'.$allyname.'</a>';
+2 -2
View File
@@ -50,8 +50,8 @@ if($_GET['uid'])
<td>Villages:</td>
<td>
<?php
$result = mysql_query("SELECT SQL_CACHE * FROM ".TB_PREFIX."vdata WHERE owner = ".$user['id']."");
$num_rows = mysql_num_rows($result);
$result = mysqli_query($GLOBALS["link"], "SELECT SQL_CACHE * FROM ".TB_PREFIX."vdata WHERE owner = ".$user['id']."");
$num_rows = mysqli_num_rows($result);
echo $num_rows;
?>
</td>
+12 -12
View File
@@ -13,8 +13,8 @@ if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
include("../GameEngine/config.php");
$id = $_SESSION['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."medal");
$nummedals = mysql_num_rows($sql);
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."medal");
$nummedals = mysqli_num_rows($sql);
?>
@@ -37,11 +37,11 @@ $nummedals = mysql_num_rows($sql);
</thead>
<tbody>
<?php
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."medal");
$tot = mysql_num_rows($sql);
$sql = mysql_query("SELECT week FROM ".TB_PREFIX."medal ORDER BY week DESC LIMIT 1");
if(mysql_num_rows($sql) > 0){
$week = mysql_result($sql, 0);
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."medal");
$tot = mysqli_num_rows($sql);
$sql = mysqli_query($GLOBALS["link"], "SELECT week FROM ".TB_PREFIX."medal ORDER BY week DESC LIMIT 1");
if(mysqli_num_rows($sql) > 0){
$week = mysqli_result($sql, 0);
echo "<tr><td><center>$week</center></td><td><center>$tot</center></td></tr>";
}else{
echo "<tr><td><center>0</center></td><td><center>$tot</center></td></tr>";
@@ -77,8 +77,8 @@ $nummedals = mysql_num_rows($sql);
{
$newweek = $j+1;
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."medal WHERE week = $newweek");
$tot = mysql_num_rows($sql);
$sql = mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."medal WHERE week = $newweek");
$tot = mysqli_num_rows($sql);
echo "<tr><td>$newweek</td><td>$tot</td><td><input type=\"image\" name=\"medalweek\" value=\"".$newweek."\" style=\"background-image: url('../gpack/travian_default/img/a/del.gif'); height: 12px; width: 12px;\" src=\"../gpack/travian_default/img/a/x.gif\"></td>";
}
@@ -116,8 +116,8 @@ $nummedals = mysql_num_rows($sql);
<tbody>
<?php
$query = "SELECT * FROM ".TB_PREFIX."medal ORDER BY id DESC";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
$result = mysqli_query($GLOBALS["link"], $query);
while($row = mysqli_fetch_array($result))
{
$i = $i + 1;
$titel="Bonus";
@@ -144,7 +144,7 @@ $nummedals = mysql_num_rows($sql);
$playerid = $row['userid'];
$unq = "SELECT username FROM ".TB_PREFIX."users where id = $playerid";
$user = mysql_result(mysql_query($unq), 0);
$user = mysqli_result(mysqli_query($GLOBALS["link"], $unq), 0);
$username = $user;
$player = "<a href=\"admin.php?p=player&uid=".$playerid."\">$username</a>";
+3 -3
View File
@@ -13,9 +13,9 @@ if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
$id = $_SESSION['id'];
if(isset($_GET['uid']))
{
$sql = mysql_query("SELECT access FROM ".TB_PREFIX."users WHERE id = ".$_GET['uid']."");
$curaccess = mysql_result($sql, 0);
$player = mysql_fetch_assoc(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$id.""));
$sql = mysqli_query($GLOBALS["link"], "SELECT access FROM ".TB_PREFIX."users WHERE id = ".$_GET['uid']."");
$curaccess = mysqli_result($sql, 0);
$player = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE id = ".$id.""));
?>
<form action="../GameEngine/Admin/Mods/editAccess.php" method="POST">
+2 -2
View File
@@ -14,8 +14,8 @@ if(isset($_GET['uid'])){
include_once("../GameEngine/Data/hero_full.php");
include_once("../GameEngine/Units.php");
$user = $database->getUserArray($id,1);
$result = mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = ".$id);
$hero_info = mysql_fetch_array($result);
$result = mysqli_query($GLOBALS["link"], "SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = ".$id);
$hero_info = mysqli_fetch_array($result);
$hero = $units->Hero($id,1);
$unarray = array(1=>U1,U2,U3,U4,U5,U6,U7,U8,U9,U10,U11,U12,U13,U14,U15,U16,U17,U18,U19,U20,U21,U22,U23,U24,U25,U26,U27,U28,U29,U30,U31,U32,U33,U34,U35,U36,U37,U38,U39,U40,U41,U42,U43,U44,U45,U46,U47,U48,U49,U50,U99,U0);
$utribe=($user['tribe']-1)*10;
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
if(isset($_GET['uid']))
{
$user = mysql_fetch_assoc(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$_GET['uid']."")); ?>
$user = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE id = ".$_GET['uid']."")); ?>
<form action="../GameEngine/Admin/Mods/editPassword.php" method="POST">
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
<input type="hidden" name="uid" id="uid" value="<?php echo $_GET['uid']; ?>">
+1 -1
View File
@@ -46,7 +46,7 @@ global $database;
}
$result = $database->query($q);
$active = $database->mysql_fetch_all($result);
$active = $database->mysqli_fetch_all($result);
for ($i = 0; $i <= count($active)-1; $i++){
$uid = $database->getUserField($active[$i]['username'],'id',1);
$varray = $database->getProfileVillages($uid);
+1 -1
View File
@@ -68,7 +68,7 @@ if ($check1=="" && $check2=="") {$criteria="WHERE tribe=0)";}
$player_info=$database->query_return($q);
foreach($player_info as $p_array) {
$p_name=$p_array['username'];
$p_village=mysql_real_escape_string($p_array['name']);
$p_village=mysqli_real_escape_string($GLOBALS["link"], $p_array['name']);
$p_coor="(".$p_array['x']."|".$p_array['y'].")";
$p_pop=$p_array['pop'];
$p_tribe=$array_tribe[$p_array['tribe']];
+2 -2
View File
@@ -17,8 +17,8 @@
<tbody>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."activate";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result))
{
$i++;
if($row['tribe'] == 1) {$tribe = "Roman"; }
+3 -3
View File
@@ -58,7 +58,7 @@ if(isset($id))
<?php
$sql = "SELECT * FROM ".TB_PREFIX."banlist WHERE uid = ".$id."";
$numbans = mysql_num_rows(mysql_query($sql));
$numbans = mysqli_num_rows(mysqli_query($GLOBALS["link"], $sql));
?>
<table id="member" cellpadding="1" cellspacing="1">
<thead>
@@ -74,8 +74,8 @@ if(isset($id))
</thead>
<tbody>
<?php
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result))
{
echo '
<tr>
+2 -2
View File
@@ -12,8 +12,8 @@
include_once("../GameEngine/Data/hero_full.php");
include_once("../GameEngine/Units.php");
$id=$user['id'];
$hero = mysql_query("SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = ".$id);
$hero_info = mysql_fetch_array($hero);
$hero = mysqli_query($GLOBALS["link"], "SELECT * FROM " . TB_PREFIX . "hero WHERE `uid` = ".$id);
$hero_info = mysqli_fetch_array($hero);
if (!empty($hero_info)) {
$hero = $units->Hero($id,1);
}else {
+2 -2
View File
@@ -15,8 +15,8 @@ if ($_GET['bid']){
$rep = $database->getNotice4($_GET['bid']);
}else
$sql = "SELECT * FROM ".TB_PREFIX."ndata ORDER BY time DESC ";
$result = mysql_query($sql);
$rep1 = $database->mysql_fetch_all($result);
$result = mysqli_query($GLOBALS["link"], $sql);
$rep1 = $database->mysqli_fetch_all($result);
if($rep1)
{
//$att = $database->getUserArray($rep1['uid'],1);
+62 -62
View File
@@ -12,67 +12,67 @@
include_once("../../GameEngine/config.php");
include_once("../../GameEngine/Database.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysqli_select_db(SQL_DB);
if (!isset($_SESSION)) {
session_start();
}
if($_SESSION['access'] != ADMIN) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
set_time_limit(0);
mysql_query("TRUNCATE TABLE ".TB_PREFIX."a2b");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."abdata");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."activate");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."active");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."admin_log");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."alidata");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."ali_invite");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."ali_log");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."ali_permission");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."allimedal");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."artefacts");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."attacks");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."banlist");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."bdata");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."build_log");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."chat");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."config");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."deleting");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."demolition");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."diplomacy");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."enforcement");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."farmlist");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."fdata");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."forum_cat");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."forum_edit");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."forum_post");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."forum_survey");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."forum_topic");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."general");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."gold_fin_log");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."hero");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."illegal_log");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."links");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."login_log");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."market");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."market_log");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."mdata");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."medal");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."movement");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."ndata");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."online");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."password");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."prisoners");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."raidlist");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."research");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."route");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."send");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."tdata");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."tech_log");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."training");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."units");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."a2b");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."abdata");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."activate");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."active");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."admin_log");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."alidata");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."ali_invite");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."ali_log");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."ali_permission");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."allimedal");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."artefacts");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."attacks");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."banlist");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."bdata");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."build_log");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."chat");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."config");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."deleting");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."demolition");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."diplomacy");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."enforcement");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."farmlist");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."fdata");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."forum_cat");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."forum_edit");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."forum_post");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."forum_survey");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."forum_topic");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."general");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."gold_fin_log");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."hero");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."illegal_log");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."links");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."login_log");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."market");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."market_log");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."mdata");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."medal");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."movement");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."ndata");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."online");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."password");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."prisoners");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."raidlist");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."research");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."route");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."send");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."tdata");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."tech_log");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."training");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."units");
$time=time();
mysql_query("TRUNCATE TABLE ".TB_PREFIX."odata");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."odata");
$database->populateOasisdata();
$database->populateOasis();
@@ -80,21 +80,21 @@ $database->populateOasisUnits2();
$uid=$database->getVillageID(5);
$passw=md5('123456');
mysql_query("TRUNCATE TABLE ".TB_PREFIX."users");
mysql_query("INSERT INTO ".TB_PREFIX."users (id, username, password, email, tribe, access, gold, gender, birthday, location, desc1, desc2, plus, b1, b2, b3, b4, sit1, sit2, alliance, sessid, act, timestamp, ap, apall, dp, dpall, protect, quest, gpack, cp, lastupdate, RR, Rc, ok) VALUES
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."users");
mysqli_query($GLOBALS["link"], "INSERT INTO ".TB_PREFIX."users (id, username, password, email, tribe, access, gold, gender, birthday, location, desc1, desc2, plus, b1, b2, b3, b4, sit1, sit2, alliance, sessid, act, timestamp, ap, apall, dp, dpall, protect, quest, gpack, cp, lastupdate, RR, Rc, ok) VALUES
(5, 'Multihunter', '".$passw."', 'multihunter@travianx.mail', 0, 9, 0, 0, '0000-00-00', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0),
(1, 'Support', '', 'support@travianx.mail', 0, 8, 0, 0, '0000-00-00', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0),
(2, 'Nature', '', 'support@travianx.mail', 4, 8, 0, 0, '0000-00-00', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0),
(4, 'Taskmaster', '', 'support@travianx.mail', 0, 8, 0, 0, '0000-00-00', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0)");
mysql_query("INSERT INTO ".TB_PREFIX."units (vref) VALUES ($uid)");
mysql_query("INSERT INTO ".TB_PREFIX."tdata (vref) VALUES ($uid)");
mysqli_query($GLOBALS["link"], "INSERT INTO ".TB_PREFIX."units (vref) VALUES ($uid)");
mysqli_query($GLOBALS["link"], "INSERT INTO ".TB_PREFIX."tdata (vref) VALUES ($uid)");
mysql_query("INSERT INTO ".TB_PREFIX."fdata (vref, f1t, f2t, f3t, f4t, f5t, f6t, f7t, f8t, f9t, f10t, f11t, f12t, f13t, f14t, f15t, f16t, f17t, f18t, f26, f26t, wwname) VALUES ($uid, '1', '4', '1', '3', '2', '2', '3', '4', '4', '3', '3', '4', '4', '1', '4', '2', '1', '2', '1', '15', 'World Wonder')");
mysqli_query($GLOBALS["link"], "INSERT INTO ".TB_PREFIX."fdata (vref, f1t, f2t, f3t, f4t, f5t, f6t, f7t, f8t, f9t, f10t, f11t, f12t, f13t, f14t, f15t, f16t, f17t, f18t, f26, f26t, wwname) VALUES ($uid, '1', '4', '1', '3', '2', '2', '3', '4', '4', '3', '3', '4', '4', '1', '4', '2', '1', '2', '1', '15', 'World Wonder')");
mysql_query("DELETE FROM ".TB_PREFIX."vdata WHERE owner<>5");
mysql_query("UPDATE ".TB_PREFIX."wdata SET occupied=0 WHERE id<>$uid");
mysql_query("TRUNCATE TABLE ".TB_PREFIX."ww_attacks");
mysqli_query($GLOBALS["link"], "DELETE FROM ".TB_PREFIX."vdata WHERE owner<>5");
mysqli_query($GLOBALS["link"], "UPDATE ".TB_PREFIX."wdata SET occupied=0 WHERE id<>$uid");
mysqli_query($GLOBALS["link"], "TRUNCATE TABLE ".TB_PREFIX."ww_attacks");
header("Location: ../admin.php?p=resetdone");
?>
+3 -3
View File
@@ -2,7 +2,7 @@
$id = $_GET['uid'];
if(isset($id))
{
$player = mysql_fetch_assoc(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = $id"));
$player = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE id = $id"));
?>
<table cellpadding="1" cellspacing="1" id="member">
<thead>
@@ -18,8 +18,8 @@ if(isset($id))
<tbody>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."illegal_log WHERE user = $id";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result))
{
$i++;
echo '
+3 -3
View File
@@ -2,7 +2,7 @@
$id = $_GET['uid'];
if(isset($id))
{
$player = mysql_fetch_assoc(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = $id"));
$player = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE id = $id"));
?>
<table cellpadding="1" cellspacing="1" id="member">
<thead>
@@ -18,8 +18,8 @@ if(isset($id))
<tbody>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."login_log WHERE uid = $id";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result))
{
$i++;
echo '
+2 -2
View File
@@ -17,8 +17,8 @@ if(isset($id))
</thead>
<?php
$sql = "SELECT * FROM ".TB_PREFIX."build_log WHERE wid = ".$_GET['did']."";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result))
$result = mysqli_query($GLOBALS["link"], $sql);
while($row = mysqli_fetch_assoc($result))
{
$j++;
echo '