А не подскажешь, почему может быть что в статистике количество пользователей онлайн отображается такое же как и общее количество пользователей? Вот скрипт со статистикой
<?PHP
$tfstats = time() - 60*60*24;
$db->Query("SELECT
(SELECT COUNT(*) FROM db_users_a) all_users,
(SELECT SUM(insert_sum) FROM db_users_b) all_insert,
(SELECT SUM(payment_sum) FROM db_users_b) all_payment,
(SELECT COUNT(*) FROM db_users_a WHERE date_reg > '$tfstats') new_users");
$stats_data = $db->FetchArray();
?>
<html>
<head>
<title>Моя деревня</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<meta name="description" content="Моя деревня - Онлайн игра с выводом денег!">
<meta name="keywords" content="Заработок на играх, вложения, заработать, онлайн игра, денежная ферма, заработать на ферме">
<link href="/style/style.css" rel="stylesheet" type="text/css" />
<style>
html {overflow-x: hidden}
div { height: "100%"; }
</style>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/functions.js"></script>
<script>
var isActive = true;
//$(window).focus(function() {
// isActive = true;
// console.log('active');
//});
$(window).load(function() {
isActive = true;
console.log('active');
$(window).click(function() {
isActive = true;
console.log('active');
})
});
$(window).blur(function() {
isActive = false;
console.log('stop');
});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-72714964-1', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
<script src='https://www.google.com/recaptcha/api.js'></script>
<!-- Chatra {literal} -->
<script>
(function(d, w, c) {
w.ChatraID = 'JYsf8xPYtkLmqG6tX';
var s = d.createElement('script');
w[c] = w[c] || function() {
(w[c].q = w[c].q || []).push(arguments);
};
s.async = true;
s.src = 'https://call.chatra.io/chatra.js';
if (d.head) d.head.appendChild(s);
})(document, window, 'Chatra');
</script>
<!-- /Chatra {/literal} -->
</head>
<body>
<div class="header">
<div class="topmenu">
<?PHP include("inc/_menu_top.php"); ?>
<a href="/" class="logo">[/url]
</div>
</div>
<?PHP
$_OPTIMIZATION["title"] = "Статистика";
$_OPTIMIZATION["description"] = "Полная статистика системы";
$_OPTIMIZATION["keywords"] = "Статистика";
$user_id = $_SESSION["user_id"];
$tfstats = time() - 60*60*24;
$db->Query("SELECT
(SELECT COUNT(*) FROM db_users_a) all_users,
(SELECT SUM(insert_sum) FROM db_users_b) all_insert,
(SELECT SUM(payment_sum) FROM db_users_b) all_payment,
(SELECT COUNT(*) FROM db_users_a WHERE date_reg > '$tfstats') new_users,
(SELECT COUNT(*) FROM db_users_a WHERE date_login > '$onlinestats') online_users");
$stats_data = $db->FetchArray();
$db->Query("SELECT
SUM(money_b) money_b,
SUM(money_p) money_p,
SUM(a_t) a_t,
SUM(b_t) b_t,
SUM(c_t) c_t,
SUM(d_t) d_t,
SUM(e_t) e_t
FROM db_users_b");
$data_stats = $db->FetchArray();
?>
<table align="center" width="1216px" class="contentic" style="font-size:14px;font-family: Roboto;padding: 6px;">
<tr><td width="166px" class="r_block" valign="top" align="center" style="font-family: Roboto;font-size:18px; color: rgb(173, 118, 71);">
Дней в игре[br /]
<span style="font-family: Roboto;font-size:18px;color:#D0BBAB;"><?=intval(((time() - $config->SYSTEM_START_TIME) / 86400 ) +1); ?></span>
</td>
<td width="166px" class="r_block" valign="top" align="center" style="font-family: Roboto;font-size:18px; color: rgb(173, 118, 71);">
Сейчас онлайн[br /]
<span style="font-family: Roboto;font-size:18px;color:#D0BBAB;"><?=$stats_data["online_users"]+0; ?> чел</span>
</td>
<td width="166px" class="r_block" valign="top" align="center" style="font-family: Roboto;font-size:18px; color: rgb(173, 118, 71);">
Всего игроков[br /]
<span style="font-family: Roboto;font-size:18px;color:#D0BBAB;"><?=$stats_data["all_users"]+0; ?> чел</span>
</td>
<td width="166px" class="r_block" valign="top" align="center" style="font-family: Roboto;font-size:18px; color: rgb(173, 118, 71);">
Новых игроков[br /]
<span style="font-family: Roboto;font-size:18px;color:#D0BBAB;"><?=$stats_data["new_users"]+0; ?> чел</span>
</td>
<td width="166px" class="r_block" valign="top" align="center" style="font-family: Roboto;font-size:18px; color: rgb(173, 118, 71);">
Выплачено[br /]
<span style="font-family: Roboto;font-size:18px;color:#D0BBAB;"><?=sprintf("%.2f",$stats_data["all_payment"]); ?> руб</span>
</td>
<td width="166px" class="r_block" valign="top" align="center" style="font-family: Roboto;font-size:18px; color: rgb(173, 118, 71);">
Резерв проекта[br /]
<span style="font-family: Roboto;font-size:18px;color:#D0BBAB;"><?=sprintf("%.2f",$stats_data["all_insert"]-$stats_data["all_payment"]+0); ?> руб</span>
</td>
</tr>
</table>
<div style="height: 20px;"></div>
<table align="center" width="1210px" class="contentic">
<tr>
<td width="280px" valign="top">
<?PHP include("inc/_menu_left.php"); ?>