• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/log_tools.php
  • Класс: CSocNetLogTools
  • Вызов: CSocNetLogTools::SetUserCache
static function SetUserCache(
	$type = "log",
	$user_id = null,
	$max_id = null,
	$max_viewed_id = null,
	$count = null,
	$bSetViewTime = false,
	$LastViewTS = 0
)
{
	global $CACHE_MANAGER;

	$user_id = intval($user_id);

	$CACHE_MANAGER->Read(86400*365, "socnet_log_user_".$type."_".$user_id);
	$CACHE_MANAGER->Clean("socnet_log_user_".$type."_".$user_id);
	$CACHE_MANAGER->Read(86400*365, "socnet_log_user_".$type."_".$user_id);

	$CACHE_MANAGER->SetImmediate("socnet_log_user_".$type."_".$user_id, array(
		"Type" => $type,
		"UserID" => $user_id,
		"MaxID" => intval($max_id),
		"MaxViewedID" => intval($max_viewed_id),
		"Count" => intval($count),
		"LastVisitTS" => time(),
		"LastViewTS" => ($bSetViewTime ? time() : intval($LastViewTS))
	));
}