mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-15 15:51:01 +00:00
Some replacements
+Replaced all $GLOBALS['link'] with $database->dblink -Removed Templates/links.tpl from build.php (it's already in Templates/menu.tpl)
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
echo "Row ".$i;
|
||||
}
|
||||
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY ap DESC, id DESC Limit 1");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY ap DESC, id DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -66,8 +66,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY dp DESC Limit 1");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY dp DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="top10_defs" class="top10 row_table_data">
|
||||
<thead>
|
||||
@@ -120,8 +120,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY clp DESC Limit 1");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY clp DESC Limit 1");
|
||||
?>
|
||||
<div class="clear"></div>
|
||||
<table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
|
||||
@@ -173,8 +173,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY RR DESC Limit 1");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY RR DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">
|
||||
<thead>
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
| Copyright: TravianX Project All rights reserved |
|
||||
\** --------------------------------------------------- **/
|
||||
|
||||
$tribe1 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 1"), MYSQLI_ASSOC);
|
||||
$tribe2 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 2"), MYSQLI_ASSOC);
|
||||
$tribe3 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 3"), MYSQLI_ASSOC);
|
||||
$tribe1 = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 1"), MYSQLI_ASSOC);
|
||||
$tribe2 = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 2"), MYSQLI_ASSOC);
|
||||
$tribe3 = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE tribe = 3"), MYSQLI_ASSOC);
|
||||
$tribes = array($tribe1['Total'], $tribe2['Total'], $tribe3['Total']);
|
||||
$users = mysqli_fetch_array(mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5"), MYSQLI_ASSOC);
|
||||
$users = mysqli_fetch_array(mysqli_query($database->dblink,"SELECT Count(*) as Total FROM " . TB_PREFIX . "users WHERE tribe!=0 AND tribe!=4 AND tribe!=5"), MYSQLI_ASSOC);
|
||||
$users = $users['Total'];
|
||||
?>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<th>Active players</th>
|
||||
|
||||
<td><?php
|
||||
$active = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE timestamp > ".(time() - (3600*24))." AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
$active = mysqli_num_rows(mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE timestamp > ".(time() - (3600*24))." AND tribe!=0 AND tribe!=4 AND tribe!=5"));
|
||||
echo $active; ?></td>
|
||||
</tr>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<th>Players online</th>
|
||||
|
||||
<td><?php
|
||||
$online = mysqli_query($GLOBALS['link'],"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE timestamp > ".(time() - (60*10))." AND tribe!=0 AND tribe!=4 AND tribe!=5");
|
||||
$online = mysqli_query($database->dblink,"SELECT Count(*) as Total FROM ".TB_PREFIX."users WHERE timestamp > ".(time() - (60*10))." AND tribe!=0 AND tribe!=4 AND tribe!=5");
|
||||
if (!empty($online)) {
|
||||
echo mysqli_fetch_assoc($online)['Total'];
|
||||
} else {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
echo "Row ".$i;
|
||||
}
|
||||
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY ap DESC, id DESC Limit 1");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY ap DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY ap DESC, id DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -67,8 +67,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY dp DESC Limit 1");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY dp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY dp DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="top10_defs" class="top10 row_table_data">
|
||||
<thead>
|
||||
@@ -121,8 +121,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY clp DESC Limit 1");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY clp DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY clp DESC Limit 1");
|
||||
?>
|
||||
<div class="clear"></div>
|
||||
<table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
|
||||
@@ -173,8 +173,8 @@
|
||||
for($i=1;$i<=0;$i++) {
|
||||
echo "Row ".$i;
|
||||
}
|
||||
$result = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY RR DESC Limit 1");
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 5 AND tribe<=3 AND tribe > 0 ORDER BY RR DESC, id DESC Limit 10");
|
||||
$result2 = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."users WHERE id = '".$session->uid."' ORDER BY RR DESC Limit 1");
|
||||
?>
|
||||
<table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">
|
||||
<thead>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (WW == True)
|
||||
{
|
||||
$result = mysqli_query($GLOBALS['link'],"select " . TB_PREFIX . "users.id, " . TB_PREFIX . "users.username," . TB_PREFIX . "users.alliance, " . TB_PREFIX . "fdata.wwname, " . TB_PREFIX . "fdata.f99, " . TB_PREFIX . "vdata.name, " . TB_PREFIX . "fdata.vref
|
||||
$result = mysqli_query($database->dblink,"select " . TB_PREFIX . "users.id, " . TB_PREFIX . "users.username," . TB_PREFIX . "users.alliance, " . TB_PREFIX . "fdata.wwname, " . TB_PREFIX . "fdata.f99, " . TB_PREFIX . "vdata.name, " . TB_PREFIX . "fdata.vref
|
||||
FROM " . TB_PREFIX . "users
|
||||
INNER JOIN " . TB_PREFIX . "vdata ON " . TB_PREFIX . "users.id = " . TB_PREFIX . "vdata.owner
|
||||
INNER JOIN " . TB_PREFIX . "fdata ON " . TB_PREFIX . "fdata.vref = " . TB_PREFIX . "vdata.wref
|
||||
@@ -27,7 +27,7 @@ if (WW == True)
|
||||
while ($row = mysqli_fetch_array($result))
|
||||
{
|
||||
$ally = $database->getAlliance($row['alliance']);
|
||||
$query = @mysqli_query($GLOBALS['link'],'SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vref'] . ' ORDER BY `attack_time` ASC LIMIT 1');
|
||||
$query = @mysqli_query($database->dblink,'SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vref'] . ' ORDER BY `attack_time` ASC LIMIT 1');
|
||||
$row2 = @mysqli_fetch_assoc($query);
|
||||
?>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user