$sql->query('SELECT `balance`, `time` FROM `users` WHERE `id`="'.$user['id'].'" LIMIT 1');
$user=array_merge($user,$sql->get());
sys::user($user);
$auth=1;
}
}
// Заголовок
$title='';
// Навигация
$html->nav($cfg['name'],$cfg['http']);
include(DATA.'header.php');
// Подключение файла
if(in_array($route,$aRoute))
include(ENG.$route.'.php');
else
include(ENG.'404.php');
// Обновление ссылок
if(isset($html->arr['main']))
{
$html->upd(
array(
'[home]',
'[js]',
'[css]',
'[img]'
),
array(
$cfg['http'],
$cfg['http'].'template/js/',
$cfg['http'].'template/css/',
$cfg['http'].'template/images/'
),
'main'
);
}
// Онлайн игроков (общее количество всех игроков)
//$aop = $mcache->get('all_online_players'); //Если ваш хостинг чувствует себя плохо из за чрезмерной нагрузки от данного модуля, то включите кеширование, раскомментировав этот кусочек кода
if($aop=='')
{
$sql->query('SELECT SUM(`online`) FROM `servers` WHERE `status`="working" OR `status`="change"');
$sql->query('SELECT `id`, `login`, `time` FROM `users` ORDER BY `id` ASC');
$online='<span style="padding:0 5px;">';
while($staff=$sql->get())
{
if($staff['time']+15>$start_point){
$online.=$staff['login'].', ';
}
else{
$online.='';
}
}
$online.='</span>';
$html->set('online_users',$online);
$html->pack('all');
// Блоки
if($auth)
{
// Проверка наличия игрового сервера
$servers=$sql->query('(SELECT `id` FROM `servers` WHERE `user`="'.$user['id'].'" LIMIT 1) UNION (SELECT `id` FROM `owners` WHERE `user`="'.$user['id'].'" LIMIT 1)');
if($sql->num())
$html->unitall('all','servers',1,1);
else
$html->unitall('all','servers',0,1);
// Проверка наличия игрового сервера
$servers=$sql->query('SELECT `id` FROM `control` WHERE `user`="'.$user['id'].'" LIMIT 1');