diff --git a/boardlist.php b/boardlist.php index a85c06f..161aca8 100644 --- a/boardlist.php +++ b/boardlist.php @@ -57,10 +57,18 @@ foreach($arrDevices as $device): $arrUserFields = CUser::getFields($device['user']); + + $cacheId = md5('CIoT::isOnline_'.$device['id']); + if(CCache::check($cacheId) and CCache::getAge($cacheId) < DEVICE_ONLINE_TIME) { + $isDeviceOnline = CCache::get($cacheId); + } else { + $isDeviceOnline = CIoT::isOnline($device['id']); + CCache::write($cacheId, $isDeviceOnline); + } ?> - OnlineOffline + OnlineOffline diff --git a/users.php b/users.php index 420073f..89d6bd8 100644 --- a/users.php +++ b/users.php @@ -37,11 +37,21 @@ require_once __DIR__ . '/inc/header.php'; CPagination::execute($_REQUEST['page'], CUser::countUsers(), PAGINATION_LIMIT); $limit = CPagination::getLimit(); ?> - + - OnlineOffline