mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-14 23:31:02 +00:00
fix: more crazy SQL calculations
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<h5><img src="img/en/t2/newsbox1.gif" alt="newsbox 1"></h5>
|
<h5><img src="img/en/t2/newsbox1.gif" alt="newsbox 1"></h5>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$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"));
|
$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");
|
||||||
$top_rank = mysqli_fetch_assoc(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE ".(INCLUDE_ADMIN ? '' : 'access< 8 AND ')."id > 5 AND tribe<=3 AND tribe > 0 ORDER BY oldrank ASC Limit 1"));
|
$top_rank = mysqli_fetch_assoc(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB_PREFIX."users WHERE ".(INCLUDE_ADMIN ? '' : 'access< 8 AND ')."id > 5 AND tribe<=3 AND tribe > 0 ORDER BY oldrank ASC Limit 1"));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -10,7 +10,15 @@ $top_rank = mysqli_fetch_assoc(mysqli_query($GLOBALS['link'],"SELECT * FROM ".TB
|
|||||||
<table width="100%" border="0">
|
<table width="100%" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left"><b>Online Users</td>
|
<td align="left"><b>Online Users</td>
|
||||||
<td>: <font color="Red"><?php echo $online ?> users</font></b></td>
|
<td>: <font color="Red"><?php
|
||||||
|
|
||||||
|
if (!empty($online)) {
|
||||||
|
echo mysqli_fetch_assoc($online)['Total'];
|
||||||
|
} else {
|
||||||
|
echo 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
?> users</font></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>Server Speed</td>
|
<td><b>Server Speed</td>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<h5><img src="img/en/t2/newsbox2.gif" alt="newsbox 2"></h5>
|
<h5><img src="img/en/t2/newsbox2.gif" alt="newsbox 2"></h5>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$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"));
|
$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");
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@@ -10,7 +9,15 @@ $online = mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT * FROM " . TB_PR
|
|||||||
<table width="100%" border="0">
|
<table width="100%" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left"><b>Online Users</td>
|
<td align="left"><b>Online Users</td>
|
||||||
<td>: <font color="Red"><?php echo $online ?> users</font></b></td>
|
<td>: <font color="Red"><?php
|
||||||
|
|
||||||
|
if (!empty($online)) {
|
||||||
|
echo mysqli_fetch_assoc($online)['Total'];
|
||||||
|
} else {
|
||||||
|
echo 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
?> users</font></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>Server Speed</td>
|
<td><b>Server Speed</td>
|
||||||
|
|||||||
@@ -42,8 +42,13 @@
|
|||||||
<th>Players online</th>
|
<th>Players online</th>
|
||||||
|
|
||||||
<td><?php
|
<td><?php
|
||||||
$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"));
|
$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");
|
||||||
echo $online; ?></td>
|
if (!empty($online)) {
|
||||||
|
echo mysqli_fetch_assoc($online)['Total'];
|
||||||
|
} else {
|
||||||
|
echo 0;
|
||||||
|
}
|
||||||
|
?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user