Файл: core/footer.php
Строк: 65
<?php
/*
* @author mides <Mike Osendowski>
* @link http://midwm.org
* @copyright 2011-2014
*/
/*
* Online feature
*/
DB::run()->query("delete from `online` where `time` < ?;", array(TIME - 60 * $config['online_updmin']));
if (is_auth()) {
$querySingle = DB::run()->querySingle("SELECT `userid` FROM `online` WHERE `userid` = ?;", array($u['id']));
if ($querySingle)
{
DB::run()->query("update `online` set `ip` = ?, `browser` = ?, `location` = ?, `time` = ? where `userid` = ?;", array($ip, $browser, $request_uri, TIME, $u['id']));
}
else
{
DB::run()->query("insert into `online` set `userid` = ?, `ip` = ?, `browser` = ?, `location` = ?, `time` = ?;", array($u['id'], $ip, $browser, $request_uri, TIME));
}
} else {
$querySingle = DB::run()->querySingle("SELECT `id` FROM `online` WHERE `ip` = ? LIMIT 1;", array($ip));
if ($querySingle)
{
DB::run()->query("update `online` set `browser` = ?, `location` = ?, `time` = ? where `ip` = ?;", array($browser, $request_uri, TIME, $ip));
} else {
DB::run()->query("insert into `online` set `ip` = ?, `browser` = ?, `location` = ?, `time` = ?;", array($ip, $browser, $request_uri, TIME));
}
}
$onlineUsersCount = DB::run()->querySingle("select count(`id`) from `online` where `userid` > 0;");
$onlineAllCount = DB::run()->querySingle("select count(`id`) from `online`;");
$theme = file_exists(LEVEL.'themes/'.$config['theme'].'/html/'.$tpl['file'].'.htm') ? $config['theme'] : 'mobile_default';
require_once LEVEL.'themes/'.$theme.'/html/footer'.(isset($index) ? '_index' : FALSE).'.htm';