Merge branch 'master' of https://github.com/evader1337/TravianZ into evader1337-master

# Conflicts:
#	GameEngine/Database/db_MYSQL.php
#	Templates/Build/avaliable.tpl
#	Templates/Message/inbox.tpl
This commit is contained in:
Martin Ambrus
2017-08-28 14:18:24 +02:00
93 changed files with 5041 additions and 9207 deletions
+20 -29
View File
@@ -1,21 +1,12 @@
<?php
$place = $place1 = $place2 = $place3 = "?";
$db_host=SQL_SERVER; $db_user=SQL_USER; $db_pass=SQL_PASS; $db_name=SQL_DB;
$place = $place1 = $place2 = $place3 = "?";
$con = mysql_connect($db_host, $db_user, $db_pass);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
for($i=1;$i<=0;$i++) {
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
mysql_select_db($db_name, $con);
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY ap DESC, id DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY ap DESC, id DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1">
<thead>
@@ -39,7 +30,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['id']==$session->alliance) {
$place = $i;
@@ -56,7 +47,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->alliance) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -75,8 +66,8 @@
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY dp DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY dp DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY dp DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY dp DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1" id="top10_defs" class="top10 row_table_data">
<thead>
@@ -93,7 +84,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['id']==$session->alliance) {
$place1 = $i;
@@ -111,7 +102,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->alliance) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -129,8 +120,8 @@
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY clp DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY clp DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY clp DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY clp DESC Limit 1");
?>
<div class="clear"></div>
<table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
@@ -148,7 +139,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['id']==$session->alliance) {
$place2 = $i;
@@ -165,7 +156,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->alliance) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -182,8 +173,8 @@
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY RR DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY RR DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY RR DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY RR DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">
<thead>
@@ -200,7 +191,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['RR'] >= 0) {
if($row['id']==$session->alliance) {
@@ -219,7 +210,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->alliance) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -230,7 +221,7 @@
echo "</tr>";
}
mysql_close($con);
mysqli_close($con);
?>
</tbody>
</table>
+7 -7
View File
@@ -9,11 +9,11 @@
| Copyright: TravianX Project All rights reserved |
\** --------------------------------------------------- **/
$tribe1 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 1");
$tribe2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 2");
$tribe3 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE tribe = 3");
$tribes = array(mysql_num_rows($tribe1), mysql_num_rows($tribe2), mysql_num_rows($tribe3));
$users = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5")); ?>
$tribe1 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 1");
$tribe2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 2");
$tribe3 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE tribe = 3");
$tribes = array(mysqli_num_rows($tribe1), mysqli_num_rows($tribe2), mysqli_num_rows($tribe3));
$users = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5")); ?>
<table cellpadding="1" cellspacing="1" id="world_player" class="world">
<thead>
@@ -34,7 +34,7 @@
<th>Active players</th>
<td><?php
$active = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (3600*24) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
$active = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (3600*24) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
echo $active; ?></td>
</tr>
@@ -42,7 +42,7 @@
<th>Players online</th>
<td><?php
$online = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
$online = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
echo $online; ?></td>
</tr>
</tbody>
+17 -25
View File
@@ -1,21 +1,13 @@
<?php
$place = $place1 = $place2 = $place3 = "?";
//$db_host=SQL_SERVER; $db_user=SQL_USER; $db_pass=SQL_PASS; $db_name=SQL_DB;
//$con = mysql_connect($db_host, $db_user, $db_pass);
//if (!$con)
// {
// die('Could not connect: ' . mysql_error());
// }
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
//mysql_select_db($db_name, $con);
$result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY ap DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY ap DESC, id DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY ap DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY ap DESC, id DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1">
<thead>
@@ -39,7 +31,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['id']==$session->uid) {
if($row['id']==$session->uid) {
@@ -56,7 +48,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->uid) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -75,8 +67,8 @@
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY dp DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY dp DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY dp DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY dp DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1" id="top10_defs" class="top10 row_table_data">
<thead>
@@ -93,7 +85,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['id']==$session->uid) {
$place1 = $i;
@@ -111,7 +103,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->uid) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -129,8 +121,8 @@
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY clp DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY clp DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY clp DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY clp DESC Limit 1");
?>
<div class="clear"></div>
<table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
@@ -148,7 +140,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['id']==$session->uid) {
$place2 = $i;
@@ -165,7 +157,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id'] == $session->uid) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -181,8 +173,8 @@
for($i=1;$i<=0;$i++) {
echo "Row ".$i;
}
$result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY RR DESC, id DESC Limit 10");
$result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY RR DESC Limit 1");
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY RR DESC, id DESC Limit 10");
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY RR DESC Limit 1");
?>
<table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">
<thead>
@@ -199,7 +191,7 @@
</thead>
<tbody>
<?php
while($row = mysql_fetch_array($result))
while($row = mysqli_fetch_array($result))
{
if($row['RR'] >= 0) {
if($row['id']==$session->uid) {
@@ -218,7 +210,7 @@
<td colspan="3" class="empty"></td>
</tr>
<?php
while($row = mysql_fetch_array($result2))
while($row = mysqli_fetch_array($result2))
{
if($row['id']==$session->uid) {
echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
@@ -229,7 +221,7 @@
echo "</tr>";
}
// mysql_close($con);
// mysqli_close($con);
?>
</tbody>
</table>
+4 -4
View File
@@ -1,7 +1,7 @@
<?php
if (WW == True)
{
$result = mysql_query("select " . TB_PREFIX . "users.id, " . TB_PREFIX . "users.username," . TB_PREFIX . "users.alliance, " . TB_PREFIX . "fdata.wwname, " . TB_PREFIX . "fdata.f99, " . TB_PREFIX . "vdata.name, " . TB_PREFIX . "fdata.vref
$result = mysqli_query($GLOBALS['link'],"select " . TB_PREFIX . "users.id, " . TB_PREFIX . "users.username," . TB_PREFIX . "users.alliance, " . TB_PREFIX . "fdata.wwname, " . TB_PREFIX . "fdata.f99, " . TB_PREFIX . "vdata.name, " . TB_PREFIX . "fdata.vref
FROM " . TB_PREFIX . "users
INNER JOIN " . TB_PREFIX . "vdata ON " . TB_PREFIX . "users.id = " . TB_PREFIX . "vdata.owner
INNER JOIN " . TB_PREFIX . "fdata ON " . TB_PREFIX . "fdata.vref = " . TB_PREFIX . "vdata.wref
@@ -24,11 +24,11 @@ if (WW == True)
<tbody>
<?php
$cont = 1;
while ($row = mysql_fetch_array($result))
while ($row = mysqli_fetch_array($result))
{
$ally = $database->getAlliance($row[alliance]);
$query = @mysql_query('SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vref'] . ' ORDER BY `attack_time` ASC LIMIT 1');
$row2 = @mysql_fetch_assoc($query);
$query = @mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vref'] . ' ORDER BY `attack_time` ASC LIMIT 1');
$row2 = @mysqli_fetch_assoc($query);
?>
<tr>
<td><?php echo $cont; $cont++; ?>.</td>